summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:07 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:07 +0000
commit0097b6fe2d1739e46e4e7726aaa481b6dc84870c (patch)
tree5e279fda13b69a02c684338ee803defbda33ab08 /hw
parentc57959ad6a4c0f5329762f401fd7871ffb2ee90c (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branch
Diffstat (limited to 'hw')
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Localizable.stringsbin1420 -> 1426 bytes
-rw-r--r--hw/darwin/bundle/English.lproj/Localizable.strings8
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib8
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nibbin20327 -> 20640 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/Localizable.stringsbin1486 -> 1492 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/Localizable.stringsbin1452 -> 1458 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Localizable.stringsbin1146 -> 1152 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Localizable.stringsbin1498 -> 1504 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Localizable.stringsbin1474 -> 1480 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Localizable.stringsbin1458 -> 1464 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/Localizable.stringsbin1326 -> 1332 bytes
-rw-r--r--hw/darwin/darwin.c174
-rw-r--r--hw/darwin/darwin.h78
-rw-r--r--hw/darwin/darwinClut8.h2
-rw-r--r--hw/darwin/darwinEvents.c15
-rw-r--r--hw/darwin/darwinKeyboard.c239
-rw-r--r--hw/darwin/darwinKeyboard.h50
-rw-r--r--hw/darwin/iokit/xfIOKit.c770
-rw-r--r--hw/darwin/iokit/xfIOKit.h57
-rw-r--r--hw/darwin/iokit/xfIOKitCursor.c735
-rw-r--r--hw/darwin/iokit/xfIOKitStartup.c115
-rw-r--r--hw/darwin/quartz/Preferences.h49
-rw-r--r--hw/darwin/quartz/Preferences.m80
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj802
-rw-r--r--hw/darwin/quartz/XDarwinStartup.c5
-rw-r--r--hw/darwin/quartz/XServer.h35
-rw-r--r--hw/darwin/quartz/XServer.m537
-rw-r--r--hw/darwin/quartz/applewm.c697
-rw-r--r--hw/darwin/quartz/applewmExt.h83
-rw-r--r--hw/darwin/quartz/cr/XView.h42
-rw-r--r--hw/darwin/quartz/cr/XView.m74
-rw-r--r--hw/darwin/quartz/cr/cr.h62
-rw-r--r--hw/darwin/quartz/cr/crAppleWM.m157
-rw-r--r--hw/darwin/quartz/cr/crFrame.m403
-rw-r--r--hw/darwin/quartz/cr/crScreen.m321
-rw-r--r--hw/darwin/quartz/fullscreen/fullscreen.c567
-rw-r--r--hw/darwin/quartz/fullscreen/quartzCursor.c653
-rw-r--r--hw/darwin/quartz/fullscreen/quartzCursor.h44
-rw-r--r--hw/darwin/quartz/keysym2ucs.c909
-rw-r--r--hw/darwin/quartz/keysym2ucs.h37
-rw-r--r--hw/darwin/quartz/pseudoramiX.c4
-rw-r--r--hw/darwin/quartz/pseudoramiX.h3
-rw-r--r--hw/darwin/quartz/quartz.c159
-rw-r--r--hw/darwin/quartz/quartz.h91
-rw-r--r--hw/darwin/quartz/quartzAudio.c6
-rw-r--r--hw/darwin/quartz/quartzCocoa.m11
-rw-r--r--hw/darwin/quartz/quartzCommon.h18
-rw-r--r--hw/darwin/quartz/quartzKeyboard.c380
-rw-r--r--hw/darwin/quartz/quartzStartup.c94
-rw-r--r--hw/darwin/quartz/xpr/Xplugin.h591
-rw-r--r--hw/darwin/quartz/xpr/appledri.c350
-rw-r--r--hw/darwin/quartz/xpr/dri.c690
-rw-r--r--hw/darwin/quartz/xpr/dri.h130
-rw-r--r--hw/darwin/quartz/xpr/dristruct.h82
-rw-r--r--hw/darwin/quartz/xpr/x-hash.c341
-rw-r--r--hw/darwin/quartz/xpr/x-hash.h62
-rw-r--r--hw/darwin/quartz/xpr/x-hook.c106
-rw-r--r--hw/darwin/quartz/xpr/x-hook.h44
-rw-r--r--hw/darwin/quartz/xpr/x-list.c316
-rw-r--r--hw/darwin/quartz/xpr/x-list.h78
-rw-r--r--hw/darwin/quartz/xpr/xpr.h47
-rw-r--r--hw/darwin/quartz/xpr/xprAppleWM.c99
-rw-r--r--hw/darwin/quartz/xpr/xprCursor.c420
-rw-r--r--hw/darwin/quartz/xpr/xprFrame.c439
-rw-r--r--hw/darwin/quartz/xpr/xprScreen.c378
-rw-r--r--hw/darwin/utils/dumpkeymap.c3
-rw-r--r--hw/vfb/InitInput.c38
-rw-r--r--hw/vfb/InitOutput.c152
-rw-r--r--hw/xfree86/common/atKeynames.h94
-rw-r--r--hw/xfree86/common/compiler.h61
-rw-r--r--hw/xfree86/common/fourcc.h33
-rw-r--r--hw/xfree86/common/modeline2c.pl37
-rw-r--r--hw/xfree86/common/scoasm.h29
-rw-r--r--hw/xfree86/common/xf86.h57
-rw-r--r--hw/xfree86/common/xf86AutoConfig.c354
-rw-r--r--hw/xfree86/common/xf86Bus.c36
-rw-r--r--hw/xfree86/common/xf86Bus.h29
-rw-r--r--hw/xfree86/common/xf86Config.c477
-rw-r--r--hw/xfree86/common/xf86Config.h38
-rw-r--r--hw/xfree86/common/xf86Configure.c12
-rw-r--r--hw/xfree86/common/xf86Cursor.c38
-rw-r--r--hw/xfree86/common/xf86DGA.c33
-rw-r--r--hw/xfree86/common/xf86DPMS.c52
-rw-r--r--hw/xfree86/common/xf86Date.h30
-rw-r--r--hw/xfree86/common/xf86Debug.c35
-rw-r--r--hw/xfree86/common/xf86DefModes.c9
-rw-r--r--hw/xfree86/common/xf86DoProbe.c40
-rw-r--r--hw/xfree86/common/xf86DoScanPci.c57
-rw-r--r--hw/xfree86/common/xf86Events.c185
-rw-r--r--hw/xfree86/common/xf86Globals.c27
-rw-r--r--hw/xfree86/common/xf86Helper.c315
-rw-r--r--hw/xfree86/common/xf86InPriv.h29
-rw-r--r--hw/xfree86/common/xf86Init.c238
-rw-r--r--hw/xfree86/common/xf86Io.c34
-rw-r--r--hw/xfree86/common/xf86Kbd.c33
-rw-r--r--hw/xfree86/common/xf86KbdBSD.c39
-rw-r--r--hw/xfree86/common/xf86KbdLnx.c29
-rw-r--r--hw/xfree86/common/xf86Keymap.h30
-rw-r--r--hw/xfree86/common/xf86MiscExt.c105
-rw-r--r--hw/xfree86/common/xf86Mode.c357
-rw-r--r--hw/xfree86/common/xf86Module.h29
-rw-r--r--hw/xfree86/common/xf86Opt.h42
-rw-r--r--hw/xfree86/common/xf86Option.c181
-rw-r--r--hw/xfree86/common/xf86PM.c29
-rw-r--r--hw/xfree86/common/xf86PciInfo.h99
-rw-r--r--hw/xfree86/common/xf86Priv.h30
-rw-r--r--hw/xfree86/common/xf86Privstr.h60
-rw-r--r--hw/xfree86/common/xf86RandR.c23
-rw-r--r--hw/xfree86/common/xf86Resources.h29
-rw-r--r--hw/xfree86/common/xf86Version.h33
-rw-r--r--hw/xfree86/common/xf86Versions.c77
-rw-r--r--hw/xfree86/common/xf86VidMode.c43
-rw-r--r--hw/xfree86/common/xf86XKB.c29
-rw-r--r--hw/xfree86/common/xf86Xinput.c33
-rw-r--r--hw/xfree86/common/xf86Xinput.h29
-rw-r--r--hw/xfree86/common/xf86cmap.c53
-rw-r--r--hw/xfree86/common/xf86cmap.h46
-rw-r--r--hw/xfree86/common/xf86fbBus.c27
-rw-r--r--hw/xfree86/common/xf86fbman.c315
-rw-r--r--hw/xfree86/common/xf86fbman.h36
-rw-r--r--hw/xfree86/common/xf86isaBus.c29
-rw-r--r--hw/xfree86/common/xf86noBus.c27
-rw-r--r--hw/xfree86/common/xf86pciBus.c185
-rw-r--r--hw/xfree86/common/xf86pciBus.h33
-rw-r--r--hw/xfree86/common/xf86str.h81
-rw-r--r--hw/xfree86/common/xf86xv.c769
-rw-r--r--hw/xfree86/common/xf86xv.h99
-rw-r--r--hw/xfree86/common/xf86xvmc.c40
-rw-r--r--hw/xfree86/common/xf86xvmc.h32
-rw-r--r--hw/xfree86/common/xf86xvpriv.h86
-rw-r--r--hw/xfree86/common/xisb.c6
-rw-r--r--hw/xfree86/ddc/ddcProperty.c12
-rw-r--r--hw/xfree86/ddc/print_edid.c4
-rw-r--r--hw/xfree86/ddc/print_vdif.c2
-rw-r--r--hw/xfree86/ddc/vdif.h7
-rw-r--r--hw/xfree86/ddc/xf86DDC.c39
-rw-r--r--hw/xfree86/dixmods/extmod/dgaproc.h5
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c110
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.h144
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga.c7
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c12
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dgaext.h8
-rw-r--r--hw/xfree86/dixmods/extmod/xf86misc.c93
-rw-r--r--hw/xfree86/dixmods/extmod/xf86miscproc.h4
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c81
-rw-r--r--hw/xfree86/dixmods/ftmodule.c6
-rw-r--r--hw/xfree86/dixmods/glxmodule.c15
-rw-r--r--hw/xfree86/doc/README.DRI4
-rw-r--r--hw/xfree86/doc/README.fonts136
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG1716
-rw-r--r--hw/xfree86/doc/devel/README.DRIcomp36
-rw-r--r--hw/xfree86/doc/sgml/DESIGN.sgml10
-rw-r--r--hw/xfree86/dri/dri.c4
-rw-r--r--hw/xfree86/dri/sarea.h84
-rw-r--r--hw/xfree86/dri/xf86dri.c4
-rw-r--r--hw/xfree86/dummylib/dummylib.h4
-rw-r--r--hw/xfree86/dummylib/logvwrite.c18
-rw-r--r--hw/xfree86/dummylib/xf86drvmsg.c5
-rw-r--r--hw/xfree86/dummylib/xf86drvmsgverb.c5
-rw-r--r--hw/xfree86/dummylib/xf86errorf.c7
-rw-r--r--hw/xfree86/dummylib/xf86errorfverb.c5
-rw-r--r--hw/xfree86/dummylib/xf86msg.c5
-rw-r--r--hw/xfree86/dummylib/xf86msgverb.c5
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c13
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.h4
-rw-r--r--hw/xfree86/fbdevhw/fbdevhwstub.c4
-rw-r--r--hw/xfree86/getconfig/cfg.man.pre138
-rw-r--r--hw/xfree86/getconfig/cfg.sample111
-rw-r--r--hw/xfree86/getconfig/getconfig45
-rw-r--r--hw/xfree86/getconfig/getconfig.man.pre98
-rw-r--r--hw/xfree86/getconfig/getconfig.pl429
-rw-r--r--hw/xfree86/i2c/xf86i2c.c35
-rw-r--r--hw/xfree86/i2c/xf86i2c.h6
-rw-r--r--hw/xfree86/int10/generic.c15
-rw-r--r--hw/xfree86/int10/helper_exec.c21
-rw-r--r--hw/xfree86/int10/xf86int10.c2
-rw-r--r--hw/xfree86/loader/aout.h133
-rw-r--r--hw/xfree86/loader/aoutloader.c422
-rw-r--r--hw/xfree86/loader/aoutloader.h4
-rw-r--r--hw/xfree86/loader/ar.h62
-rw-r--r--hw/xfree86/loader/coff.h181
-rw-r--r--hw/xfree86/loader/coffloader.c1459
-rw-r--r--hw/xfree86/loader/coffloader.h4
-rw-r--r--hw/xfree86/loader/dixsym.c585
-rw-r--r--hw/xfree86/loader/dlloader.c21
-rw-r--r--hw/xfree86/loader/elf.h313
-rw-r--r--hw/xfree86/loader/elfloader.c3117
-rw-r--r--hw/xfree86/loader/elfloader.h4
-rw-r--r--hw/xfree86/loader/extsym.c39
-rw-r--r--hw/xfree86/loader/fontsym.c137
-rw-r--r--hw/xfree86/loader/hash.c321
-rw-r--r--hw/xfree86/loader/loader.c1001
-rw-r--r--hw/xfree86/loader/loader.h177
-rw-r--r--hw/xfree86/loader/loaderProcs.h75
-rw-r--r--hw/xfree86/loader/loadext.c558
-rw-r--r--hw/xfree86/loader/loadfont.c84
-rw-r--r--hw/xfree86/loader/loadmod.c1904
-rw-r--r--hw/xfree86/loader/misym.c281
-rw-r--r--hw/xfree86/loader/os.c39
-rw-r--r--hw/xfree86/loader/sym.h8
-rw-r--r--hw/xfree86/loader/xf86sym.c1723
-rw-r--r--hw/xfree86/os-support/assyntax.h29
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c20
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c26
-rw-r--r--hw/xfree86/os-support/bsd/bsdResource.c4
-rw-r--r--hw/xfree86/os-support/bsd/bsd_axp.c6
-rw-r--r--hw/xfree86/os-support/bsd/bsd_init.c46
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.c8
-rw-r--r--hw/xfree86/os-support/bsd/bsd_mouse.c144
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c42
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c17
-rw-r--r--hw/xfree86/os-support/bsd/sparc64_video.c9
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.c21
-rw-r--r--hw/xfree86/os-support/bus/Pci.c126
-rw-r--r--hw/xfree86/os-support/bus/Pci.h56
-rw-r--r--hw/xfree86/os-support/bus/Sbus.c23
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.c4
-rw-r--r--hw/xfree86/os-support/bus/freebsdPci.c4
-rw-r--r--hw/xfree86/os-support/bus/ix86Pci.c80
-rw-r--r--hw/xfree86/os-support/bus/netbsdPci.c13
-rw-r--r--hw/xfree86/os-support/bus/sparcPci.c8
-rw-r--r--hw/xfree86/os-support/bus/xf86Pci.h36
-rw-r--r--hw/xfree86/os-support/bus/xf86Sbus.h8
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.c39
-rw-r--r--hw/xfree86/os-support/int10Defines.h28
-rw-r--r--hw/xfree86/os-support/linux/int10/linux.c16
-rw-r--r--hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c4
-rw-r--r--hw/xfree86/os-support/linux/lnx_agp.c14
-rw-r--r--hw/xfree86/os-support/linux/lnx_io.c8
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.c18
-rw-r--r--hw/xfree86/os-support/linux/lnx_mouse.c175
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c55
-rw-r--r--hw/xfree86/os-support/misc/Delay.c5
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.c5
-rw-r--r--hw/xfree86/os-support/sco/VTsw_sco.c5
-rw-r--r--hw/xfree86/os-support/sco/sco_video.c9
-rw-r--r--hw/xfree86/os-support/shared/agp_noop.c33
-rw-r--r--hw/xfree86/os-support/shared/at_scancode.c56
-rw-r--r--hw/xfree86/os-support/shared/kbd.c28
-rw-r--r--hw/xfree86/os-support/shared/kmod_noop.c27
-rw-r--r--hw/xfree86/os-support/shared/libc_wrapper.c53
-rw-r--r--hw/xfree86/os-support/shared/pm_noop.c28
-rw-r--r--hw/xfree86/os-support/shared/posix_tty.c9
-rw-r--r--hw/xfree86/os-support/shared/sigio.c31
-rw-r--r--hw/xfree86/os-support/shared/sigiostubs.c31
-rw-r--r--hw/xfree86/os-support/shared/stdPci.c31
-rw-r--r--hw/xfree86/os-support/shared/stdResource.c34
-rw-r--r--hw/xfree86/os-support/shared/vidmem.c30
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.c28
-rw-r--r--hw/xfree86/os-support/solaris/sun_bios.c6
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbd.c7
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbdEv.c256
-rw-r--r--hw/xfree86/os-support/sysv/sysv_video.c11
-rw-r--r--hw/xfree86/os-support/xf86OSKbd.h49
-rw-r--r--hw/xfree86/os-support/xf86OSmouse.h124
-rw-r--r--hw/xfree86/os-support/xf86OSpriv.h28
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h31
-rw-r--r--hw/xfree86/os-support/xf86_OSproc.h5
-rw-r--r--hw/xfree86/os-support/xf86_ansic.h7
-rw-r--r--hw/xfree86/os-support/xf86_libc.h44
-rw-r--r--hw/xfree86/parser/Configint.h29
-rw-r--r--hw/xfree86/parser/Device.c29
-rw-r--r--hw/xfree86/parser/Files.c29
-rw-r--r--hw/xfree86/parser/Flags.c29
-rw-r--r--hw/xfree86/parser/Input.c29
-rw-r--r--hw/xfree86/parser/Keyboard.c35
-rw-r--r--hw/xfree86/parser/Layout.c29
-rw-r--r--hw/xfree86/parser/Module.c29
-rw-r--r--hw/xfree86/parser/Monitor.c29
-rw-r--r--hw/xfree86/parser/Pointer.c29
-rw-r--r--hw/xfree86/parser/Screen.c65
-rw-r--r--hw/xfree86/parser/Vendor.c29
-rw-r--r--hw/xfree86/parser/Video.c28
-rw-r--r--hw/xfree86/parser/configProcs.h28
-rw-r--r--hw/xfree86/parser/read.c29
-rw-r--r--hw/xfree86/parser/scan.c281
-rw-r--r--hw/xfree86/parser/write.c29
-rw-r--r--hw/xfree86/parser/xf86Optrec.h29
-rw-r--r--hw/xfree86/parser/xf86Parser.h31
-rw-r--r--hw/xfree86/parser/xf86tokens.h29
-rw-r--r--hw/xfree86/ramdac/BT.c4
-rw-r--r--hw/xfree86/ramdac/IBM.c4
-rw-r--r--hw/xfree86/ramdac/TI.c4
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c9
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.c14
-rw-r--r--hw/xfree86/scanpci/extrapci.ids15
-rw-r--r--hw/xfree86/scanpci/pci.ids239
-rw-r--r--hw/xfree86/scanpci/pciid2c.pl27
-rw-r--r--hw/xfree86/scanpci/xf86PciData.h29
-rw-r--r--hw/xfree86/scanpci/xf86PciStdIds.h1819
-rw-r--r--hw/xfree86/scanpci/xf86PciStr.h30
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.c34
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.h30
-rw-r--r--hw/xfree86/shadowfb/shadow.c26
-rw-r--r--hw/xfree86/utils/kbd_mode/sun-kbd_mode.c10
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.c31
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.man.pre4
-rw-r--r--hw/xfree86/utils/xorgcfg/card-cfg.c6
-rw-r--r--hw/xfree86/utils/xorgcfg/config.c10
-rw-r--r--hw/xfree86/utils/xorgcfg/config.h23
-rw-r--r--hw/xfree86/utils/xorgcfg/expert.c28
-rw-r--r--hw/xfree86/utils/xorgcfg/help.c12
-rw-r--r--hw/xfree86/utils/xorgcfg/loadmod.c30
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor-cfg.c10
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse-cfg.c11
-rw-r--r--hw/xfree86/utils/xorgcfg/screen-cfg.c6
-rw-r--r--hw/xfree86/utils/xorgcfg/stubs.c7
-rw-r--r--hw/xfree86/utils/xorgcfg/text-mode.c34
-rw-r--r--hw/xfree86/utils/xorgcfg/vidmode.c22
-rw-r--r--hw/xfree86/utils/xorgcfg/xf86config.c5
-rw-r--r--hw/xfree86/vbe/vbe.c17
-rw-r--r--hw/xfree86/vbe/vbe.h16
-rw-r--r--hw/xfree86/vbe/vbeModes.c12
-rw-r--r--hw/xfree86/vgahw/vgaHW.c34
-rw-r--r--hw/xfree86/x86emu/fpu.c47
-rw-r--r--hw/xfree86/x86emu/ops.c12
-rw-r--r--hw/xfree86/x86emu/ops2.c4
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu_regs.h5
-rw-r--r--hw/xfree86/x86emu/x86emu/regs.h6
-rw-r--r--hw/xfree86/x86emu/x86emu/types.h7
-rw-r--r--hw/xfree86/xaa/xaaBitBlt.c4
-rw-r--r--hw/xfree86/xaa/xaaCpyPlane.c4
-rw-r--r--hw/xfree86/xaa/xaaCpyWin.c4
-rw-r--r--hw/xfree86/xaa/xaaFillPoly.c8
-rw-r--r--hw/xfree86/xaa/xaaFillRect.c6
-rw-r--r--hw/xfree86/xaa/xaaImage.c5
-rw-r--r--hw/xfree86/xaa/xaaNonTEText.c2
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c4
-rw-r--r--hw/xfree86/xaa/xaaOverlayDF.c6
-rw-r--r--hw/xfree86/xaa/xaaPCache.c14
-rw-r--r--hw/xfree86/xaa/xaaPict.c12
-rw-r--r--hw/xfree86/xaa/xaaStateChange.c5
-rw-r--r--hw/xfree86/xaa/xaaStipple.c66
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c4
-rw-r--r--hw/xfree86/xaa/xaalocal.h4
-rw-r--r--hw/xfree86/xf4bpp/emulTile.c4
-rw-r--r--hw/xfree86/xf4bpp/mfbfillarc.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbimggblt.c8
-rw-r--r--hw/xfree86/xf4bpp/mfbline.c18
-rw-r--r--hw/xfree86/xf4bpp/ppcCpArea.c34
-rw-r--r--hw/xfree86/xf4bpp/ppcFillRct.c10
-rw-r--r--hw/xfree86/xf4bpp/ppcGCstr.h6
-rw-r--r--hw/xfree86/xf4bpp/ppcIO.c4
-rw-r--r--hw/xfree86/xf4bpp/ppcPixFS.c22
-rw-r--r--hw/xfree86/xf4bpp/ppcPntWin.c6
-rw-r--r--hw/xfree86/xf4bpp/ppcWinFS.c22
-rw-r--r--hw/xfree86/xf4bpp/vgaBitBlt.c15
-rw-r--r--hw/xfree86/xf4bpp/vgaImages.c11
-rw-r--r--hw/xfree86/xf4bpp/vgaSolid.c8
-rw-r--r--hw/xfree86/xf4bpp/vgaStipple.c5
-rw-r--r--hw/xfree86/xf4bpp/xf4bpp.h154
-rw-r--r--hw/xfree86/xf8_16bpp/cfbwindow.c6
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32.h14
-rw-r--r--hw/xfree86/xf8_32bpp/cfbbstore.c6
-rw-r--r--hw/xfree86/xf8_32bpp/cfbcpyarea.c24
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgcunder.c9
-rw-r--r--hw/xfree86/xf8_32bpp/cfbimage.c4
-rw-r--r--hw/xfree86/xf8_32bpp/cfbscrinit.c20
-rw-r--r--hw/xfree86/xf8_32bpp/cfbwindow.c8
-rw-r--r--hw/xfree86/xf8_32wid/cfbwindow.c8
-rw-r--r--hw/xnest/Args.c8
-rw-r--r--hw/xnest/Args.h2
-rw-r--r--hw/xnest/Color.c72
-rw-r--r--hw/xnest/Color.h26
-rw-r--r--hw/xnest/Cursor.c42
-rw-r--r--hw/xnest/Display.c11
-rw-r--r--hw/xnest/Display.h6
-rw-r--r--hw/xnest/Events.c31
-rw-r--r--hw/xnest/Events.h6
-rw-r--r--hw/xnest/Font.c14
-rw-r--r--hw/xnest/GC.c47
-rw-r--r--hw/xnest/GCOps.c253
-rw-r--r--hw/xnest/GCOps.h73
-rw-r--r--hw/xnest/GetTime.c4
-rw-r--r--hw/xnest/Handlers.c13
-rw-r--r--hw/xnest/Handlers.h6
-rw-r--r--hw/xnest/Init.c27
-rw-r--r--hw/xnest/Keyboard.c41
-rw-r--r--hw/xnest/Keyboard.h7
-rw-r--r--hw/xnest/Pixmap.c19
-rw-r--r--hw/xnest/Pointer.c16
-rw-r--r--hw/xnest/Pointer.h5
-rw-r--r--hw/xnest/Screen.c111
-rw-r--r--hw/xnest/Screen.h7
-rw-r--r--hw/xnest/TestExt.c23
-rw-r--r--hw/xnest/Visual.c15
-rw-r--r--hw/xnest/Visual.h7
-rw-r--r--hw/xnest/Window.c84
-rw-r--r--hw/xnest/XNCursor.h18
-rw-r--r--hw/xnest/XNFont.h5
-rw-r--r--hw/xnest/XNGC.h19
-rw-r--r--hw/xnest/XNPixmap.h9
-rw-r--r--hw/xnest/XNWindow.h32
-rw-r--r--hw/xnest/Xnest.man.pre4
-rw-r--r--hw/xnest/os2Stub.c9
-rw-r--r--hw/xwin/InitInput.c31
-rw-r--r--hw/xwin/InitOutput.c137
-rw-r--r--hw/xwin/XWin.man4
-rw-r--r--hw/xwin/XWin.rc31
-rw-r--r--hw/xwin/_usr_X11R6_lib_X11_system.XWinrc105
-rw-r--r--hw/xwin/win.h124
-rw-r--r--hw/xwin/winblock.c8
-rw-r--r--hw/xwin/winclipboard.h4
-rw-r--r--hw/xwin/winclipboardinit.c2
-rw-r--r--hw/xwin/winclipboardtextconv.c2
-rw-r--r--hw/xwin/winclipboardthread.c55
-rw-r--r--hw/xwin/winclipboardunicode.c2
-rw-r--r--hw/xwin/winclipboardwndproc.c2
-rw-r--r--hw/xwin/winclipboardxevents.c83
-rw-r--r--hw/xwin/winconfig.c101
-rw-r--r--hw/xwin/wincreatewnd.c41
-rw-r--r--hw/xwin/wincursor.c17
-rwxr-xr-xhw/xwin/windialogs.c320
-rw-r--r--hw/xwin/winengine.c9
-rw-r--r--hw/xwin/winerror.c12
-rw-r--r--hw/xwin/winfillsp.c1070
-rw-r--r--hw/xwin/winfont.c6
-rw-r--r--hw/xwin/wingc.c273
-rw-r--r--hw/xwin/wingetsp.c126
-rw-r--r--hw/xwin/winkeybd.c24
-rw-r--r--hw/xwin/winmsg.c33
-rw-r--r--hw/xwin/winmsg.h27
-rwxr-xr-xhw/xwin/winmultiwindowclass.c284
-rwxr-xr-xhw/xwin/winmultiwindowclass.h110
-rwxr-xr-xhw/xwin/winmultiwindowicons.c378
-rwxr-xr-xhw/xwin/winmultiwindowshape.c212
-rw-r--r--hw/xwin/winmultiwindowwindow.c1272
-rw-r--r--hw/xwin/winmultiwindowwm.c458
-rwxr-xr-xhw/xwin/winmultiwindowwndproc.c1005
-rw-r--r--hw/xwin/winnativegdi.c30
-rw-r--r--hw/xwin/winpfbdd.c20
-rw-r--r--hw/xwin/winpixmap.c8
-rw-r--r--hw/xwin/winpolyline.c16
-rw-r--r--hw/xwin/winprefs.c661
-rw-r--r--hw/xwin/winprefs.h147
-rw-r--r--hw/xwin/winprefslex.l113
-rw-r--r--hw/xwin/winprefsyacc.y334
-rw-r--r--hw/xwin/winpushpxl.c226
-rw-r--r--hw/xwin/winrop.c139
-rw-r--r--hw/xwin/winscrinit.c14
-rw-r--r--hw/xwin/winsetsp.c363
-rw-r--r--hw/xwin/winshaddd.c15
-rw-r--r--hw/xwin/winshadddnl.c38
-rw-r--r--hw/xwin/winshadgdi.c26
-rwxr-xr-xhw/xwin/wintrayicon.c209
-rwxr-xr-xhw/xwin/winvideo.c206
-rw-r--r--hw/xwin/winwakeup.c10
-rw-r--r--hw/xwin/winwindow.c118
-rw-r--r--hw/xwin/winwindow.h59
-rw-r--r--hw/xwin/winwndproc.c253
450 files changed, 38597 insertions, 12805 deletions
diff --git a/hw/darwin/bundle/Dutch.lproj/Localizable.strings b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
index 22d7683eb..6abd91072 100644
--- a/hw/darwin/bundle/Dutch.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/English.lproj/Localizable.strings b/hw/darwin/bundle/English.lproj/Localizable.strings
index 6025a2469..241d1585b 100644
--- a/hw/darwin/bundle/English.lproj/Localizable.strings
+++ b/hw/darwin/bundle/English.lproj/Localizable.strings
@@ -1,5 +1,5 @@
/* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.4 2003/11/04 22:48:14 torrey Exp $ */
/* Title of alert panel */
"Quit X server?" = "Quit X server?";
@@ -14,10 +14,10 @@
"Cancel" = "Cancel";
/* Default keymapping file */
-"USA.keymapping" = "USA.keymapping"
+"USA.keymapping" = "USA.keymapping";
/* Default switch string */
-"Cmd-Opt-a" = "Cmd-Opt-a"
+"Cmd-Opt-a" = "Cmd-Opt-a";
/* Button title when changing switch key */
-"Press key" = "Press 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
index ba1e3a206..77f345a4e 100644
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
@@ -41,14 +41,20 @@
},
{
ACTIONS = {
+ bringAllToFront = id;
closeHelpAndShow = id;
+ itemSelected = id;
+ nextWindow = id;
+ previousWindow = id;
showAction = id;
+ showSwitchPanel = id;
startFullScreen = id;
startRootless = id;
};
CLASS = XServer;
LANGUAGE = ObjC;
OUTLETS = {
+ dockMenu = NSMenu;
helpWindow = NSWindow;
modeWindow = NSWindow;
startFullScreenButton = NSButton;
@@ -56,6 +62,8 @@
startupHelpButton = NSButton;
startupModeButton = NSButton;
switchWindow = NSPanel;
+ windowMenu = NSMenu;
+ windowSeparator = NSMenuItem;
};
SUPERCLASS = NSObject;
}
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
index 7aedf01c2..5aa102278 100644
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/Localizable.strings b/hw/darwin/bundle/French.lproj/Localizable.strings
index 591f73cae..21c4a99c1 100644
--- a/hw/darwin/bundle/French.lproj/Localizable.strings
+++ b/hw/darwin/bundle/French.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/Localizable.strings b/hw/darwin/bundle/German.lproj/Localizable.strings
index 365cc291a..5db6306ec 100644
--- a/hw/darwin/bundle/German.lproj/Localizable.strings
+++ b/hw/darwin/bundle/German.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/Localizable.strings b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
index 091138dd5..c5c26d61a 100644
--- a/hw/darwin/bundle/Japanese.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
index b3edbb41d..c79b282f6 100644
--- a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/Localizable.strings b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
index 06eb0e5fb..5bf813f1f 100644
--- a/hw/darwin/bundle/Spanish.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/Localizable.strings b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
index 7ade67d55..9709e5469 100644
--- a/hw/darwin/bundle/Swedish.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/Localizable.strings b/hw/darwin/bundle/ko.lproj/Localizable.strings
index 2e7137b05..fb8c77e0d 100644
--- a/hw/darwin/bundle/ko.lproj/Localizable.strings
+++ b/hw/darwin/bundle/ko.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
index ff5ae1b33..a7a0d839c 100644
--- a/hw/darwin/darwin.c
+++ b/hw/darwin/darwin.c
@@ -1,11 +1,11 @@
/**************************************************************
*
* Shared code for the Darwin X Server
- * running with Quartz or the IOKit
+ * running with Quartz or IOKit display mode
*
**************************************************************/
/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ * 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"),
@@ -29,7 +29,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -52,6 +52,7 @@
#include <sys/syslimits.h>
#include <stdio.h>
#include <fcntl.h>
+#include <unistd.h>
#define NO_CFPLUGIN
#include <IOKit/IOKitLib.h>
@@ -60,8 +61,6 @@
#include "darwin.h"
#include "darwinClut8.h"
-#include "quartz/quartz.h"
-#include "xfIOKit.h"
/*
* X server shared global variables
@@ -69,9 +68,9 @@
int darwinScreensFound = 0;
int darwinScreenIndex = 0;
io_connect_t darwinParamConnect = 0;
-int darwinEventFD = -1;
-Bool quartz = FALSE;
-int quartzMouseAccelChange = 1;
+int darwinEventReadFD = -1;
+int darwinEventWriteFD = -1;
+int darwinMouseAccelChange = 1;
int darwinFakeButtons = 0;
// location of X11's (0,0) point in global screen coordinates
@@ -113,7 +112,7 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
#define PRE_RELEASE XF86_VERSION_SNAP
#endif
-static void
+void
DarwinPrintBanner()
{
#if PRE_RELEASE
@@ -193,11 +192,7 @@ static Bool DarwinAddScreen(
SCREEN_PRIV(pScreen) = dfb;
// setup hardware/mode specific details
- if (quartz) {
- ret = QuartzAddScreen(foundIndex, pScreen);
- } else {
- ret = XFIOKitAddScreen(foundIndex, pScreen);
- }
+ ret = DarwinModeAddScreen(foundIndex, pScreen);
foundIndex++;
if (! ret)
return FALSE;
@@ -276,14 +271,8 @@ static Bool DarwinAddScreen(
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;
- }
+ if (!DarwinModeSetupScreen(index, pScreen)) {
+ return FALSE;
}
// create and install the default colormap and
@@ -337,7 +326,7 @@ static void DarwinChangePointerControl(
kern_return_t kr;
double acceleration;
- if (!quartzMouseAccelChange)
+ if (!darwinMouseAccelChange)
return;
acceleration = ctrl->num / ctrl->den;
@@ -378,13 +367,13 @@ static int DarwinMouseProc(
case DEVICE_ON:
pPointer->public.on = TRUE;
- AddEnabledDevice( darwinEventFD );
+ AddEnabledDevice( darwinEventReadFD );
return Success;
case DEVICE_CLOSE:
case DEVICE_OFF:
pPointer->public.on = FALSE;
- RemoveEnabledDevice( darwinEventFD );
+ RemoveEnabledDevice( darwinEventReadFD );
return Success;
}
@@ -404,11 +393,11 @@ static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
break;
case DEVICE_ON:
pDev->public.on = TRUE;
- AddEnabledDevice( darwinEventFD );
+ AddEnabledDevice( darwinEventReadFD );
break;
case DEVICE_OFF:
pDev->public.on = FALSE;
- RemoveEnabledDevice( darwinEventFD );
+ RemoveEnabledDevice( darwinEventReadFD );
break;
case DEVICE_CLOSE:
break;
@@ -529,12 +518,61 @@ void InitInput( int argc, char **argv )
darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
RegisterKeyboardDevice( darwinKeyboard );
- DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
+ if (serverGeneration == 1) {
+ DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
+ }
- if (quartz) {
- QuartzInitInput(argc, argv);
- } else {
- XFIOKitInitInput(argc, argv);
+ DarwinModeInitInput(argc, argv);
+}
+
+
+/*
+ * DarwinAdjustScreenOrigins
+ * 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.
+ */
+void
+DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
+{
+ int i, left, top;
+
+ 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);
+ }
}
}
@@ -554,7 +592,7 @@ void InitInput( int argc, char **argv )
*/
void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
{
- int i, left, top;
+ int i;
static unsigned long generation = 0;
pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
@@ -574,55 +612,14 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
}
// Discover screens and do mode specific initialization
- if (quartz) {
- QuartzInitOutput(argc, argv);
- } else {
- XFIOKitInitOutput(argc, argv);
- }
+ DarwinModeInitOutput(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);
- }
- }
+ DarwinAdjustScreenOrigins(pScreenInfo);
}
@@ -648,13 +645,16 @@ void OsVendorInit(void)
// 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);
+ if ( !tempStr ) {
+ ErrorF("Could not find keymapping file %s.\n", darwinKeymapFile);
+ } else {
+ ErrorF("Using keymapping provided in %s.\n", tempStr);
+ }
darwinKeymapFile = tempStr;
- ErrorF("Using keymapping provided in %s.\n", darwinKeymapFile);
- } else {
- ErrorF("Reading keymapping from the kernel.\n");
+ }
+
+ if ( !darwinKeymapFile ) {
+ ErrorF("Reading keymap from the system.\n");
}
}
@@ -667,12 +667,10 @@ void OsVendorInit(void)
*/
int ddxProcessArgument( int argc, char *argv[], int i )
{
-#ifdef DARWIN_WITH_QUARTZ
int numDone;
- if ((numDone = QuartzProcessArgument( argc, argv, i )))
+ if ((numDone = DarwinModeProcessArgument( argc, argv, i )))
return numDone;
-#endif
if ( !strcmp( argv[i], "-fakebuttons" ) ) {
darwinFakeButtons = TRUE;
@@ -833,11 +831,7 @@ void ddxGiveUp( void )
{
ErrorF( "Quitting XDarwin...\n" );
- if (quartz) {
- QuartzGiveUp();
- } else {
- XFIOKitGiveUp();
- }
+ DarwinModeGiveUp();
}
diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h
index 62698d74a..79fa00ffc 100644
--- a/hw/darwin/darwin.h
+++ b/hw/darwin/darwin.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ * 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"),
@@ -23,16 +23,15 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.20 2003/11/15 00:07:09 torrey Exp $ */
#ifndef _DARWIN_H
#define _DARWIN_H
#include <IOKit/IOTypes.h>
#include "inputstr.h"
-#include "screenint.h"
+#include "scrnintstr.h"
#include "extensions/XKB.h"
-#include "quartz/quartzShared.h"
typedef struct {
void *framebuffer;
@@ -48,6 +47,9 @@ typedef struct {
} DarwinFramebufferRec, *DarwinFramebufferPtr;
+// From darwin.c
+void DarwinPrintBanner();
+void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
// From darwinEvents.c
@@ -64,6 +66,17 @@ int DarwinModifierNXKeyToNXMask(int key);
int DarwinModifierNXMaskToNXKey(int mask);
int DarwinModifierStringToNXKey(const char *string);
+// Mode specific functions
+Bool DarwinModeAddScreen(int index, ScreenPtr pScreen);
+Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen);
+void DarwinModeInitOutput(int argc,char **argv);
+void DarwinModeInitInput(int argc, char **argv);
+int DarwinModeProcessArgument(int argc, char *argv[], int i);
+void DarwinModeProcessEvent(xEvent *xe);
+void DarwinModeGiveUp(void);
+void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
+
+
#undef assert
#define assert(x) { if ((x) == 0) \
FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
@@ -76,31 +89,60 @@ int DarwinModifierStringToNXKey(const char *string);
#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;
+extern int darwinEventReadFD;
+extern int darwinEventWriteFD;
+
+// User preferences
+extern int darwinMouseAccelChange;
+extern int darwinFakeButtons;
+extern int darwinFakeMouse2Mask;
+extern int darwinFakeMouse3Mask;
+extern char *darwinKeymapFile;
+extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
+extern int darwinDesiredDepth;
+extern int darwinDesiredRefresh;
+
+// location of X11's (0,0) point in global screen coordinates
+extern int darwinMainScreenX;
+extern int darwinMainScreenY;
+
/*
* 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
+ 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
+
+ /*
+ * Quartz-specific events -- not used in IOKit mode
+ */
+ kXDarwinActivate, // restore X drawing and cursor
+ kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor
+ 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
+ /*
+ * AppleWM events
+ */
+ kXDarwinControllerNotify, // send an AppleWMControllerNotify event
+ kXDarwinPasteboardNotify, // notify the WM to copy or paste
+ /*
+ * Xplugin notification events
+ */
+ kXDarwinDisplayChanged, // display configuration has changed
+ kXDarwinWindowState, // window visibility state has changed
+ kXDarwinWindowMoved // window has moved on screen
};
#endif /* _DARWIN_H */
diff --git a/hw/darwin/darwinClut8.h b/hw/darwin/darwinClut8.h
index 06e7b71c5..68a7ad16f 100644
--- a/hw/darwin/darwinClut8.h
+++ b/hw/darwin/darwinClut8.h
@@ -1,7 +1,7 @@
/*
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.2 2003/03/04 01:37:59 torrey Exp $ */
#ifndef _DARWIN_CLUT8_
#define _DARWIN_CLUT8_
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index 72d7eff05..ba1ec8fc2 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -28,6 +28,7 @@ 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/darwin/darwinEvents.c,v 1.5 2003/11/03 05:36:30 tsi Exp $ */
#define NEED_EVENTS
#include "X.h"
@@ -42,7 +43,6 @@ in this Software without prior written authorization from The Open Group.
#include "mipointer.h"
#include "darwin.h"
-#include "quartz/quartz.h"
#include <sys/types.h>
#include <sys/uio.h>
@@ -181,6 +181,7 @@ DarwinEQEnqueue(
const xEvent *e)
{
HWEventQueueType oldtail, newtail;
+ char byte = 0;
oldtail = darwinEventQueue.tail;
@@ -209,6 +210,9 @@ DarwinEQEnqueue(
// Update the tail after the event is prepared
darwinEventQueue.tail = newtail;
+
+ // Signal there is an event ready to handle
+ write(darwinEventWriteFD, &byte, 1);
}
@@ -253,7 +257,7 @@ void ProcessInputEvents(void)
// Empty the signaling pipe
x = sizeof(xe);
while (x == sizeof(xe)) {
- x = read(darwinEventFD, &xe, sizeof(xe));
+ x = read(darwinEventReadFD, &xe, sizeof(xe));
}
while (darwinEventQueue.head != darwinEventQueue.tail)
@@ -425,11 +429,8 @@ void ProcessInputEvents(void)
}
default:
- if (quartz) {
- QuartzProcessEvent(&xe);
- } else {
- ErrorF("Unknown X event caught: %d\n", xe.u.u.type);
- }
+ // Check for mode specific event
+ DarwinModeProcessEvent(&xe);
}
}
}
diff --git a/hw/darwin/darwinKeyboard.c b/hw/darwin/darwinKeyboard.c
index 4113bacba..57bf5fa3d 100644
--- a/hw/darwin/darwinKeyboard.c
+++ b/hw/darwin/darwinKeyboard.c
@@ -2,7 +2,8 @@
//
// Keyboard support for the Darwin X Server
//
-// Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+// Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
+// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved.
//
// The code to parse the Darwin keymap is derived from dumpkeymap.c
// by Eric Sunshine, which includes the following copyright:
@@ -36,7 +37,7 @@
//
//=============================================================================
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.17 2002/12/10 00:00:38 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.19 2003/11/01 08:13:08 torrey Exp $ */
/*
===========================================================================
@@ -59,26 +60,18 @@
// in determining how the X server is interpreting the Darwin keymap.
#undef DUMP_DARWIN_KEYMAP
+/* Define this to use Alt for Mode_switch. */
+#define ALT_IS_MODE_SWITCH 1
+
#include <drivers/event_status_driver.h>
#include <IOKit/hidsystem/ev_keymap.h>
#include <stdio.h>
#include <stdlib.h>
+#include <errno.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
+#include "darwinKeyboard.h"
#define AltMask Mod1Mask
#define MetaMask Mod2Mask
@@ -224,11 +217,9 @@ 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;
+static darwinKeyboardInfo keyInfo;
+static FILE *fref = NULL;
+static char *inBuffer = NULL;
//-----------------------------------------------------------------------------
// Data Stream Object
@@ -449,34 +440,18 @@ Bool DarwinReadKeymapFile(
/*
- * DarwinKeyboardInit
- * Get the Darwin keyboard map and compute an equivalent
- * X keyboard map and modifier map. Set the new keyboard
- * device structure.
+ * DarwinParseNXKeyMapping
*/
-void DarwinKeyboardInit(
- DeviceIntPtr pDev )
+Bool DarwinParseNXKeyMapping(
+ darwinKeyboardInfo *info)
{
KeySym *k;
int i;
short numMods, numKeys, numPadKeys = 0;
- KeySymsRec keySyms;
+ Bool haveKeymap = FALSE;
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);
@@ -494,7 +469,7 @@ void DarwinKeyboardInit(
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");
+ return FALSE;
}
}
@@ -507,9 +482,7 @@ void DarwinKeyboardInit(
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.
+ // Insert X modifier KeySyms into the keyboard map.
numMods = get_number(keyMapStream);
while (numMods-- > 0) {
int left = 1; // first keycode is left
@@ -526,40 +499,33 @@ void DarwinKeyboardInit(
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;
+ info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock;
break;
case NX_MODIFIERKEY_SHIFT:
- modMap[keyCode + MIN_KEYCODE] = ShiftMask;
- map[keyCode * GLYPHS_PER_KEY] =
+ info->keyMap[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] =
+ info->keyMap[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] =
+ info->keyMap[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] =
+ info->keyMap[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] =
+ info->keyMap[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;
+ info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Help;
break;
}
}
@@ -567,12 +533,12 @@ void DarwinKeyboardInit(
}
}
- // Convert the Darwin keyboard map to an X keyboard map.
+ // Convert the Darwin keyboard mapping 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) {
+ for (i = 0, k = info->keyMap; 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);
@@ -656,7 +622,7 @@ void DarwinKeyboardInit(
keyMapStream->data = numPadStart;
while(numPadKeys-- > 0) {
const short keyCode = get_number(keyMapStream);
- k = &map[keyCode * GLYPHS_PER_KEY];
+ k = &info->keyMap[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;
@@ -671,7 +637,9 @@ void DarwinKeyboardInit(
#ifdef DUMP_DARWIN_KEYMAP
ErrorF("Darwin -> X converted keyboard map\n");
- for (i = 0, k = map; i < NX_NUMKEYCODES; i++, k += GLYPHS_PER_KEY) {
+ for (i = 0, k = info->keyMap; i < NX_NUMKEYCODES;
+ i++, k += GLYPHS_PER_KEY)
+ {
int j;
ErrorF("0x%02x:", i);
for (j = 0; j < GLYPHS_PER_KEY; j++) {
@@ -685,18 +653,145 @@ void DarwinKeyboardInit(
}
#endif
- keySyms.map = map;
+ return TRUE;
+}
+
+
+/*
+ * DarwinBuildModifierMaps
+ * Use the keyMap field of keyboard info structure to populate
+ * the modMap and modifierKeycodes fields.
+ */
+static void
+DarwinBuildModifierMaps(
+ darwinKeyboardInfo *info)
+{
+ int i;
+ KeySym *k;
+ int darwinSwapAltMeta = 0;
+
+ memset(info->modMap, NoSymbol, sizeof(info->modMap));
+ memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes));
+
+ for (i = 0; i < NUM_KEYCODES; i++)
+ {
+ k = info->keyMap + i * GLYPHS_PER_KEY;
+
+ switch (k[0]) {
+ case XK_Shift_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i;
+ info->modMap[MIN_KEYCODE + i] = ShiftMask;
+ break;
+
+ case XK_Shift_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][1] = i;
+ info->modMap[MIN_KEYCODE + i] = ShiftMask;
+ break;
+
+ case XK_Control_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i;
+ info->modMap[MIN_KEYCODE + i] = ControlMask;
+ break;
+
+ case XK_Control_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][1] = i;
+ info->modMap[MIN_KEYCODE + i] = ControlMask;
+ break;
+
+ case XK_Caps_Lock:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i;
+ info->modMap[MIN_KEYCODE + i] = LockMask;
+ break;
+
+ case XK_Alt_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Alt_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][1] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Mode_switch:
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Meta_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod2Mask;
+ break;
+
+ case XK_Meta_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][1] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod2Mask;
+ break;
+
+ case XK_Num_Lock:
+ info->modMap[MIN_KEYCODE + i] = Mod3Mask;
+ break;
+ }
+
+ if (darwinSwapAltMeta)
+ {
+ switch (k[0])
+ {
+ case XK_Alt_L:
+ k[0] = XK_Meta_L;
+ break;
+ case XK_Alt_R:
+ k[0] = XK_Meta_R;
+ break;
+ case XK_Meta_L:
+ k[0] = XK_Alt_L;
+ break;
+ case XK_Meta_R:
+ k[0] = XK_Alt_R;
+ break;
+ }
+ }
+
+#if ALT_IS_MODE_SWITCH
+ if (k[0] == XK_Alt_L || k[0] == XK_Alt_R)
+ k[0] = XK_Mode_switch;
+#endif
+ }
+}
+
+
+/*
+ * 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 )
+{
+ KeySymsRec keySyms;
+
+ memset( keyInfo.keyMap, 0, sizeof( keyInfo.keyMap ) );
+
+ // 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 (!DarwinParseNXKeyMapping(&keyInfo)) {
+ if (!DarwinModeReadSystemKeymap(&keyInfo)) {
+ FatalError("Could not build a valid keymap.");
+ }
+ }
+
+ DarwinBuildModifierMaps(&keyInfo);
+
+ keySyms.map = keyInfo.keyMap;
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,
+ assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
+ keyInfo.modMap, DarwinModeBell,
DarwinChangeKeyboardControl ));
}
@@ -718,7 +813,7 @@ void DarwinKeyboardInit(
*/
int DarwinModifierNXKeyToNXKeycode(int key, int side)
{
- return modifierKeycodes[key][side];
+ return keyInfo.modifierKeycodes[key][side];
}
/*
@@ -734,7 +829,7 @@ int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
// 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 (keyInfo.modifierKeycodes[key][side] == keycode) break;
}
}
if (key == NX_NUMMODIFIERS) return -1;
diff --git a/hw/darwin/darwinKeyboard.h b/hw/darwin/darwinKeyboard.h
new file mode 100644
index 000000000..c71888990
--- /dev/null
+++ b/hw/darwin/darwinKeyboard.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 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/darwinKeyboard.h,v 1.1 2003/11/01 08:13:08 torrey Exp $ */
+
+#ifndef DARWIN_KEYBOARD_H
+#define DARWIN_KEYBOARD_H 1
+
+#define XK_TECHNICAL // needed to get XK_Escape
+#define XK_PUBLISHING
+#include "keysym.h"
+#include "inputstr.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
+
+typedef struct darwinKeyboardInfo_struct {
+ CARD8 modMap[MAP_LENGTH];
+ KeySym keyMap[MAP_LENGTH * GLYPHS_PER_KEY];
+ unsigned char modifierKeycodes[32][2];
+} darwinKeyboardInfo;
+
+Bool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info);
+
+#endif /* DARWIN_KEYBOARD_H */
diff --git a/hw/darwin/iokit/xfIOKit.c b/hw/darwin/iokit/xfIOKit.c
new file mode 100644
index 000000000..6b4bd75c2
--- /dev/null
+++ b/hw/darwin/iokit/xfIOKit.c
@@ -0,0 +1,770 @@
+/**************************************************************
+ *
+ * IOKit support for the Darwin X Server
+ *
+ * HISTORY:
+ * Original port to Mac OS X Server by John Carmack
+ * Port to Darwin 1.0 by Dave Zarzycki
+ * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons
+ *
+ **************************************************************/
+/*
+ * 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/iokit/xfIOKit.c,v 1.2 2003/10/16 23:50:09 torrey Exp $ */
+
+#include "X.h"
+#include "Xproto.h"
+#include "os.h"
+#include "servermd.h"
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "mi.h"
+#include "mibstore.h"
+#include "mipointer.h"
+#include "micmap.h"
+#include "shadow.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <pthread.h>
+
+#include <mach/mach_interface.h>
+
+#define NO_CFPLUGIN
+#include <IOKit/IOKitLib.h>
+#include <IOKit/hidsystem/IOHIDShared.h>
+#include <IOKit/graphics/IOGraphicsLib.h>
+#include <drivers/event_status_driver.h>
+
+// Define this to work around bugs in the display drivers for
+// older PowerBook G3's. If the X server starts without this
+// #define, you don't need it.
+#undef OLD_POWERBOOK_G3
+
+#include "darwin.h"
+#include "xfIOKit.h"
+
+// Globals
+int xfIOKitScreenIndex = 0;
+io_connect_t xfIOKitInputConnect = 0;
+
+static pthread_t inputThread;
+static EvGlobals * evg;
+static mach_port_t masterPort;
+static mach_port_t notificationPort;
+static IONotificationPortRef NotificationPortRef;
+static mach_port_t pmNotificationPort;
+static io_iterator_t fbIter;
+
+
+/*
+ * XFIOKitStoreColors
+ * This is a callback from X to change the hardware colormap
+ * when using PsuedoColor.
+ */
+static void XFIOKitStoreColors(
+ ColormapPtr pmap,
+ int numEntries,
+ xColorItem *pdefs)
+{
+ kern_return_t kr;
+ int i;
+ IOColorEntry *newColors;
+ ScreenPtr pScreen = pmap->pScreen;
+ XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
+
+ assert( newColors = (IOColorEntry *)
+ xalloc( numEntries*sizeof(IOColorEntry) ));
+
+ // Convert xColorItem values to IOColorEntry
+ // assume the colormap is PsuedoColor
+ // as we do not support DirectColor
+ for (i = 0; i < numEntries; i++) {
+ newColors[i].index = pdefs[i].pixel;
+ newColors[i].red = pdefs[i].red;
+ newColors[i].green = pdefs[i].green;
+ newColors[i].blue = pdefs[i].blue;
+ }
+
+ kr = IOFBSetCLUT( iokitScreen->fbService, 0, numEntries,
+ kSetCLUTByValue, newColors );
+ kern_assert( kr );
+
+ xfree( newColors );
+}
+
+
+/*
+ * DarwinModeBell
+ * FIXME
+ */
+void DarwinModeBell(
+ int loud,
+ DeviceIntPtr pDevice,
+ pointer ctrl,
+ int fbclass)
+{
+}
+
+
+/*
+ * DarwinModeGiveUp
+ * Closes the connections to IOKit services
+ */
+void DarwinModeGiveUp( void )
+{
+ int i;
+
+ // we must close the HID System first
+ // because it is a client of the framebuffer
+ NXCloseEventStatus( darwinParamConnect );
+ IOServiceClose( xfIOKitInputConnect );
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ XFIOKitScreenPtr iokitScreen =
+ XFIOKIT_SCREEN_PRIV(screenInfo.screens[i]);
+ IOServiceClose( iokitScreen->fbService );
+ }
+}
+
+
+/*
+ * ClearEvent
+ * Clear an event from the HID System event queue
+ */
+static void ClearEvent(NXEvent * ep)
+{
+ static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 };
+
+ *ep = nullEvent;
+ ep->data.compound.subType = ep->data.compound.misc.L[0] =
+ ep->data.compound.misc.L[1] = 0;
+}
+
+
+/*
+ * XFIOKitHIDThread
+ * Read the HID System event queue, translate it to an X event,
+ * and queue it for processing.
+ */
+static void *XFIOKitHIDThread(void *unused)
+{
+ for (;;) {
+ NXEQElement *oldHead;
+ mach_msg_return_t kr;
+ mach_msg_empty_rcv_t msg;
+
+ kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
+ sizeof(msg), notificationPort, 0, MACH_PORT_NULL);
+ kern_assert(kr);
+
+ while (evg->LLEHead != evg->LLETail) {
+ NXEvent ev;
+ xEvent xe;
+
+ // Extract the next event from the kernel queue
+ oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead];
+ ev_lock(&oldHead->sema);
+ ev = oldHead->event;
+ ClearEvent(&oldHead->event);
+ evg->LLEHead = oldHead->next;
+ ev_unlock(&oldHead->sema);
+
+ memset(&xe, 0, sizeof(xe));
+
+ // These fields should be filled in for every event
+ xe.u.keyButtonPointer.rootX = ev.location.x;
+ xe.u.keyButtonPointer.rootY = ev.location.y;
+ xe.u.keyButtonPointer.time = GetTimeInMillis();
+
+ switch( ev.type ) {
+ case NX_MOUSEMOVED:
+ xe.u.u.type = MotionNotify;
+ break;
+
+ case NX_LMOUSEDOWN:
+ xe.u.u.type = ButtonPress;
+ xe.u.u.detail = 1;
+ break;
+
+ case NX_LMOUSEUP:
+ xe.u.u.type = ButtonRelease;
+ xe.u.u.detail = 1;
+ break;
+
+ // A newer kernel generates multi-button events with
+ // NX_SYSDEFINED. Button 2 isn't handled correctly by
+ // older kernels anyway. Just let NX_SYSDEFINED events
+ // handle these.
+#if 0
+ case NX_RMOUSEDOWN:
+ xe.u.u.type = ButtonPress;
+ xe.u.u.detail = 2;
+ break;
+
+ case NX_RMOUSEUP:
+ xe.u.u.type = ButtonRelease;
+ xe.u.u.detail = 2;
+ break;
+#endif
+
+ case NX_KEYDOWN:
+ xe.u.u.type = KeyPress;
+ xe.u.u.detail = ev.data.key.keyCode;
+ break;
+
+ case NX_KEYUP:
+ xe.u.u.type = KeyRelease;
+ xe.u.u.detail = ev.data.key.keyCode;
+ break;
+
+ case NX_FLAGSCHANGED:
+ xe.u.u.type = kXDarwinUpdateModifiers;
+ xe.u.clientMessage.u.l.longs0 = ev.flags;
+ break;
+
+ case NX_SYSDEFINED:
+ if (ev.data.compound.subType == 7) {
+ xe.u.u.type = kXDarwinUpdateButtons;
+ xe.u.clientMessage.u.l.longs0 =
+ ev.data.compound.misc.L[0];
+ xe.u.clientMessage.u.l.longs1 =
+ ev.data.compound.misc.L[1];
+ } else {
+ continue;
+ }
+ break;
+
+ case NX_SCROLLWHEELMOVED:
+ xe.u.u.type = kXDarwinScrollWheel;
+ xe.u.clientMessage.u.s.shorts0 =
+ ev.data.scrollWheel.deltaAxis1;
+ break;
+
+ default:
+ continue;
+ }
+
+ DarwinEQEnqueue(&xe);
+ }
+ }
+
+ return NULL;
+}
+
+
+/*
+ * XFIOKitPMThread
+ * Handle power state notifications
+ */
+static void *XFIOKitPMThread(void *arg)
+{
+ ScreenPtr pScreen = (ScreenPtr)arg;
+ XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
+
+ for (;;) {
+ mach_msg_return_t kr;
+ mach_msg_empty_rcv_t msg;
+
+ kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0,
+ sizeof(msg), pmNotificationPort, 0, MACH_PORT_NULL);
+ kern_assert(kr);
+
+ // display is powering down
+ if (msg.header.msgh_id == 0) {
+ IOFBAcknowledgePM( iokitScreen->fbService );
+ xf86SetRootClip(pScreen, FALSE);
+ }
+ // display just woke up
+ else if (msg.header.msgh_id == 1) {
+ xf86SetRootClip(pScreen, TRUE);
+ }
+ }
+ return NULL;
+}
+
+
+/*
+ * SetupFBandHID
+ * Setup an IOFramebuffer service and connect the HID system to it.
+ */
+static Bool SetupFBandHID(
+ int index,
+ DarwinFramebufferPtr dfb,
+ XFIOKitScreenPtr iokitScreen)
+{
+ kern_return_t kr;
+ io_service_t service;
+ io_connect_t fbService;
+ vm_address_t vram;
+ vm_size_t shmemSize;
+ int i;
+ UInt32 numModes;
+ IODisplayModeInformation modeInfo;
+ IODisplayModeID displayMode, *allModes;
+ IOIndex displayDepth;
+ IOFramebufferInformation fbInfo;
+ IOPixelInformation pixelInfo;
+ StdFBShmem_t *cshmem;
+
+ // find and open the IOFrameBuffer service
+ service = IOIteratorNext(fbIter);
+ if (service == 0)
+ return FALSE;
+
+ kr = IOServiceOpen( service, mach_task_self(),
+ kIOFBServerConnectType, &iokitScreen->fbService );
+ IOObjectRelease( service );
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Failed to connect as window server to screen %i.\n", index);
+ return FALSE;
+ }
+ fbService = iokitScreen->fbService;
+
+ // create the slice of shared memory containing cursor state data
+ kr = IOFBCreateSharedCursor( fbService,
+ kIOFBCurrentShmemVersion,
+ 32, 32 );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+
+ // Register for power management events for the framebuffer's device
+ kr = IOCreateReceivePort(kOSNotificationMessageID, &pmNotificationPort);
+ kern_assert(kr);
+ kr = IOConnectSetNotificationPort( fbService, 0,
+ pmNotificationPort, 0 );
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Power management registration failed.\n");
+ }
+
+ // SET THE SCREEN PARAMETERS
+ // get the current screen resolution, refresh rate and depth
+ kr = IOFBGetCurrentDisplayModeAndDepth( fbService,
+ &displayMode,
+ &displayDepth );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+
+ // use the current screen resolution if the user
+ // only wants to change the refresh rate
+ if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) {
+ kr = IOFBGetDisplayModeInformation( fbService,
+ displayMode,
+ &modeInfo );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+ darwinDesiredWidth = modeInfo.nominalWidth;
+ darwinDesiredHeight = modeInfo.nominalHeight;
+ }
+
+ // use the current resolution and refresh rate
+ // if the user doesn't have a preference
+ if (darwinDesiredWidth == 0) {
+
+ // change the pixel depth if desired
+ if (darwinDesiredDepth != -1) {
+ kr = IOFBGetDisplayModeInformation( fbService,
+ displayMode,
+ &modeInfo );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+ if (modeInfo.maxDepthIndex < darwinDesiredDepth) {
+ ErrorF("Discarding screen %i:\n", index);
+ ErrorF("Current screen resolution does not support desired pixel depth.\n");
+ return FALSE;
+ }
+
+ displayDepth = darwinDesiredDepth;
+ kr = IOFBSetDisplayModeAndDepth( fbService, displayMode,
+ displayDepth );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+ }
+
+ // look for display mode with correct resolution and refresh rate
+ } else {
+
+ // get an array of all supported display modes
+ kr = IOFBGetDisplayModeCount( fbService, &numModes );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+ assert(allModes = (IODisplayModeID *)
+ xalloc( numModes * sizeof(IODisplayModeID) ));
+ kr = IOFBGetDisplayModes( fbService, numModes, allModes );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+
+ for (i = 0; i < numModes; i++) {
+ kr = IOFBGetDisplayModeInformation( fbService, allModes[i],
+ &modeInfo );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+
+ if (modeInfo.flags & kDisplayModeValidFlag &&
+ modeInfo.nominalWidth == darwinDesiredWidth &&
+ modeInfo.nominalHeight == darwinDesiredHeight) {
+
+ if (darwinDesiredDepth == -1)
+ darwinDesiredDepth = modeInfo.maxDepthIndex;
+ if (modeInfo.maxDepthIndex < darwinDesiredDepth) {
+ ErrorF("Discarding screen %i:\n", index);
+ ErrorF("Desired screen resolution does not support desired pixel depth.\n");
+ return FALSE;
+ }
+
+ if ((darwinDesiredRefresh == -1 ||
+ (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) {
+ displayMode = allModes[i];
+ displayDepth = darwinDesiredDepth;
+ kr = IOFBSetDisplayModeAndDepth(fbService,
+ displayMode,
+ displayDepth);
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+ break;
+ }
+ }
+ }
+
+ xfree( allModes );
+ if (i >= numModes) {
+ ErrorF("Discarding screen %i:\n", index);
+ ErrorF("Desired screen resolution or refresh rate is not supported.\n");
+ return FALSE;
+ }
+ }
+
+ kr = IOFBGetPixelInformation( fbService, displayMode, displayDepth,
+ kIOFBSystemAperture, &pixelInfo );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+
+#ifdef __i386__
+ /* x86 in 8bit mode currently needs fixed color map... */
+ if( pixelInfo.bitsPerComponent == 8 ) {
+ pixelInfo.pixelType = kIOFixedCLUTPixels;
+ }
+#endif
+
+#ifdef OLD_POWERBOOK_G3
+ if (pixelInfo.pixelType == kIOCLUTPixels)
+ pixelInfo.pixelType = kIOFixedCLUTPixels;
+#endif
+
+ kr = IOFBGetFramebufferInformationForAperture( fbService,
+ kIOFBSystemAperture,
+ &fbInfo );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+
+ // FIXME: 1x1 IOFramebuffers are sometimes used to indicate video
+ // outputs without a monitor connected to them. Since IOKit Xinerama
+ // does not really work, this often causes problems on PowerBooks.
+ // For now we explicitly check and ignore these screens.
+ if (fbInfo.activeWidth <= 1 || fbInfo.activeHeight <= 1) {
+ ErrorF("Discarding screen %i:\n", index);
+ ErrorF("Invalid width or height.\n");
+ return FALSE;
+ }
+
+ kr = IOConnectMapMemory( fbService, kIOFBCursorMemory,
+ mach_task_self(), (vm_address_t *) &cshmem,
+ &shmemSize, kIOMapAnywhere );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+ iokitScreen->cursorShmem = cshmem;
+
+ kr = IOConnectMapMemory( fbService, kIOFBSystemAperture,
+ mach_task_self(), &vram, &shmemSize,
+ kIOMapAnywhere );
+ if (kr != KERN_SUCCESS)
+ return FALSE;
+
+ iokitScreen->framebuffer = (void*)vram;
+ dfb->x = cshmem->screenBounds.minx;
+ dfb->y = cshmem->screenBounds.miny;
+ dfb->width = fbInfo.activeWidth;
+ dfb->height = fbInfo.activeHeight;
+ dfb->pitch = fbInfo.bytesPerRow;
+ dfb->bitsPerPixel = fbInfo.bitsPerPixel;
+ dfb->colorBitsPerPixel = pixelInfo.componentCount *
+ pixelInfo.bitsPerComponent;
+ dfb->bitsPerComponent = pixelInfo.bitsPerComponent;
+
+ // allocate shadow framebuffer
+ iokitScreen->shadowPtr = shadowAlloc(dfb->width, dfb->height,
+ dfb->bitsPerPixel);
+ dfb->framebuffer = iokitScreen->shadowPtr;
+
+ // Note: Darwin kIORGBDirectPixels = X TrueColor, not DirectColor
+ if (pixelInfo.pixelType == kIORGBDirectPixels) {
+ dfb->colorType = TrueColor;
+ } else if (pixelInfo.pixelType == kIOCLUTPixels) {
+ dfb->colorType = PseudoColor;
+ } else if (pixelInfo.pixelType == kIOFixedCLUTPixels) {
+ dfb->colorType = StaticColor;
+ }
+
+ // Inform the HID system that the framebuffer is also connected to it.
+ kr = IOConnectAddClient( xfIOKitInputConnect, fbService );
+ kern_assert( kr );
+
+ // We have to have added at least one screen
+ // before we can enable the cursor.
+ kr = IOHIDSetCursorEnable(xfIOKitInputConnect, TRUE);
+ kern_assert( kr );
+
+ return TRUE;
+}
+
+
+/*
+ * DarwinModeAddScreen
+ * IOKit specific initialization for each screen.
+ */
+Bool DarwinModeAddScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ XFIOKitScreenPtr iokitScreen;
+
+ // allocate space for private per screen storage
+ iokitScreen = xalloc(sizeof(XFIOKitScreenRec));
+ XFIOKIT_SCREEN_PRIV(pScreen) = iokitScreen;
+
+ // setup hardware framebuffer
+ iokitScreen->fbService = 0;
+ if (! SetupFBandHID(index, dfb, iokitScreen)) {
+ if (iokitScreen->fbService) {
+ IOServiceClose(iokitScreen->fbService);
+ }
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * XFIOKitShadowUpdate
+ * Update the damaged regions of the shadow framebuffer on the screen.
+ */
+static void XFIOKitShadowUpdate(ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
+ RegionPtr damage = &pBuf->damage;
+ int numBox = REGION_NUM_RECTS(damage);
+ BoxPtr pBox = REGION_RECTS(damage);
+ int pitch = dfb->pitch;
+ int bpp = dfb->bitsPerPixel/8;
+
+ // Loop through all the damaged boxes
+ while (numBox--) {
+ int width, height, offset;
+ unsigned char *src, *dst;
+
+ width = (pBox->x2 - pBox->x1) * bpp;
+ height = pBox->y2 - pBox->y1;
+ offset = (pBox->y1 * pitch) + (pBox->x1 * bpp);
+ src = iokitScreen->shadowPtr + offset;
+ dst = iokitScreen->framebuffer + offset;
+
+ while (height--) {
+ memcpy(dst, src, width);
+ dst += pitch;
+ src += pitch;
+ }
+
+ // Get the next box
+ pBox++;
+ }
+}
+
+
+/*
+ * DarwinModeSetupScreen
+ * Finalize IOKit specific initialization of each screen.
+ */
+Bool DarwinModeSetupScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ pthread_t pmThread;
+
+ // initalize cursor support
+ if (! XFIOKitInitCursor(pScreen)) {
+ return FALSE;
+ }
+
+ // initialize shadow framebuffer support
+ if (! shadowInit(pScreen, XFIOKitShadowUpdate, NULL)) {
+ ErrorF("Failed to initalize shadow framebuffer for screen %i.\n",
+ index);
+ return FALSE;
+ }
+
+ // initialize colormap handling as needed
+ if (dfb->colorType == PseudoColor) {
+ pScreen->StoreColors = XFIOKitStoreColors;
+ }
+
+ // initialize power manager handling
+ pthread_create( &pmThread, NULL, XFIOKitPMThread,
+ (void *) pScreen );
+
+ return TRUE;
+}
+
+
+/*
+ * DarwinModeInitOutput
+ * One-time initialization of IOKit output support.
+ */
+void DarwinModeInitOutput(
+ int argc,
+ char **argv)
+{
+ static unsigned long generation = 0;
+ kern_return_t kr;
+ io_iterator_t iter;
+ io_service_t service;
+ vm_address_t shmem;
+ vm_size_t shmemSize;
+
+ ErrorF("Display mode: IOKit\n");
+
+ // Allocate private storage for each screen's IOKit specific info
+ if (generation != serverGeneration) {
+ xfIOKitScreenIndex = AllocateScreenPrivateIndex();
+ generation = serverGeneration;
+ }
+
+ kr = IOMasterPort(bootstrap_port, &masterPort);
+ kern_assert( kr );
+
+ // Find and open the HID System Service
+ // Do this now to be sure the Mac OS X window server is not running.
+ kr = IOServiceGetMatchingServices( masterPort,
+ IOServiceMatching( kIOHIDSystemClass ),
+ &iter );
+ kern_assert( kr );
+
+ assert( service = IOIteratorNext( iter ) );
+
+ kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType,
+ &xfIOKitInputConnect );
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Failed to connect to the HID System as the window server!\n");
+#ifdef DARWIN_WITH_QUARTZ
+ FatalError("Quit the Mac OS X window server or use the -quartz option.\n");
+#else
+ FatalError("Make sure you have quit the Mac OS X window server.\n");
+#endif
+ }
+
+ IOObjectRelease( service );
+ IOObjectRelease( iter );
+
+ // Setup the event queue in memory shared by the kernel and X server
+ kr = IOHIDCreateSharedMemory( xfIOKitInputConnect,
+ kIOHIDCurrentShmemVersion );
+ kern_assert( kr );
+
+ kr = IOConnectMapMemory( xfIOKitInputConnect, kIOHIDGlobalMemory,
+ mach_task_self(), &shmem, &shmemSize,
+ kIOMapAnywhere );
+ kern_assert( kr );
+
+ evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset);
+
+ assert(sizeof(EvGlobals) == evg->structSize);
+
+ NotificationPortRef = IONotificationPortCreate( masterPort );
+
+ notificationPort = IONotificationPortGetMachPort(NotificationPortRef);
+
+ kr = IOConnectSetNotificationPort( xfIOKitInputConnect,
+ kIOHIDEventNotification,
+ notificationPort, 0 );
+ kern_assert( kr );
+
+ evg->movedMask |= NX_MOUSEMOVEDMASK;
+
+ // find number of framebuffers
+ kr = IOServiceGetMatchingServices( masterPort,
+ IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ),
+ &fbIter );
+ kern_assert( kr );
+
+ darwinScreensFound = 0;
+ while ((service = IOIteratorNext(fbIter))) {
+ IOObjectRelease( service );
+ darwinScreensFound++;
+ }
+ IOIteratorReset(fbIter);
+}
+
+
+/*
+ * DarwinModeInitInput
+ * One-time initialization of IOKit input support.
+ */
+void DarwinModeInitInput(
+ int argc,
+ char **argv)
+{
+ kern_return_t kr;
+ int fd[2];
+
+ kr = IOHIDSetEventsEnable(xfIOKitInputConnect, TRUE);
+ kern_assert( kr );
+
+ // Start event passing thread
+ assert( pipe(fd) == 0 );
+ darwinEventReadFD = fd[0];
+ darwinEventWriteFD = fd[1];
+ fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK);
+ pthread_create(&inputThread, NULL,
+ XFIOKitHIDThread, NULL);
+
+}
+
+
+/*
+ * DarwinModeProcessEvent
+ * Process IOKit specific events.
+ */
+void DarwinModeProcessEvent(
+ xEvent *xe)
+{
+ // No mode specific events
+ ErrorF("Unknown X event caught: %d\n", xe->u.u.type);
+}
diff --git a/hw/darwin/iokit/xfIOKit.h b/hw/darwin/iokit/xfIOKit.h
new file mode 100644
index 000000000..413dfd7e8
--- /dev/null
+++ b/hw/darwin/iokit/xfIOKit.h
@@ -0,0 +1,57 @@
+/*
+ xfIOKit.h
+
+ IOKit specific functions and definitions
+*/
+/*
+ * 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/iokit/xfIOKit.h,v 1.1 2003/05/14 05:27:56 torrey Exp $ */
+
+#ifndef _XFIOKIT_H
+#define _XFIOKIT_H
+
+#include <pthread.h>
+#include <IOKit/graphics/IOFramebufferShared.h>
+#include "X11/Xproto.h"
+#include "screenint.h"
+#include "darwin.h"
+
+typedef struct {
+ io_connect_t fbService;
+ StdFBShmem_t *cursorShmem;
+ unsigned char *framebuffer;
+ unsigned char *shadowPtr;
+} XFIOKitScreenRec, *XFIOKitScreenPtr;
+
+#define XFIOKIT_SCREEN_PRIV(pScreen) \
+ ((XFIOKitScreenPtr)pScreen->devPrivates[xfIOKitScreenIndex].ptr)
+
+extern int xfIOKitScreenIndex; // index into pScreen.devPrivates
+extern io_connect_t xfIOKitInputConnect;
+
+Bool XFIOKitInitCursor(ScreenPtr pScreen);
+
+#endif /* _XFIOKIT_H */
diff --git a/hw/darwin/iokit/xfIOKitCursor.c b/hw/darwin/iokit/xfIOKitCursor.c
new file mode 100644
index 000000000..f3c80145f
--- /dev/null
+++ b/hw/darwin/iokit/xfIOKitCursor.c
@@ -0,0 +1,735 @@
+/**************************************************************
+ *
+ * Cursor support for Darwin X Server
+ *
+ * Three different cursor modes are possible:
+ * X (0) - tracking via Darwin kernel,
+ * display via X machine independent
+ * Kernel (1) - tracking and display via Darwin kernel
+ * (not currently supported)
+ * Hardware (2) - tracking and display via hardware
+ *
+ * The X software cursor uses the Darwin software cursor
+ * routines in IOFramebuffer.cpp to track the cursor, but
+ * displays the cursor image using the X machine
+ * independent display cursor routines in midispcur.c.
+ *
+ * The kernel cursor uses IOFramebuffer.cpp routines to
+ * track and display the cursor. This gives better
+ * performance as the display calls don't have to cross
+ * the kernel boundary. Unfortunately, this mode has
+ * synchronization issues with the user land X server
+ * and isn't currently used.
+ *
+ * Hardware cursor support lets the hardware handle these
+ * details.
+ *
+ * Kernel and hardware cursor mode only work for cursors
+ * up to a certain size, currently 16x16 pixels. If a
+ * bigger cursor is set, we fallback to X cursor mode.
+ *
+ * HISTORY:
+ * 1.0 by Torrey T. Lyons, October 30, 2000
+ *
+ **************************************************************/
+/*
+ * 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/iokit/xfIOKitCursor.c,v 1.1 2003/05/14 05:27:56 torrey Exp $ */
+
+#include "scrnintstr.h"
+#include "cursorstr.h"
+#include "mipointrst.h"
+#include "micmap.h"
+#define NO_CFPLUGIN
+#include <IOKit/graphics/IOGraphicsLib.h>
+#include <IOKit/hidsystem/IOHIDLib.h>
+#include "darwin.h"
+#include "xfIOKit.h"
+
+#define DUMP_DARWIN_CURSOR FALSE
+
+#define CURSOR_PRIV(pScreen) \
+ ((XFIOKitCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
+
+// The cursors format are documented in IOFramebufferShared.h.
+#define RGBto34WithGamma(red, green, blue) \
+ ( 0x000F \
+ | (((red) & 0xF) << 12) \
+ | (((green) & 0xF) << 8) \
+ | (((blue) & 0xF) << 4) )
+#define RGBto38WithGamma(red, green, blue) \
+ ( 0xFF << 24 \
+ | (((red) & 0xFF) << 16) \
+ | (((green) & 0xFF) << 8) \
+ | (((blue) & 0xFF)) )
+#define HighBitOf32 0x80000000
+
+typedef struct {
+ Bool canHWCursor;
+ short cursorMode;
+ RecolorCursorProcPtr RecolorCursor;
+ InstallColormapProcPtr InstallColormap;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+ ColormapPtr pInstalledMap;
+} XFIOKitCursorScreenRec, *XFIOKitCursorScreenPtr;
+
+static int darwinCursorScreenIndex = -1;
+static unsigned long darwinCursorGeneration = 0;
+
+/*
+===========================================================================
+
+ Pointer sprite functions
+
+===========================================================================
+*/
+
+/*
+ Realizing the Darwin hardware cursor (ie. converting from the
+ X representation to the IOKit representation) is complicated
+ by the fact that we have three different potential cursor
+ formats to go to, one for each bit depth (8, 15, or 24).
+ The IOKit formats are documented in IOFramebufferShared.h.
+ X cursors are represented as 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. The bitmaps are given in
+ 32-bit format with least significant byte and bit first.
+ (This is opposite PowerPC Darwin.)
+*/
+
+typedef struct {
+ unsigned char image[CURSORWIDTH*CURSORHEIGHT];
+ unsigned char mask[CURSORWIDTH*CURSORHEIGHT];
+} cursorPrivRec, *cursorPrivPtr;
+
+/*
+ * XFIOKitRealizeCursor8
+ * Convert the X cursor representation to an 8-bit depth
+ * format for Darwin. This function assumes the maximum cursor
+ * width is a multiple of 8.
+ */
+static Bool
+XFIOKitRealizeCursor8(
+ ScreenPtr pScreen,
+ CursorPtr pCursor)
+{
+ cursorPrivPtr newCursor;
+ unsigned char *newSourceP, *newMaskP;
+ CARD32 *oldSourceP, *oldMaskP;
+ xColorItem fgColor, bgColor;
+ int index, x, y, rowPad;
+ int cursorWidth, cursorHeight;
+ ColormapPtr pmap;
+
+ // check cursor size just to be sure
+ cursorWidth = pCursor->bits->width;
+ cursorHeight = pCursor->bits->height;
+ if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
+ return FALSE;
+
+ // get cursor colors in colormap
+ index = pScreen->myNum;
+ pmap = miInstalledMaps[index];
+ if (!pmap) return FALSE;
+
+ fgColor.red = pCursor->foreRed;
+ fgColor.green = pCursor->foreGreen;
+ fgColor.blue = pCursor->foreBlue;
+ FakeAllocColor(pmap, &fgColor);
+ bgColor.red = pCursor->backRed;
+ bgColor.green = pCursor->backGreen;
+ bgColor.blue = pCursor->backBlue;
+ FakeAllocColor(pmap, &bgColor);
+ FakeFreeColor(pmap, fgColor.pixel);
+ FakeFreeColor(pmap, bgColor.pixel);
+
+ // allocate memory for new cursor image
+ newCursor = xalloc( sizeof(cursorPrivRec) );
+ if (!newCursor)
+ return FALSE;
+ memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT );
+ memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT );
+
+ // convert to 8-bit Darwin cursor format
+ oldSourceP = (CARD32 *) pCursor->bits->source;
+ oldMaskP = (CARD32 *) pCursor->bits->mask;
+ newSourceP = newCursor->image;
+ newMaskP = newCursor->mask;
+ rowPad = CURSORWIDTH - cursorWidth;
+
+ for (y = 0; y < cursorHeight; y++) {
+ for (x = 0; x < cursorWidth; x++) {
+ if (*oldSourceP & (HighBitOf32 >> x))
+ *newSourceP = fgColor.pixel;
+ else
+ *newSourceP = bgColor.pixel;
+ if (*oldMaskP & (HighBitOf32 >> x))
+ *newMaskP = 255;
+ else
+ *newSourceP = pScreen->blackPixel;
+ newSourceP++; newMaskP++;
+ }
+ oldSourceP++; oldMaskP++;
+ newSourceP += rowPad; newMaskP += rowPad;
+ }
+
+ // save the result
+ pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
+ return TRUE;
+}
+
+
+/*
+ * XFIOKitRealizeCursor15
+ * Convert the X cursor representation to an 15-bit depth
+ * format for Darwin.
+ */
+static Bool
+XFIOKitRealizeCursor15(
+ ScreenPtr pScreen,
+ CursorPtr pCursor)
+{
+ unsigned short *newCursor;
+ unsigned short fgPixel, bgPixel;
+ unsigned short *newSourceP;
+ CARD32 *oldSourceP, *oldMaskP;
+ int x, y, rowPad;
+ int cursorWidth, cursorHeight;
+
+ // check cursor size just to be sure
+ cursorWidth = pCursor->bits->width;
+ cursorHeight = pCursor->bits->height;
+ if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
+ return FALSE;
+
+ // allocate memory for new cursor image
+ newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
+ if (!newCursor)
+ return FALSE;
+ memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) );
+
+ // calculate pixel values
+ fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen,
+ pCursor->foreBlue );
+ bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen,
+ pCursor->backBlue );
+
+ // convert to 15-bit Darwin cursor format
+ oldSourceP = (CARD32 *) pCursor->bits->source;
+ oldMaskP = (CARD32 *) pCursor->bits->mask;
+ newSourceP = newCursor;
+ rowPad = CURSORWIDTH - cursorWidth;
+
+ for (y = 0; y < cursorHeight; y++) {
+ for (x = 0; x < cursorWidth; x++) {
+ if (*oldMaskP & (HighBitOf32 >> x)) {
+ if (*oldSourceP & (HighBitOf32 >> x))
+ *newSourceP = fgPixel;
+ else
+ *newSourceP = bgPixel;
+ } else {
+ *newSourceP = 0;
+ }
+ newSourceP++;
+ }
+ oldSourceP++; oldMaskP++;
+ newSourceP += rowPad;
+ }
+
+#if DUMP_DARWIN_CURSOR
+ // Write out the cursor
+ ErrorF("Cursor: 0x%x\n", pCursor);
+ ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
+ cursorHeight, rowPad);
+ for (y = 0; y < cursorHeight; y++) {
+ newSourceP = newCursor + y*CURSORWIDTH;
+ for (x = 0; x < cursorWidth; x++) {
+ if (*newSourceP == fgPixel)
+ ErrorF("x");
+ else if (*newSourceP == bgPixel)
+ ErrorF("o");
+ else
+ ErrorF(" ");
+ newSourceP++;
+ }
+ ErrorF("\n");
+ }
+#endif
+
+ // save the result
+ pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
+ return TRUE;
+}
+
+
+/*
+ * XFIOKitRealizeCursor24
+ * Convert the X cursor representation to an 24-bit depth
+ * format for Darwin. This function assumes the maximum cursor
+ * width is a multiple of 8.
+ */
+static Bool
+XFIOKitRealizeCursor24(
+ ScreenPtr pScreen,
+ CursorPtr pCursor)
+{
+ unsigned int *newCursor;
+ unsigned int fgPixel, bgPixel;
+ unsigned int *newSourceP;
+ CARD32 *oldSourceP, *oldMaskP;
+ int x, y, rowPad;
+ int cursorWidth, cursorHeight;
+
+ // check cursor size just to be sure
+ cursorWidth = pCursor->bits->width;
+ cursorHeight = pCursor->bits->height;
+ if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH)
+ return FALSE;
+
+ // allocate memory for new cursor image
+ newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
+ if (!newCursor)
+ return FALSE;
+ memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) );
+
+ // calculate pixel values
+ fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen,
+ pCursor->foreBlue );
+ bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen,
+ pCursor->backBlue );
+
+ // convert to 24-bit Darwin cursor format
+ oldSourceP = (CARD32 *) pCursor->bits->source;
+ oldMaskP = (CARD32 *) pCursor->bits->mask;
+ newSourceP = newCursor;
+ rowPad = CURSORWIDTH - cursorWidth;
+
+ for (y = 0; y < cursorHeight; y++) {
+ for (x = 0; x < cursorWidth; x++) {
+ if (*oldMaskP & (HighBitOf32 >> x)) {
+ if (*oldSourceP & (HighBitOf32 >> x))
+ *newSourceP = fgPixel;
+ else
+ *newSourceP = bgPixel;
+ } else {
+ *newSourceP = 0;
+ }
+ newSourceP++;
+ }
+ oldSourceP++; oldMaskP++;
+ newSourceP += rowPad;
+ }
+
+#if DUMP_DARWIN_CURSOR
+ // Write out the cursor
+ ErrorF("Cursor: 0x%x\n", pCursor);
+ ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth,
+ cursorHeight, rowPad);
+ for (y = 0; y < cursorHeight; y++) {
+ newSourceP = newCursor + y*CURSORWIDTH;
+ for (x = 0; x < cursorWidth; x++) {
+ if (*newSourceP == fgPixel)
+ ErrorF("x");
+ else if (*newSourceP == bgPixel)
+ ErrorF("o");
+ else
+ ErrorF(" ");
+ newSourceP++;
+ }
+ ErrorF("\n");
+ }
+#endif
+
+ // save the result
+ pCursor->devPriv[pScreen->myNum] = (pointer) newCursor;
+ return TRUE;
+}
+
+
+/*
+ * XFIOKitRealizeCursor
+ *
+ */
+static Bool
+XFIOKitRealizeCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor)
+{
+ Bool result;
+ XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+
+ if ((pCursor->bits->height > CURSORHEIGHT) ||
+ (pCursor->bits->width > CURSORWIDTH) ||
+ // FIXME: this condition is not needed after kernel cursor works
+ !ScreenPriv->canHWCursor) {
+ result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor);
+ } else if (dfb->bitsPerPixel == 8) {
+ result = XFIOKitRealizeCursor8(pScreen, pCursor);
+ } else if (dfb->bitsPerPixel == 16) {
+ result = XFIOKitRealizeCursor15(pScreen, pCursor);
+ } else {
+ result = XFIOKitRealizeCursor24(pScreen, pCursor);
+ }
+
+ return result;
+}
+
+
+/*
+ * XFIOKitUnrealizeCursor
+ *
+ */
+static Bool
+XFIOKitUnrealizeCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor)
+{
+ Bool result;
+ XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if ((pCursor->bits->height > CURSORHEIGHT) ||
+ (pCursor->bits->width > CURSORWIDTH) ||
+ // FIXME: this condition is not needed after kernel cursor works
+ !ScreenPriv->canHWCursor) {
+ result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor);
+ } else {
+ xfree( pCursor->devPriv[pScreen->myNum] );
+ result = TRUE;
+ }
+
+ return result;
+}
+
+
+/*
+ * XFIOKitSetCursor
+ * Set the cursor sprite and position
+ * Use hardware cursor if possible
+ */
+static void
+XFIOKitSetCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor,
+ int x,
+ int y)
+{
+ kern_return_t kr;
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
+ StdFBShmem_t *cshmem = iokitScreen->cursorShmem;
+ XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ // are we supposed to remove the cursor?
+ if (!pCursor) {
+ if (ScreenPriv->cursorMode == 0)
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
+ else {
+ if (!cshmem->cursorShow) {
+ cshmem->cursorShow++;
+ if (cshmem->hardwareCursorActive) {
+ kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
+ kern_assert( kr );
+ }
+ }
+ }
+ return;
+ }
+
+ // can we use the kernel or hardware cursor?
+ if ((pCursor->bits->height <= CURSORHEIGHT) &&
+ (pCursor->bits->width <= CURSORWIDTH) &&
+ // FIXME: condition not needed when kernel cursor works
+ ScreenPriv->canHWCursor) {
+
+ if (ScreenPriv->cursorMode == 0) // remove the X cursor
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
+ ScreenPriv->cursorMode = 1; // kernel cursor
+
+ // change the cursor image in shared memory
+ if (dfb->bitsPerPixel == 8) {
+ cursorPrivPtr newCursor =
+ (cursorPrivPtr) pCursor->devPriv[pScreen->myNum];
+ memcpy(cshmem->cursor.bw8.image[0], newCursor->image,
+ CURSORWIDTH*CURSORHEIGHT);
+ memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask,
+ CURSORWIDTH*CURSORHEIGHT);
+ } else if (dfb->bitsPerPixel == 16) {
+ unsigned short *newCursor =
+ (unsigned short *) pCursor->devPriv[pScreen->myNum];
+ memcpy(cshmem->cursor.rgb.image[0], newCursor,
+ 2*CURSORWIDTH*CURSORHEIGHT);
+ } else {
+ unsigned int *newCursor =
+ (unsigned int *) pCursor->devPriv[pScreen->myNum];
+ memcpy(cshmem->cursor.rgb24.image[0], newCursor,
+ 4*CURSORWIDTH*CURSORHEIGHT);
+ }
+
+ // FIXME: We always use a full size cursor, even if the image
+ // is smaller because I couldn't get the padding to come out
+ // right otherwise.
+ cshmem->cursorSize[0].width = CURSORWIDTH;
+ cshmem->cursorSize[0].height = CURSORHEIGHT;
+ cshmem->hotSpot[0].x = pCursor->bits->xhot;
+ cshmem->hotSpot[0].y = pCursor->bits->yhot;
+
+ // try to use a hardware cursor
+ if (ScreenPriv->canHWCursor) {
+ kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0);
+ // FIXME: this is a fatal error without the kernel cursor
+ kern_assert( kr );
+#if 0
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr);
+ ScreenPriv->canHWCursor = FALSE;
+ }
+#endif
+ }
+
+ // make the new cursor visible
+ if (cshmem->cursorShow)
+ cshmem->cursorShow--;
+
+ if (!cshmem->cursorShow && ScreenPriv->canHWCursor) {
+ kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE);
+ // FIXME: this is a fatal error without the kernel cursor
+ kern_assert( kr );
+#if 0
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
+ ScreenPriv->canHWCursor = FALSE;
+ } else
+#endif
+ ScreenPriv->cursorMode = 2; // hardware cursor
+ }
+
+ return;
+ }
+
+ // otherwise we use a software cursor
+ if (ScreenPriv->cursorMode) {
+ /* remove the kernel or hardware cursor */
+ XFIOKitSetCursor(pScreen, 0, x, y);
+ }
+
+ ScreenPriv->cursorMode = 0;
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
+}
+
+
+/*
+ * XFIOKitMoveCursor
+ * Move the cursor. This is a noop for a kernel or hardware cursor.
+ */
+static void
+XFIOKitMoveCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y)
+{
+ XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ // only the X cursor needs to be explicitly moved
+ if (!ScreenPriv->cursorMode)
+ (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
+}
+
+static miPointerSpriteFuncRec darwinSpriteFuncsRec = {
+ XFIOKitRealizeCursor,
+ XFIOKitUnrealizeCursor,
+ XFIOKitSetCursor,
+ XFIOKitMoveCursor
+};
+
+
+/*
+===========================================================================
+
+ Pointer screen functions
+
+===========================================================================
+*/
+
+/*
+ * XFIOKitCursorOffScreen
+ */
+static Bool XFIOKitCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
+{ return FALSE;
+}
+
+
+/*
+ * XFIOKitCrossScreen
+ */
+static void XFIOKitCrossScreen(ScreenPtr pScreen, Bool entering)
+{ return;
+}
+
+
+/*
+ * XFIOKitWarpCursor
+ * Change the cursor position without generating an event or motion history
+ */
+static void
+XFIOKitWarpCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y)
+{
+ kern_return_t kr;
+
+ kr = IOHIDSetMouseLocation( xfIOKitInputConnect, x, y );
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr);
+ }
+ miPointerWarpCursor(pScreen, x, y);
+}
+
+static miPointerScreenFuncRec darwinScreenFuncsRec = {
+ XFIOKitCursorOffScreen,
+ XFIOKitCrossScreen,
+ XFIOKitWarpCursor,
+ DarwinEQPointerPost,
+ DarwinEQSwitchScreen
+};
+
+
+/*
+===========================================================================
+
+ Other screen functions
+
+===========================================================================
+*/
+
+/*
+ * XFIOKitCursorQueryBestSize
+ * Handle queries for best cursor size
+ */
+static void
+XFIOKitCursorQueryBestSize(
+ int class,
+ unsigned short *width,
+ unsigned short *height,
+ ScreenPtr pScreen)
+{
+ XFIOKitCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if (class == CursorShape) {
+ *width = CURSORWIDTH;
+ *height = CURSORHEIGHT;
+ } else
+ (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
+}
+
+
+/*
+ * XFIOKitInitCursor
+ * Initialize cursor support
+ */
+Bool
+XFIOKitInitCursor(
+ ScreenPtr pScreen)
+{
+ XFIOKitScreenPtr iokitScreen = XFIOKIT_SCREEN_PRIV(pScreen);
+ XFIOKitCursorScreenPtr ScreenPriv;
+ miPointerScreenPtr PointPriv;
+ kern_return_t kr;
+
+ // start with no cursor displayed
+ if (!iokitScreen->cursorShmem->cursorShow++) {
+ if (iokitScreen->cursorShmem->hardwareCursorActive) {
+ kr = IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
+ kern_assert( kr );
+ }
+ }
+
+ // initialize software cursor handling (always needed as backup)
+ if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) {
+ return FALSE;
+ }
+
+ // allocate private storage for this screen's hardware cursor info
+ if (darwinCursorGeneration != serverGeneration) {
+ if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ darwinCursorGeneration = serverGeneration;
+ }
+
+ ScreenPriv = xcalloc( 1, sizeof(XFIOKitCursorScreenRec) );
+ if (!ScreenPriv) return FALSE;
+
+ pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv;
+
+ // check if a hardware cursor is supported
+ if (!iokitScreen->cursorShmem->hardwareCursorCapable) {
+ ScreenPriv->canHWCursor = FALSE;
+ ErrorF("Hardware cursor not supported.\n");
+ } else {
+ // we need to make sure that the hardware cursor really works
+ ScreenPriv->canHWCursor = TRUE;
+ kr = IOFBSetNewCursor(iokitScreen->fbService, 0, 0, 0);
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr);
+ ScreenPriv->canHWCursor = FALSE;
+ }
+ kr = IOFBSetCursorVisible(iokitScreen->fbService, TRUE);
+ if (kr != KERN_SUCCESS) {
+ ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr);
+ ScreenPriv->canHWCursor = FALSE;
+ }
+ IOFBSetCursorVisible(iokitScreen->fbService, FALSE);
+ }
+
+ ScreenPriv->cursorMode = 0;
+ ScreenPriv->pInstalledMap = NULL;
+
+ // override some screen procedures
+ ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
+ pScreen->QueryBestSize = XFIOKitCursorQueryBestSize;
+// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor;
+// pScreen->ConstrainCursor = XFIOKitConstrainCursor;
+
+ // initialize hardware cursor handling
+ PointPriv = (miPointerScreenPtr)
+ pScreen->devPrivates[miPointerScreenIndex].ptr;
+
+ ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
+ PointPriv->spriteFuncs = &darwinSpriteFuncsRec;
+
+ /* Other routines that might be overridden */
+/*
+ CursorLimitsProcPtr CursorLimits;
+ RecolorCursorProcPtr RecolorCursor;
+*/
+
+ return TRUE;
+}
diff --git a/hw/darwin/iokit/xfIOKitStartup.c b/hw/darwin/iokit/xfIOKitStartup.c
new file mode 100644
index 000000000..9d25c69fe
--- /dev/null
+++ b/hw/darwin/iokit/xfIOKitStartup.c
@@ -0,0 +1,115 @@
+/**************************************************************
+ *
+ * Startup code for the IOKit 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/iokit/xfIOKitStartup.c,v 1.2 2003/11/01 08:13:08 torrey Exp $ */
+
+#include "darwin.h"
+#include "darwinKeyboard.h"
+#include "micmap.h"
+
+void GlxExtensionInit(void);
+void GlxWrapInitVisuals(miInitVisualsProcPtr *procPtr);
+
+
+/*
+ * DarwinHandleGUI
+ * This function is called first from main().
+ * It does nothing for the IOKit X server.
+ */
+void DarwinHandleGUI(
+ int argc,
+ char *argv[],
+ char *envp[] )
+{
+}
+
+
+/*
+ * DarwinGlxExtensionInit
+ * Initialize the GLX extension.
+ * Mesa is linked into the IOKit mode X server so we just call directly.
+ */
+void DarwinGlxExtensionInit(void)
+{
+ GlxExtensionInit();
+}
+
+
+/*
+ * DarwinGlxWrapInitVisuals
+ */
+void DarwinGlxWrapInitVisuals(
+ miInitVisualsProcPtr *procPtr)
+{
+ GlxWrapInitVisuals(procPtr);
+}
+
+
+/*
+ * DarwinModeProcessArgument
+ * Process IOKit specific command line arguments.
+ */
+int DarwinModeProcessArgument(
+ int argc,
+ char *argv[],
+ int i)
+{
+#ifdef DARWIN_WITH_QUARTZ
+ // XDarwinStartup uses these arguments to indicate which X server
+ // should be started. Ignore them here.
+ if (!strcmp( argv[i], "-fullscreen" ) ||
+ !strcmp( argv[i], "-rootless" ) ||
+ !strcmp( argv[i], "-quartz" ))
+ {
+ return 1;
+ }
+#else
+ if (!strcmp( argv[i], "-fullscreen" ) ||
+ !strcmp( argv[i], "-rootless" ) ||
+ !strcmp( argv[i], "-quartz" ))
+ {
+ FatalError("Command line option %s is not available without Quartz "
+ "support.\n", argv[i]);
+ }
+#endif
+
+ return 0;
+}
+
+
+/*
+ * DarwinModeReadSystemKeymap
+ * IOKit has no alternative to NXKeyMapping API.
+ */
+Bool DarwinModeReadSystemKeymap(
+ darwinKeyboardInfo *info)
+{
+ return FALSE;
+}
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h
index 2c0d6756b..22a2f1441 100644
--- a/hw/darwin/quartz/Preferences.h
+++ b/hw/darwin/quartz/Preferences.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.2 2003/01/15 02:34:05 torrey Exp $ */
+/*
+ * 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/Preferences.h,v 1.3 2003/09/16 00:36:12 torrey Exp $ */
#import <Cocoa/Cocoa.h>
@@ -35,14 +62,14 @@
- (IBAction)saveChanges:(id)sender;
- (IBAction)setKey:(id)sender;
-- (BOOL)sendEvent:(NSEvent*)anEvent;
+- (BOOL)sendEvent:(NSEvent *)anEvent;
- (void)awakeFromNib;
- (void)windowWillClose:(NSNotification *)aNotification;
+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile;
-+ (void)setKeymapFile:(NSString*)newFile;
-+ (void)setSwitchString:(NSString*)newString;
++ (void)setKeymapFile:(NSString *)newFile;
++ (void)setSwitchString:(NSString *)newString;
+ (void)setKeyCode:(int)newKeyCode;
+ (void)setModifiers:(int)newModifiers;
+ (void)setDisplay:(int)newDisplay;
@@ -59,15 +86,16 @@
+ (void)setSystemBeep:(BOOL)newSystemBeep;
+ (void)setXinerama:(BOOL)newXinerama;
+ (void)setAddToPath:(BOOL)newAddToPath;
-+ (void)setAddToPathString:(NSString*)newAddToPathString;
++ (void)setAddToPathString:(NSString *)newAddToPathString;
+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell;
-+ (void)setShellString:(NSString*)newShellString;
++ (void)setShellString:(NSString *)newShellString;
+ (void)setDepth:(int)newDepth;
++ (void)setDisplayModeBundles:(NSArray *)newBundles;
+ (void)saveToDisk;
+ (BOOL)useKeymapFile;
-+ (NSString*)keymapFile;
-+ (NSString*)switchString;
++ (NSString *)keymapFile;
++ (NSString *)switchString;
+ (unsigned int)keyCode;
+ (unsigned int)modifiers;
+ (int)display;
@@ -84,10 +112,11 @@
+ (BOOL)systemBeep;
+ (BOOL)xinerama;
+ (BOOL)addToPath;
-+ (NSString*)addToPathString;
++ (NSString *)addToPathString;
+ (BOOL)useDefaultShell;
-+ (NSString*)shellString;
++ (NSString *)shellString;
+ (int)depth;
++ (NSArray *)displayModeBundles;
@end
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
index 4f8dacbf0..4120b6360 100644
--- a/hw/darwin/quartz/Preferences.m
+++ b/hw/darwin/quartz/Preferences.m
@@ -3,10 +3,43 @@
//
// 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 $ */
+/*
+ * 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/Preferences.m,v 1.4 2003/09/16 00:36:12 torrey Exp $ */
-#import "Preferences.h"
#import "quartzCommon.h"
+
+#define BOOL xBOOL
+#include "darwin.h"
+#undef BOOL
+
+#import "Preferences.h"
+
#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks
// Macros to build the path name
@@ -36,8 +69,8 @@
@"YES", @"ShowStartupHelp",
[NSNumber numberWithInt:0], @"SwitchKeyCode",
[NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
- @"SwitchModifiers", @"NO", @"UseSystemBeep",
- @"YES", @"DockSwitch",
+ @"SwitchModifiers", @"NO", @"UseSystemBeep",
+ @"YES", @"DockSwitch",
@"NO", @"AllowMouseAccelChange",
[NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
@"YES", @"Xinerama",
@@ -45,7 +78,13 @@
[NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString",
@"YES", @"UseDefaultShell",
@"/bin/tcsh", @"Shell",
- [NSNumber numberWithInt:depth_Current], @"Depth", nil];
+ [NSNumber numberWithInt:depth_Current], @"Depth",
+#ifdef BUILD_XPR
+ [NSArray arrayWithObjects:@"xpr.bundle", @"cr.bundle", nil],
+#else
+ [NSArray arrayWithObjects:@"cr.bundle", nil],
+#endif
+ @"DisplayModeBundles", nil];
[super initialize];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
@@ -207,7 +246,7 @@
[switchString setString:@""];
}
-- (BOOL)sendEvent:(NSEvent*)anEvent
+- (BOOL)sendEvent:(NSEvent *)anEvent
{
if(isGettingKeyCode) {
if([anEvent type]==NSKeyDown) // wait for keyup
@@ -240,7 +279,7 @@
return NO;
}
-+ (void)setKeymapFile:(NSString*)newFile
++ (void)setKeymapFile:(NSString *)newFile
{
[[NSUserDefaults standardUserDefaults] setObject:newFile
forKey:@"KeymappingFile"];
@@ -252,7 +291,7 @@
forKey:@"UseKeymappingFile"];
}
-+ (void)setSwitchString:(NSString*)newString
++ (void)setSwitchString:(NSString *)newString
{
[[NSUserDefaults standardUserDefaults] setObject:newString
forKey:@"SwitchString"];
@@ -311,7 +350,7 @@
[[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange
forKey:@"AllowMouseAccelChange"];
// Update the setting used by the X server thread
- quartzMouseAccelChange = newMouseAccelChange;
+ darwinMouseAccelChange = newMouseAccelChange;
}
+ (void)setUseQDCursor:(int)newUseQDCursor
@@ -364,7 +403,7 @@
forKey:@"AddToPath"];
}
-+ (void)setAddToPathString:(NSString*)newAddToPathString
++ (void)setAddToPathString:(NSString *)newAddToPathString
{
[[NSUserDefaults standardUserDefaults] setObject:newAddToPathString
forKey:@"AddToPathString"];
@@ -376,7 +415,7 @@
forKey:@"UseDefaultShell"];
}
-+ (void)setShellString:(NSString*)newShellString
++ (void)setShellString:(NSString *)newShellString
{
[[NSUserDefaults standardUserDefaults] setObject:newShellString
forKey:@"Shell"];
@@ -388,6 +427,12 @@
forKey:@"Depth"];
}
++ (void)setDisplayModeBundles:(NSArray *)newBundles
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newBundles
+ forKey:@"DisplayModeBundles"];
+}
+
+ (void)saveToDisk
{
[[NSUserDefaults standardUserDefaults] synchronize];
@@ -399,13 +444,13 @@
boolForKey:@"UseKeymappingFile"];
}
-+ (NSString*)keymapFile
++ (NSString *)keymapFile
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"KeymappingFile"];
}
-+ (NSString*)switchString
++ (NSString *)switchString
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"SwitchString"];
@@ -502,7 +547,7 @@
return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"];
}
-+ (NSString*)addToPathString
++ (NSString *)addToPathString
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"AddToPathString"];
@@ -514,7 +559,7 @@
boolForKey:@"UseDefaultShell"];
}
-+ (NSString*)shellString
++ (NSString *)shellString
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"Shell"];
@@ -526,5 +571,10 @@
integerForKey:@"Depth"];
}
++ (NSArray *)displayModeBundles
+{
+ return [[NSUserDefaults standardUserDefaults]
+ objectForKey:@"DisplayModeBundles"];
+}
@end
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
index 574ce5f18..3afc9177b 100644
--- a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
+++ b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
@@ -23,48 +23,6 @@
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;
@@ -99,18 +57,6 @@
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,
@@ -118,6 +64,7 @@
3E74E03600863F047F000001,
F5A94EF10314BAC70100011B,
018F40F6003E1974CE6F79C2,
+ 6E5F5F0005537A1A008FEAD7,
);
isa = PBXGroup;
name = "X Server";
@@ -261,22 +208,6 @@
//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
@@ -290,8 +221,6 @@
0127909800074B1A0A000002,
01279092000747AA0A000002,
1C4A3109004D8F24CE6F79C2,
- 014C68EE00ED6A9D7F000001,
- 014C68ED00ED6A9D7F000001,
);
isa = PBXGroup;
name = Classes;
@@ -356,6 +285,8 @@
dependencies = (
6EF065C903D4F0CA006877C2,
6EF065C703D4EE19006877C2,
+ 6E11A986048BDFFB006877C2,
+ 6E7904110500F33B00EEC080,
);
isa = PBXApplicationTarget;
name = XDarwin;
@@ -368,10 +299,42 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>x11app</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>X11 Application</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>****</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>tool</string>
+ <string>*</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>UNIX Application</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>****</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ </array>
<key>CFBundleExecutable</key>
<string>XDarwin</string>
<key>CFBundleGetInfoString</key>
- <string>XDarwin 1.2.0, ©2001-2003 XFree86 Project, Inc.</string>
+ <string>XDarwin 1.3b4, ©2001-2003 XFree86 Project, Inc.</string>
<key>CFBundleIconFile</key>
<string>XDarwin.icns</string>
<key>CFBundleIdentifier</key>
@@ -383,7 +346,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>XDarwin 1.2.0</string>
+ <string>XDarwin 1.3b4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -548,7 +511,7 @@
};
};
1220774600712D75416877C2 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Japanese;
path = Japanese.lproj/Localizable.strings;
@@ -579,7 +542,7 @@
);
isa = PBXGroup;
name = IOKit;
- path = ..;
+ path = ../iokit;
refType = 4;
};
//170
@@ -597,6 +560,8 @@
0A79E19E004499A1CE6F79C2,
6EF7C58703D3BC6D00000104,
6EF065C603D4EE19006877C2,
+ 6E11A985048BDFEE006877C2,
+ 6E7904100500F05600EEC080,
);
isa = PBXGroup;
name = Products;
@@ -770,7 +735,9 @@
targets = (
0A79E19F004499A1CE6F79C2,
6EF7C58603D3BC6D00000104,
+ 6E11A984048BDFEE006877C2,
6EF065C503D4EE19006877C2,
+ 6E79040F0500F05600EEC080,
);
};
29B97314FDCFA39411CA2CEA = {
@@ -780,7 +747,10 @@
170DFB0000729C86416877C2,
43B962CE00617089416877C2,
F5614B3D025112D901000114,
+ 6EC4A64C042A9597006877C2,
32FEE13C00E07C3E7F000001,
+ 6EE1214104968658006877C2,
+ 6EC4A66D042A97FC006877C2,
29B97315FDCFA39411CA2CEA,
29B97317FDCFA39411CA2CEA,
29B97323FDCFA39411CA2CEA,
@@ -875,66 +845,14 @@
//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;
+ name = "Old Cocoa Imp";
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
@@ -979,17 +897,19 @@
//434
43B962CE00617089416877C2 = {
children = (
+ 6EE9B21604E859C200CA7FEA,
+ 6E97A0F505079F9100B8294C,
+ 6E5F5F030553815A008FEAD7,
+ 6E5F5F040553815A008FEAD7,
018F40F8003E1979CE6F79C2,
018F40FA003E197ECE6F79C2,
237A34C10076E37E7F000001,
237A34C40076F4F07F000001,
- 3576829A0077B8F17F000001,
- 0338412F0083BFE57F000001,
- 43B962D000617089416877C2,
- 43B962D100617089416877C2,
43B962CF00617089416877C2,
F5582948015DAD3B01000001,
- 06EB6C3B004099E7CE6F79C2,
+ 6E5F5F0105537A5F008FEAD7,
+ 43B962D000617089416877C2,
+ 43B962D100617089416877C2,
02A1FEA8006D38F0416877C2,
);
isa = PBXGroup;
@@ -1051,6 +971,536 @@
//6E2
//6E3
//6E4
+ 6E11A97F048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A980048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A981048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A982048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A983048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A984048BDFEE006877C2 = {
+ buildPhases = (
+ 6E11A97F048BDFEE006877C2,
+ 6E11A980048BDFEE006877C2,
+ 6E11A981048BDFEE006877C2,
+ 6E11A982048BDFEE006877C2,
+ 6E11A983048BDFEE006877C2,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = glxCGL;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = glxCGL;
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = glxCGL;
+ productReference = 6E11A985048BDFEE006877C2;
+ 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>glxCGL</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 using Apple's OpenGL</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>
+";
+ };
+ 6E11A985048BDFEE006877C2 = {
+ isa = PBXBundleReference;
+ path = glxCGL.bundle;
+ refType = 3;
+ };
+ 6E11A986048BDFFB006877C2 = {
+ isa = PBXTargetDependency;
+ target = 6E11A984048BDFEE006877C2;
+ };
+ 6E5F5F0005537A1A008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinKeyboard.h;
+ refType = 4;
+ };
+ 6E5F5F0105537A5F008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzKeyboard.c;
+ refType = 4;
+ };
+ 6E5F5F030553815A008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = keysym2ucs.c;
+ refType = 4;
+ };
+ 6E5F5F040553815A008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = keysym2ucs.h;
+ refType = 4;
+ };
+ 6E6656EC048832CF006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hook.c";
+ refType = 4;
+ };
+ 6E6656ED048832CF006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hook.h";
+ refType = 4;
+ };
+ 6E6656F0048832EC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = dri.c;
+ refType = 4;
+ };
+ 6E6656F1048832EC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = dri.h;
+ refType = 4;
+ };
+ 6E6656F2048832EC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = dristruct.h;
+ refType = 4;
+ };
+ 6E6656F3048832F9006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = appledri.c;
+ refType = 4;
+ };
+ 6E79040104FD5ED900EEC080 = {
+ children = (
+ 6E79040204FD5EDA00EEC080,
+ 6E79040304FD5EDA00EEC080,
+ 6E79040404FD5EDA00EEC080,
+ );
+ isa = PBXGroup;
+ name = "Safe Alpha";
+ path = safeAlpha;
+ refType = 4;
+ };
+ 6E79040204FD5EDA00EEC080 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = safeAlpha.h;
+ refType = 4;
+ };
+ 6E79040304FD5EDA00EEC080 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = safeAlphaPicture.c;
+ refType = 4;
+ };
+ 6E79040404FD5EDA00EEC080 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = safeAlphaWindow.c;
+ refType = 4;
+ };
+ 6E79040A0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040B0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040C0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040D0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040E0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040F0500F05600EEC080 = {
+ buildPhases = (
+ 6E79040A0500F05600EEC080,
+ 6E79040B0500F05600EEC080,
+ 6E79040C0500F05600EEC080,
+ 6E79040D0500F05600EEC080,
+ 6E79040E0500F05600EEC080,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = xpr;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = xpr;
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = xpr;
+ productReference = 6E7904100500F05600EEC080;
+ 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>xpr</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>Xplugin rootless implementation</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>
+";
+ };
+ 6E7904100500F05600EEC080 = {
+ isa = PBXBundleReference;
+ path = xpr.bundle;
+ refType = 3;
+ };
+ 6E7904110500F33B00EEC080 = {
+ isa = PBXTargetDependency;
+ target = 6E79040F0500F05600EEC080;
+ };
+ 6E97A0F2050798B100B8294C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xprAppleWM.c;
+ refType = 4;
+ };
+ 6E97A0F305079B6500B8294C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = crAppleWM.m;
+ refType = 4;
+ };
+ 6E97A0F505079F9100B8294C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = applewmExt.h;
+ refType = 4;
+ };
+ 6EA0B3AF0544A9CC006877C2 = {
+ children = (
+ 6EA0B3B00544A9CC006877C2,
+ 6EA0B3B10544A9CC006877C2,
+ 6EA0B3B20544A9CC006877C2,
+ 6EA0B3B30544A9CC006877C2,
+ 6EA0B3B40544A9CC006877C2,
+ 6EA0B3B50544A9CC006877C2,
+ 6EA0B3B60544A9CC006877C2,
+ 6EA0B3B70544A9CC006877C2,
+ );
+ isa = PBXGroup;
+ name = Acceleration;
+ path = accel;
+ refType = 4;
+ };
+ 6EA0B3B00544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlAccel.h;
+ refType = 4;
+ };
+ 6EA0B3B10544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlBlt.c;
+ refType = 4;
+ };
+ 6EA0B3B20544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlCopy.c;
+ refType = 4;
+ };
+ 6EA0B3B30544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlFill.c;
+ refType = 4;
+ };
+ 6EA0B3B40544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlFillRect.c;
+ refType = 4;
+ };
+ 6EA0B3B50544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlFillSpans.c;
+ refType = 4;
+ };
+ 6EA0B3B60544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlGlyph.c;
+ refType = 4;
+ };
+ 6EA0B3B70544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlSolid.c;
+ refType = 4;
+ };
+ 6EA8EEC80445E25C006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessConfig.h;
+ refType = 4;
+ };
+ 6EC4A64C042A9597006877C2 = {
+ children = (
+ 6EC4A65D042A9654006877C2,
+ 6EC4A65E042A9654006877C2,
+ 6EC4A65F042A9654006877C2,
+ 6EA8EEC80445E25C006877C2,
+ 6EC4A661042A9654006877C2,
+ 6EC4A662042A9654006877C2,
+ 6EC4A660042A9654006877C2,
+ 6EC4A663042A9654006877C2,
+ 6EC4A664042A9654006877C2,
+ 6EA0B3AF0544A9CC006877C2,
+ 6E79040104FD5ED900EEC080,
+ );
+ isa = PBXGroup;
+ name = Rootless;
+ path = ../../../miext/rootless;
+ refType = 2;
+ };
+ 6EC4A65D042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootless.h;
+ refType = 4;
+ };
+ 6EC4A65E042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.c;
+ refType = 4;
+ };
+ 6EC4A65F042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.h;
+ refType = 4;
+ };
+ 6EC4A660042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.h;
+ refType = 4;
+ };
+ 6EC4A661042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessScreen.c;
+ refType = 4;
+ };
+ 6EC4A662042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.c;
+ refType = 4;
+ };
+ 6EC4A663042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessGC.c;
+ refType = 4;
+ };
+ 6EC4A664042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessValTree.c;
+ refType = 4;
+ };
+ 6EC4A66D042A97FC006877C2 = {
+ children = (
+ 6EF471A004478DE0006877C2,
+ 6E6656F3048832F9006877C2,
+ 6E6656F0048832EC006877C2,
+ 6E6656F1048832EC006877C2,
+ 6E6656F2048832EC006877C2,
+ 6ECF218404589E4D006877C2,
+ 6E97A0F2050798B100B8294C,
+ 6ECF218604589F40006877C2,
+ 6EF4719E04478B08006877C2,
+ 6EDDB2DF04508B2C006877C2,
+ 6EF471A204479263006877C2,
+ 6EF471A404479263006877C2,
+ 6E6656EC048832CF006877C2,
+ 6E6656ED048832CF006877C2,
+ 6EF471A504479263006877C2,
+ 6EF471A304479263006877C2,
+ );
+ isa = PBXGroup;
+ path = xpr;
+ refType = 4;
+ };
+ 6ECF218404589E4D006877C2 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xpr.h;
+ refType = 4;
+ };
+ 6ECF218604589F40006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xprCursor.c;
+ refType = 4;
+ };
+ 6EDDB2DF04508B2C006877C2 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xprScreen.c;
+ refType = 4;
+ };
+ 6EE1214104968658006877C2 = {
+ children = (
+ 6EE1214304968692006877C2,
+ 6EE1214404968692006877C2,
+ 6EE1214204968692006877C2,
+ 6E97A0F305079B6500B8294C,
+ 6EE1214504968692006877C2,
+ 6EE1214604968692006877C2,
+ );
+ isa = PBXGroup;
+ path = cr;
+ refType = 4;
+ };
+ 6EE1214204968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = cr.h;
+ refType = 4;
+ };
+ 6EE1214304968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.m;
+ refType = 4;
+ };
+ 6EE1214404968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.h;
+ refType = 4;
+ };
+ 6EE1214504968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = crFrame.m;
+ refType = 4;
+ };
+ 6EE1214604968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = crScreen.m;
+ refType = 4;
+ };
+ 6EE9B21604E859C200CA7FEA = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = applewm.c;
+ refType = 4;
+ };
6EF065C003D4EE19006877C2 = {
buildActionMask = 2147483647;
files = (
@@ -1153,6 +1603,42 @@
isa = PBXTargetDependency;
target = 6EF7C58603D3BC6D00000104;
};
+ 6EF4719E04478B08006877C2 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xprFrame.c;
+ refType = 4;
+ };
+ 6EF471A004478DE0006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = Xplugin.h;
+ refType = 4;
+ };
+ 6EF471A204479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hash.c";
+ refType = 4;
+ };
+ 6EF471A304479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-list.h";
+ refType = 4;
+ };
+ 6EF471A404479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hash.h";
+ refType = 4;
+ };
+ 6EF471A504479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-list.c";
+ refType = 4;
+ };
6EF7C58103D3BC6D00000104 = {
buildActionMask = 2147483647;
files = (
@@ -1209,7 +1695,7 @@
);
isa = PBXBundleTarget;
name = glxAGL;
- productName = glxAqua;
+ productName = glxAGL;
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\">
@@ -1228,7 +1714,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>GLX bundle with AGL</string>
+ <string>GLX bundle using AGL framework</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
@@ -1277,7 +1763,7 @@
refType = 4;
};
F51BF62D02026E1C01000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Portuguese;
path = Portuguese.lproj/Localizable.strings;
@@ -1336,7 +1822,7 @@
refType = 4;
};
F533213C0193CBC901000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = German;
path = German.lproj/Localizable.strings;
@@ -1395,7 +1881,7 @@
refType = 4;
};
F533214501A4B42501000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Dutch;
path = Dutch.lproj/Localizable.strings;
@@ -1450,38 +1936,14 @@
path = fullscreen.c;
refType = 4;
};
- F5614B3C0251124C01000114 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = fullscreen.h;
- refType = 4;
- };
F5614B3D025112D901000114 = {
children = (
F5614B3B0251124C01000114,
- F5614B3C0251124C01000114,
+ 3576829A0077B8F17F000001,
+ 0338412F0083BFE57F000001,
);
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;
+ path = fullscreen;
refType = 4;
};
F587E16001924C1D01000001 = {
@@ -1505,7 +1967,7 @@
refType = 4;
};
F587E16301924C5E01000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Swedish;
path = Swedish.lproj/Localizable.strings;
@@ -1552,7 +2014,7 @@
refType = 4;
};
F58D65DE018F79A001000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = French;
path = French.lproj/Localizable.strings;
@@ -1604,7 +2066,7 @@
refType = 4;
};
F5ACD25FC5B5E9AA01000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Spanish;
path = Spanish.lproj/Localizable.strings;
@@ -1651,7 +2113,7 @@
refType = 4;
};
F5ACD266C5BE03C501000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = ko;
path = ko.lproj/Localizable.strings;
diff --git a/hw/darwin/quartz/XDarwinStartup.c b/hw/darwin/quartz/XDarwinStartup.c
index 53343aa1e..7b2c89f38 100644
--- a/hw/darwin/quartz/XDarwinStartup.c
+++ b/hw/darwin/quartz/XDarwinStartup.c
@@ -38,16 +38,15 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.2 2003/05/14 05:15:56 torrey Exp $ */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
+#include <errno.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
diff --git a/hw/darwin/quartz/XServer.h b/hw/darwin/quartz/XServer.h
index 3eadd650e..58c7ff748 100644
--- a/hw/darwin/quartz/XServer.h
+++ b/hw/darwin/quartz/XServer.h
@@ -29,7 +29,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.15 2003/11/14 20:27:58 torrey Exp $ */
#define BOOL xBOOL
#include "Xproto.h"
@@ -41,15 +41,14 @@
// server state
int serverState;
NSRecursiveLock *serverLock;
+ NSMutableArray *pendingClients;
BOOL serverVisible;
BOOL rootlessMenuBarVisible;
BOOL queueShowServer;
+ BOOL quitWithoutQuery;
UInt32 mouseState;
- Class windowClass;
-
- // server event queue
BOOL sendServerEvents;
- int eventWriteFD;
+ BOOL x11Active;
// Aqua interface
IBOutlet NSWindow *modeWindow;
@@ -59,6 +58,12 @@
IBOutlet NSWindow *helpWindow;
IBOutlet NSButton *startupHelpButton;
IBOutlet NSPanel *switchWindow;
+
+ // Menu elements setable by Apple-WM extension
+ IBOutlet NSMenu *windowMenu;
+ IBOutlet NSMenuItem *windowSeparator;
+ IBOutlet NSMenu *dockMenu;
+ int checkedWindowItem;
}
- (id)init;
@@ -68,9 +73,11 @@
+ (void)append:(NSString *)value toEnv:(NSString *)name;
+- (BOOL)loadDisplayBundle;
- (void)startX;
- (void)finishStartX;
- (BOOL)startXClients;
+- (void)runClient:(NSString *)filename;
- (void)run;
- (void)toggle;
- (void)showServer:(BOOL)show;
@@ -82,19 +89,36 @@
- (void)sendXEvent:(xEvent *)xe;
- (void)sendShowHide:(BOOL)show;
- (void)clientProcessDone:(int)clientStatus;
+- (void)activateX11:(BOOL)state;
+- (void)windowBecameKey:(NSWindow *)window;
+- (void)setX11WindowList:(NSArray *)list;
+- (void)setX11WindowCheck:(NSNumber *)nn;
// Aqua interface actions
- (IBAction)startFullScreen:(id)sender;
- (IBAction)startRootless:(id)sender;
- (IBAction)closeHelpAndShow:(id)sender;
+- (IBAction)showSwitchPanel:(id)sender;
- (IBAction)showAction:(id)sender;
+- (IBAction)itemSelected:(id)sender;
+- (IBAction)nextWindow:(id)sender;
+- (IBAction)previousWindow:(id)sender;
+- (IBAction)performClose:(id)sender;
+- (IBAction)performMiniaturize:(id)sender;
+- (IBAction)performZoom:(id)sender;
+- (IBAction)bringAllToFront:(id)sender;
+- (IBAction)copy:(id)sender;
// NSApplication delegate
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+- (void)applicationWillTerminate:(NSNotification *)aNotification;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
+- (void)applicationDidHide:(NSNotification *)aNotification;
+- (void)applicationDidUnhide:(NSNotification *)aNotification;
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
- (void)applicationWillResignActive:(NSNotification *)aNotification;
- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
// NSPort delegate
- (void)handlePortMessage:(NSPortMessage *)portMessage;
@@ -109,4 +133,3 @@ enum {
server_Quitting,
server_Done
};
-
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
index c57defd53..1be22f82c 100644
--- a/hw/darwin/quartz/XServer.m
+++ b/hw/darwin/quartz/XServer.m
@@ -34,7 +34,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.17 2003/11/14 20:27:58 torrey Exp $ */
#include "quartzCommon.h"
@@ -42,7 +42,12 @@
#include "X.h"
#include "Xproto.h"
#include "os.h"
+#include "opaque.h"
#include "darwin.h"
+#include "quartz.h"
+#define _APPLEWM_SERVER_
+#include "applewm.h"
+#include "applewmExt.h"
#undef BOOL
#import "XServer.h"
@@ -64,14 +69,6 @@
#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,
@@ -90,7 +87,7 @@ static shellList_t const shellList[] = {
{ "sh", shell_Bourne }, // standard Bourne shell
{ "zsh", shell_Bourne }, // Z shell
{ "bash", shell_Bourne }, // GNU Bourne again shell
- { NULL, shell_Unknown }
+ { NULL, shell_Unknown }
};
extern int argcGlobal;
@@ -99,7 +96,6 @@ 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);
@@ -122,15 +118,15 @@ static io_connect_t root_port;
serverState = server_NotStarted;
serverLock = [[NSRecursiveLock alloc] init];
+ pendingClients = nil;
clientPID = 0;
sendServerEvents = NO;
+ x11Active = YES;
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];
@@ -145,6 +141,11 @@ static io_connect_t root_port;
[[NSRunLoop currentRunLoop] addPort:signalPort
forMode:NSModalPanelRunLoopMode];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowBecameKey:)
+ name:NSWindowDidBecomeKeyNotification
+ object:nil];
+
return self;
}
@@ -164,7 +165,7 @@ static io_connect_t root_port;
[self showServer:NO];
sendServerEvents = NO;
- if (clientPID != 0 || !quartzStartClients) {
+ if (!quitWithoutQuery && (clientPID != 0 || !quartzStartClients)) {
int but;
but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""),
@@ -270,11 +271,18 @@ static io_connect_t root_port;
break;
case NSLeftMouseDown:
[self getMousePosition:&xe fromEvent:anEvent];
- if (quartzRootless &&
- ! ([anEvent window] &&
- [[anEvent window] isKindOfClass:windowClass])) {
- // Click in non X window - ignore
- return NO;
+ if (quartzRootless) {
+ // Check that event is in X11 window
+ if (!quartzProcs->IsX11Window([anEvent window],
+ [anEvent windowNumber]))
+ {
+ if (x11Active)
+ [self activateX11:NO];
+ return NO;
+ } else {
+ if (!x11Active)
+ [self activateX11:YES];
+ }
}
mouse1Pressed = YES;
xe.u.u.type = ButtonPress;
@@ -310,6 +318,8 @@ static io_connect_t root_port;
break;
case NSKeyDown:
case NSKeyUp:
+ if (!x11Active)
+ return NO;
// 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])
@@ -321,6 +331,8 @@ static io_connect_t root_port;
xe.u.u.detail = [anEvent keyCode];
break;
case NSFlagsChanged:
+ if (!x11Active)
+ return NO;
[self getMousePosition:&xe fromEvent:nil];
xe.u.u.type = kXDarwinUpdateModifiers;
xe.u.clientMessage.u.l.longs0 = flags;
@@ -335,14 +347,13 @@ static io_connect_t root_port;
[self sendXEvent:&xe];
- // Rootless: Send first NSLeftMouseDown to windows and views so window
- // ordering can be suppressed.
+ // Rootless: Send first NSLeftMouseDown to Cocoa 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])
+ [anEvent clickCount] == 1 && [anEvent window])
{
return NO;
}
@@ -429,6 +440,27 @@ static io_connect_t root_port;
}
}
+
+// Load the appropriate display mode bundle
+- (BOOL)loadDisplayBundle
+{
+ if (quartzRootless) {
+ NSEnumerator *enumerator = [[Preferences displayModeBundles]
+ objectEnumerator];
+ NSString *bundleName;
+
+ while ((bundleName = [enumerator nextObject])) {
+ if (QuartzLoadDisplayBundle([bundleName cString]))
+ return YES;
+ }
+
+ return NO;
+ } else {
+ return QuartzLoadDisplayBundle("fullscreen.bundle");
+ }
+}
+
+
// Start the X server thread and the client process
- (void)startX
{
@@ -455,6 +487,9 @@ static io_connect_t root_port;
else
NSLog(@"No version");
+ if (![self loadDisplayBundle])
+ [NSApp terminate:nil];
+
// Start the X server thread
serverState = server_Starting;
[NSThread detachNewThreadSelector:@selector(run) toTarget:self
@@ -517,6 +552,19 @@ static io_connect_t root_port;
if (quartzServerQuitting) {
[self quitServer];
[NSApp replyToApplicationShouldTerminate:YES];
+ return;
+ }
+
+ if (pendingClients) {
+ NSEnumerator *enumerator = [pendingClients objectEnumerator];
+ NSString *filename;
+
+ while ((filename = [enumerator nextObject])) {
+ [self runClient:filename];
+ }
+
+ [pendingClients release];
+ pendingClients = nil;
}
}
@@ -666,6 +714,87 @@ static io_connect_t root_port;
return YES;
}
+// Start the specified client in its own task
+// FIXME: This should be unified with startXClients
+- (void)runClient:(NSString *)filename
+{
+ const char *command = [filename UTF8String];
+ const char *shell;
+ const char *argv[5];
+ int child1, child2 = 0;
+ int status;
+
+ shell = getenv("SHELL");
+ if (shell == NULL)
+ shell = "/bin/bash";
+
+ /* At least [ba]sh, [t]csh and zsh all work with this syntax. We
+ need to use an interactive shell to force it to load the user's
+ environment. */
+
+ argv[0] = shell;
+ argv[1] = "-i";
+ argv[2] = "-c";
+ argv[3] = command;
+ argv[4] = NULL;
+
+ /* Do the fork-twice trick to avoid having to reap zombies */
+
+ child1 = fork();
+
+ switch (child1) {
+ case -1: /* error */
+ break;
+
+ case 0: /* child1 */
+ child2 = fork();
+
+ switch (child2) {
+ int max_files, i;
+ char buf[1024], *tem;
+
+ case -1: /* error */
+ _exit(1);
+
+ case 0: /* child2 */
+ /* close all open files except for standard streams */
+ max_files = sysconf(_SC_OPEN_MAX);
+ for (i = 3; i < max_files; i++)
+ close(i);
+
+ /* ensure stdin is on /dev/null */
+ close(0);
+ open("/dev/null", O_RDONLY);
+
+ /* cd $HOME */
+ tem = getenv("HOME");
+ if (tem != NULL)
+ chdir(tem);
+
+ /* Setup environment */
+ snprintf(buf, sizeof(buf), ":%s", display);
+ setenv("DISPLAY", buf, TRUE);
+ tem = getenv("PATH");
+ if (tem != NULL && tem[0] != NULL)
+ snprintf(buf, sizeof(buf), "%s:/usr/X11R6/bin", tem);
+ else
+ snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11R6/bin");
+ setenv("PATH", buf, TRUE);
+
+ execvp(argv[0], (char **const) argv);
+
+ _exit(2);
+
+ default: /* parent (child1) */
+ _exit(0);
+ }
+ break;
+
+ default: /* parent */
+ waitpid(child1, &status, 0);
+ }
+}
+
// Run the X server thread
- (void)run
{
@@ -712,6 +841,12 @@ static io_connect_t root_port;
[NSApp activateIgnoringOtherApps:YES];
}
+// Show the Aqua-X11 switch panel useful for fullscreen mode
+- (IBAction)showSwitchPanel:(id)sender
+{
+ [switchWindow orderFront:nil];
+}
+
// Show the X server when sent message from GUI
- (IBAction)showAction:(id)sender
{
@@ -787,11 +922,10 @@ static io_connect_t root_port;
if (show) {
if (!quartzRootless) {
- QuartzFSCapture();
+ quartzProcs->CaptureScreens();
HideMenuBar();
}
- xe.u.u.type = kXDarwinShow;
- [self sendXEvent:&xe];
+ [self activateX11:YES];
// the mouse location will have moved; track it
xe.u.u.type = MotionNotify;
@@ -802,14 +936,19 @@ static io_connect_t root_port;
xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags];
[self sendXEvent:&xe];
- // put the pasteboard into the X cut buffer
- [self readPasteboard];
+ // If there is no AppleWM-aware cut and paste manager, do what we can.
+ if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
+ // put the pasteboard into the X cut buffer
+ [self readPasteboard];
+ }
} else {
- // put the X cut buffer on the pasteboard
- [self writePasteboard];
+ // If there is no AppleWM-aware cut and paste manager, do what we can.
+ if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
+ // put the X cut buffer on the pasteboard
+ [self writePasteboard];
+ }
- xe.u.u.type = kXDarwinHide;
- [self sendXEvent:&xe];
+ [self activateX11:NO];
}
serverVisible = show;
@@ -877,7 +1016,7 @@ static io_connect_t root_port;
}
#endif
- ENQUEUE(xe);
+ DarwinEQEnqueue(xe);
}
// Handle messages from the X server thread
@@ -885,12 +1024,12 @@ static io_connect_t root_port;
{
unsigned msg = [portMessage msgid];
- switch(msg) {
+ 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();
+ quartzProcs->ReleaseScreens();
ShowMenuBar();
}
break;
@@ -908,13 +1047,43 @@ static io_connect_t root_port;
break;
case kQuartzCursorUpdate:
- QuartzReallySetCursor();
+ if (quartzProcs->CursorUpdate)
+ quartzProcs->CursorUpdate();
break;
case kQuartzPostEvent:
{
const xEvent *xe = [[[portMessage components] lastObject] bytes];
- ENQUEUE(xe);
+ DarwinEQEnqueue(xe);
+ break;
+ }
+
+ case kQuartzSetWindowMenu:
+ {
+ NSArray *list;
+ [[[portMessage components] lastObject] getBytes:&list];
+ [self setX11WindowList:list];
+ [list release];
+ break;
+ }
+
+ case kQuartzSetWindowMenuCheck:
+ {
+ int n;
+ [[[portMessage components] lastObject] getBytes:&n];
+ [self setX11WindowCheck:[NSNumber numberWithInt:n]];
+ break;
+ }
+
+ case kQuartzSetFrontProcess:
+ [NSApp activateIgnoringOtherApps:YES];
+ break;
+
+ case kQuartzSetCanQuit:
+ {
+ int n;
+ [[[portMessage components] lastObject] getBytes:&n];
+ quitWithoutQuery = (BOOL) n;
break;
}
@@ -939,6 +1108,234 @@ static io_connect_t root_port;
}
}
+// User selected an X11 window from a menu
+- (IBAction)itemSelected:(id)sender
+{
+ xEvent xe;
+
+ [NSApp activateIgnoringOtherApps:YES];
+
+ // Notify the client of the change through the X server thread
+ xe.u.u.type = kXDarwinControllerNotify;
+ xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuItem;
+ xe.u.clientMessage.u.l.longs1 = [sender tag];
+ [self sendXEvent:&xe];
+}
+
+// User selected Next from window menu
+- (IBAction)nextWindow:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMNextWindow);
+}
+
+// User selected Previous from window menu
+- (IBAction)previousWindow:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMPreviousWindow);
+}
+
+/*
+ * The XPR implementation handles close, minimize, and zoom actions for X11
+ * windows here, while CR handles these in the NSWindow class.
+ */
+
+// Handle Close from window menu for X11 window in XPR implementation
+- (IBAction)performClose:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMCloseWindow);
+}
+
+// Handle Minimize from window menu for X11 window in XPR implementation
+- (IBAction)performMiniaturize:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMMinimizeWindow);
+}
+
+// Handle Zoom from window menu for X11 window in XPR implementation
+- (IBAction)performZoom:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMZoomWindow);
+}
+
+// Handle "Bring All to Front" from window menu
+- (IBAction)bringAllToFront:(id)sender
+{
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMBringAllToFront);
+ } else {
+ [NSApp arrangeInFront:nil];
+ }
+}
+
+// This ends up at the end of the responder chain.
+- (IBAction)copy:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinPasteboardNotify, 1,
+ AppleWMCopyToPasteboard);
+}
+
+// Set whether or not X11 is active and should receive all key events
+- (void)activateX11:(BOOL)state
+{
+ if (state) {
+ QuartzMessageServerThread(kXDarwinActivate, 0);
+ }
+ else {
+ QuartzMessageServerThread(kXDarwinDeactivate, 0);
+ }
+
+ x11Active = state;
+}
+
+// Some NSWindow became the key window
+- (void)windowBecameKey:(NSWindow *)window
+{
+ if (quartzProcs->IsX11Window(window, [window windowNumber])) {
+ if (!x11Active)
+ [self activateX11:YES];
+ } else {
+ if (x11Active)
+ [self activateX11:NO];
+ }
+}
+
+// Set the Apple-WM specifiable part of the window menu
+- (void)setX11WindowList:(NSArray *)list
+{
+ NSMenuItem *item;
+ int first, count, i;
+ xEvent xe;
+
+ /* Work backwards so we don't mess up the indices */
+ first = [windowMenu indexOfItem:windowSeparator] + 1;
+ if (first > 0) {
+ count = [windowMenu numberOfItems];
+ for (i = count - 1; i >= first; i--)
+ [windowMenu removeItemAtIndex:i];
+ } else {
+ windowSeparator = (NSMenuItem *)[windowMenu addItemWithTitle:@""
+ action:nil
+ keyEquivalent:@""];
+ }
+
+ count = [dockMenu numberOfItems];
+ for (i = 0; i < count; i++)
+ [dockMenu removeItemAtIndex:0];
+
+ count = [list count];
+
+ for (i = 0; i < count; i++)
+ {
+ NSString *name, *shortcut;
+
+ name = [[list objectAtIndex:i] objectAtIndex:0];
+ shortcut = [[list objectAtIndex:i] objectAtIndex:1];
+
+ item = (NSMenuItem *)[windowMenu addItemWithTitle:name
+ action:@selector(itemSelected:)
+ keyEquivalent:shortcut];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+
+ item = (NSMenuItem *)[dockMenu insertItemWithTitle:name
+ action:@selector(itemSelected:)
+ keyEquivalent:shortcut atIndex:i];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+ }
+
+ if (checkedWindowItem >= 0 && checkedWindowItem < count)
+ {
+ item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
+ [item setState:NSOnState];
+ item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
+ [item setState:NSOnState];
+ }
+
+ // Notify the client of the change through the X server thread
+ xe.u.u.type = kXDarwinControllerNotify;
+ xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuNotify;
+ [self sendXEvent:&xe];
+}
+
+// Set the checked item on the Apple-WM specifiable window menu
+- (void)setX11WindowCheck:(NSNumber *)nn
+{
+ NSMenuItem *item;
+ int first, count;
+ int n = [nn intValue];
+
+ first = [windowMenu indexOfItem:windowSeparator] + 1;
+ count = [windowMenu numberOfItems] - first;
+
+ if (checkedWindowItem >= 0 && checkedWindowItem < count)
+ {
+ item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
+ [item setState:NSOffState];
+ item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
+ [item setState:NSOffState];
+ }
+ if (n >= 0 && n < count)
+ {
+ item = (NSMenuItem *)[windowMenu itemAtIndex:first + n];
+ [item setState:NSOnState];
+ item = (NSMenuItem *)[dockMenu itemAtIndex:n];
+ [item setState:NSOnState];
+ }
+ checkedWindowItem = n;
+}
+
+// Return whether or not a menu item should be enabled
+- (BOOL)validateMenuItem:(NSMenuItem *)item
+{
+ NSMenu *menu = [item menu];
+
+ if (menu == windowMenu && [item tag] == 30) {
+ // Mode switch panel is for fullscreen only
+ return !quartzRootless;
+ }
+ else if ((menu == windowMenu && [item tag] != 40) || menu == dockMenu) {
+ // The special window and dock menu items should not be active unless
+ // there is an AppleWM-aware window manager running.
+ return (AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0;
+ }
+ else {
+ return TRUE;
+ }
+}
+
+/*
+ * Application Delegate Methods
+ */
+
+- (void)applicationDidHide:(NSNotification *)aNotification
+{
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMHideAll);
+ } else {
+ // FIXME: We need to hide Xplugin windows here
+ }
+}
+
+- (void)applicationDidUnhide:(NSNotification *)aNotification
+{
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMShowAll);
+ } else {
+ [NSApp arrangeInFront:nil];
+ }
+}
+
// Called when the user clicks the application icon,
// but not when Cmd-Tab is used.
// Rootless: Don't switch until applicationWillBecomeActive.
@@ -958,8 +1355,38 @@ static io_connect_t root_port;
- (void)applicationWillBecomeActive:(NSNotification *)aNotification
{
- if (quartzRootless)
+ if (quartzRootless) {
[self showServer:YES];
+
+ // If there is no AppleWM-aware window manager, we can't allow
+ // interleaving of Aqua and X11 windows.
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) == 0) {
+ [NSApp arrangeInFront:nil];
+ }
+ }
+}
+
+// Called when the user opens a document type that we claim (ie. an X11 executable).
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ if (serverState == server_Running) {
+ [self runClient:filename];
+ return YES;
+ }
+ else if (serverState == server_NotStarted || serverState == server_Starting) {
+ if ([filename UTF8String][0] != ':') { // Ignore display names
+ if (!pendingClients) {
+ pendingClients = [[NSMutableArray alloc] initWithCapacity:1];
+ }
+ [pendingClients addObject:filename];
+ return YES; // Assume it will launch successfully
+ }
+ return NO;
+ }
+
+ // If the server is quitting or done,
+ // its too late to launch new clients this time.
+ return NO;
}
@end
@@ -970,7 +1397,7 @@ static io_connect_t root_port;
// NSPort is not thread safe.
void QuartzMessageMainThread(unsigned msg, void *data, unsigned length)
{
- if (msg == kQuartzPostEvent) {
+ if (length > 0) {
NSData *eventData = [NSData dataWithBytes:data length:length];
NSArray *eventArray = [NSArray arrayWithObject:eventData];
NSPortMessage *newMessage =
@@ -986,6 +1413,36 @@ void QuartzMessageMainThread(unsigned msg, void *data, unsigned length)
}
}
+void
+QuartzSetWindowMenu(int nitems, const char **items,
+ const char *shortcuts)
+{
+ NSMutableArray *array;
+ int i;
+
+ array = [[NSMutableArray alloc] initWithCapacity:nitems];
+
+ for (i = 0; i < nitems; i++) {
+ NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:2];
+ NSString *string = [NSString stringWithUTF8String:items[i]];
+
+ [subarray addObject:string];
+
+ if (shortcuts[i] != 0) {
+ NSString *number = [NSString stringWithFormat:@"%d",
+ shortcuts[i]];
+ [subarray addObject:number];
+ } else
+ [subarray addObject:@""];
+
+ [array addObject:subarray];
+ }
+
+ /* Send the array of strings over to the main thread. */
+ /* Will be released in main thread. */
+ QuartzMessageMainThread(kQuartzSetWindowMenu, &array, sizeof(NSArray *));
+}
+
// Handle SIGCHLD signals
static void childDone(int sig)
{
@@ -1025,5 +1482,5 @@ static void powerDidChange(
}
break;
}
-
+
}
diff --git a/hw/darwin/quartz/applewm.c b/hw/darwin/quartz/applewm.c
new file mode 100644
index 000000000..d3e302727
--- /dev/null
+++ b/hw/darwin/quartz/applewm.c
@@ -0,0 +1,697 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewm.c,v 1.3 2003/11/11 23:48:41 torrey Exp $ */
+/**************************************************************************
+
+Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+Copyright (c) 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, 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.
+
+**************************************************************************/
+
+#include "quartzCommon.h"
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include "misc.h"
+#include "dixstruct.h"
+#include "globals.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "servermd.h"
+#include "swaprep.h"
+#include "Xatom.h"
+#include "darwin.h"
+#define _APPLEWM_SERVER_
+#include "applewmstr.h"
+#include "applewmExt.h"
+
+#define DEFINE_ATOM_HELPER(func,atom_name) \
+static Atom func (void) { \
+ static int generation; \
+ static Atom atom; \
+ if (generation != serverGeneration) { \
+ generation = serverGeneration; \
+ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
+ } \
+ return atom; \
+}
+
+DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
+
+static AppleWMProcsPtr appleWMProcs;
+
+static int WMErrorBase;
+
+static DISPATCH_PROC(ProcAppleWMDispatch);
+static DISPATCH_PROC(SProcAppleWMDispatch);
+
+static void AppleWMResetProc(ExtensionEntry* extEntry);
+
+static unsigned char WMReqCode = 0;
+static int WMEventBase = 0;
+
+static RESTYPE ClientType, EventType; /* resource types for event masks */
+static XID eventResource;
+
+/* Currently selected events */
+static unsigned int eventMask = 0;
+
+static int WMFreeClient (pointer data, XID id);
+static int WMFreeEvents (pointer data, XID id);
+static void SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to);
+
+typedef struct _WMEvent *WMEventPtr;
+typedef struct _WMEvent {
+ WMEventPtr next;
+ ClientPtr client;
+ XID clientResource;
+ unsigned int mask;
+} WMEventRec;
+
+static inline BoxRec
+make_box (int x, int y, int w, int h)
+{
+ BoxRec r;
+ r.x1 = x;
+ r.y1 = y;
+ r.x2 = x + w;
+ r.y2 = y + h;
+ return r;
+}
+
+void
+AppleWMExtensionInit(
+ AppleWMProcsPtr procsPtr)
+{
+ ExtensionEntry* extEntry;
+
+ ClientType = CreateNewResourceType(WMFreeClient);
+ EventType = CreateNewResourceType(WMFreeEvents);
+ eventResource = FakeClientID(0);
+
+ if (ClientType && EventType &&
+ (extEntry = AddExtension(APPLEWMNAME,
+ AppleWMNumberEvents,
+ AppleWMNumberErrors,
+ ProcAppleWMDispatch,
+ SProcAppleWMDispatch,
+ AppleWMResetProc,
+ StandardMinorOpcode)))
+ {
+ WMReqCode = (unsigned char)extEntry->base;
+ WMErrorBase = extEntry->errorBase;
+ WMEventBase = extEntry->eventBase;
+ EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
+ appleWMProcs = procsPtr;
+ }
+}
+
+/*ARGSUSED*/
+static void
+AppleWMResetProc (
+ ExtensionEntry* extEntry
+)
+{
+}
+
+/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
+void
+AppleWMSetScreenOrigin(
+ WindowPtr pWin
+)
+{
+ long data[2];
+
+ data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x
+ + darwinMainScreenX);
+ data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
+ + darwinMainScreenY);
+
+ ChangeWindowProperty(pWin, xa_native_screen_origin(), XA_INTEGER,
+ 32, PropModeReplace, 2, data, TRUE);
+}
+
+static int
+ProcAppleWMQueryVersion(
+ register ClientPtr client
+)
+{
+ xAppleWMQueryVersionReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = APPLE_WM_MAJOR_VERSION;
+ rep.minorVersion = APPLE_WM_MINOR_VERSION;
+ rep.patchVersion = APPLE_WM_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ }
+ WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+
+/* events */
+
+static inline void
+updateEventMask (WMEventPtr *pHead)
+{
+ WMEventPtr pCur;
+
+ eventMask = 0;
+ for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
+ eventMask |= pCur->mask;
+}
+
+/*ARGSUSED*/
+static int
+WMFreeClient (data, id)
+ pointer data;
+ XID id;
+{
+ WMEventPtr pEvent;
+ WMEventPtr *pHead, pCur, pPrev;
+
+ pEvent = (WMEventPtr) data;
+ pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
+ if (pHead) {
+ pPrev = 0;
+ for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next)
+ pPrev = pCur;
+ if (pCur) {
+ if (pPrev)
+ pPrev->next = pEvent->next;
+ else
+ *pHead = pEvent->next;
+ }
+ updateEventMask (pHead);
+ }
+ xfree ((pointer) pEvent);
+ return 1;
+}
+
+/*ARGSUSED*/
+static int
+WMFreeEvents (data, id)
+ pointer data;
+ XID id;
+{
+ WMEventPtr *pHead, pCur, pNext;
+
+ pHead = (WMEventPtr *) data;
+ for (pCur = *pHead; pCur; pCur = pNext) {
+ pNext = pCur->next;
+ FreeResource (pCur->clientResource, ClientType);
+ xfree ((pointer) pCur);
+ }
+ xfree ((pointer) pHead);
+ eventMask = 0;
+ return 1;
+}
+
+static int
+ProcAppleWMSelectInput (client)
+ register ClientPtr client;
+{
+ REQUEST(xAppleWMSelectInputReq);
+ WMEventPtr pEvent, pNewEvent, *pHead;
+ XID clientResource;
+
+ REQUEST_SIZE_MATCH (xAppleWMSelectInputReq);
+ pHead = (WMEventPtr *)SecurityLookupIDByType(client,
+ eventResource, EventType, SecurityWriteAccess);
+ if (stuff->mask != 0) {
+ if (pHead) {
+ /* check for existing entry. */
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
+ {
+ if (pEvent->client == client)
+ {
+ pEvent->mask = stuff->mask;
+ updateEventMask (pHead);
+ return Success;
+ }
+ }
+ }
+
+ /* build the entry */
+ pNewEvent = (WMEventPtr) xalloc (sizeof (WMEventRec));
+ if (!pNewEvent)
+ return BadAlloc;
+ pNewEvent->next = 0;
+ pNewEvent->client = client;
+ pNewEvent->mask = stuff->mask;
+ /*
+ * add a resource that will be deleted when
+ * the client goes away
+ */
+ clientResource = FakeClientID (client->index);
+ pNewEvent->clientResource = clientResource;
+ if (!AddResource (clientResource, ClientType, (pointer)pNewEvent))
+ return BadAlloc;
+ /*
+ * create a resource to contain a pointer to the list
+ * of clients selecting input. This must be indirect as
+ * the list may be arbitrarily rearranged which cannot be
+ * done through the resource database.
+ */
+ if (!pHead)
+ {
+ pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr));
+ if (!pHead ||
+ !AddResource (eventResource, EventType, (pointer)pHead))
+ {
+ FreeResource (clientResource, RT_NONE);
+ return BadAlloc;
+ }
+ *pHead = 0;
+ }
+ pNewEvent->next = *pHead;
+ *pHead = pNewEvent;
+ updateEventMask (pHead);
+ } else if (stuff->mask == 0) {
+ /* delete the interest */
+ if (pHead) {
+ pNewEvent = 0;
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
+ if (pEvent->client == client)
+ break;
+ pNewEvent = pEvent;
+ }
+ if (pEvent) {
+ FreeResource (pEvent->clientResource, ClientType);
+ if (pNewEvent)
+ pNewEvent->next = pEvent->next;
+ else
+ *pHead = pEvent->next;
+ xfree (pEvent);
+ updateEventMask (pHead);
+ }
+ }
+ } else {
+ client->errorValue = stuff->mask;
+ return BadValue;
+ }
+ return Success;
+}
+
+/*
+ * deliver the event
+ */
+
+void
+AppleWMSendEvent (type, mask, which, arg)
+ int type, which, arg;
+ unsigned int mask;
+{
+ WMEventPtr *pHead, pEvent;
+ ClientPtr client;
+ xAppleWMNotifyEvent se;
+
+ pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
+ if (!pHead)
+ return;
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
+ client = pEvent->client;
+ if ((pEvent->mask & mask) == 0
+ || client == serverClient || client->clientGone)
+ {
+ continue;
+ }
+ se.type = type + WMEventBase;
+ se.kind = which;
+ se.arg = arg;
+ se.sequenceNumber = client->sequence;
+ se.time = currentTime.milliseconds;
+ WriteEventsToClient (client, 1, (xEvent *) &se);
+ }
+}
+
+/* Safe to call from any thread. */
+unsigned int
+AppleWMSelectedEvents (void)
+{
+ return eventMask;
+}
+
+
+/* general utility functions */
+
+static int
+ProcAppleWMDisableUpdate(
+ register ClientPtr client
+)
+{
+ REQUEST_SIZE_MATCH(xAppleWMDisableUpdateReq);
+
+ appleWMProcs->DisableUpdate();
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMReenableUpdate(
+ register ClientPtr client
+)
+{
+ REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq);
+
+ appleWMProcs->EnableUpdate();
+
+ return (client->noClientException);
+}
+
+
+/* window functions */
+
+static int
+ProcAppleWMSetWindowMenu(
+ register ClientPtr client
+)
+{
+ const char *bytes, **items;
+ char *shortcuts;
+ int max_len, nitems, i, j;
+ REQUEST(xAppleWMSetWindowMenuReq);
+
+ REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq);
+
+ nitems = stuff->nitems;
+ items = xalloc (sizeof (char *) * nitems);
+ shortcuts = xalloc (sizeof (char) * nitems);
+
+ max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
+ bytes = (char *) &stuff[1];
+
+ for (i = j = 0; i < max_len && j < nitems;)
+ {
+ shortcuts[j] = bytes[i++];
+ items[j++] = bytes + i;
+
+ while (i < max_len)
+ {
+ if (bytes[i++] == 0)
+ break;
+ }
+ }
+
+ QuartzSetWindowMenu (nitems, items, shortcuts);
+
+ free(items);
+ free(shortcuts);
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetWindowMenuCheck(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleWMSetWindowMenuCheckReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
+
+ QuartzMessageMainThread(kQuartzSetWindowMenuCheck, &stuff->index,
+ sizeof(stuff->index));
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetFrontProcess(
+ register ClientPtr client
+)
+{
+ REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
+
+ QuartzMessageMainThread(kQuartzSetFrontProcess, NULL, 0);
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetWindowLevel(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleWMSetWindowLevelReq);
+ WindowPtr pWin;
+ int errno;
+
+ REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
+
+ if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
+ client, SecurityReadAccess)))
+ {
+ return BadValue;
+ }
+
+ if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) {
+ return BadValue;
+ }
+
+ errno = appleWMProcs->SetWindowLevel(pWin, stuff->level);
+ if (errno != Success) {
+ return errno;
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetCanQuit(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleWMSetCanQuitReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
+
+ QuartzMessageMainThread(kQuartzSetCanQuit, &stuff->state,
+ sizeof(stuff->state));
+
+ return (client->noClientException);
+}
+
+
+/* frame functions */
+
+static int
+ProcAppleWMFrameGetRect(
+ register ClientPtr client
+)
+{
+ xAppleWMFrameGetRectReply rep;
+ BoxRec ir, or, rr;
+ REQUEST(xAppleWMFrameGetRectReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMFrameGetRectReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+ or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
+
+ if (appleWMProcs->FrameGetRect(stuff->frame_rect,
+ stuff->frame_class,
+ &or, &ir, &rr) != Success)
+ {
+ return BadValue;
+ }
+
+ rep.x = rr.x1;
+ rep.y = rr.y1;
+ rep.w = rr.x2 - rr.x1;
+ rep.h = rr.y2 - rr.y1;
+
+ WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMFrameHitTest(
+ register ClientPtr client
+)
+{
+ xAppleWMFrameHitTestReply rep;
+ BoxRec ir, or;
+ int ret;
+ REQUEST(xAppleWMFrameHitTestReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMFrameHitTestReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+ or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
+
+ if (appleWMProcs->FrameHitTest(stuff->frame_class, stuff->px,
+ stuff->py, &or, &ir, &ret) != Success)
+ {
+ return BadValue;
+ }
+
+ rep.ret = ret;
+
+ WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMFrameDraw(
+ register ClientPtr client
+)
+{
+ BoxRec ir, or;
+ unsigned int title_length, title_max;
+ unsigned char *title_bytes;
+ REQUEST(xAppleWMFrameDrawReq);
+ WindowPtr pWin;
+
+ REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq);
+
+ if (!(pWin = SecurityLookupWindow((Drawable)stuff->window,
+ client, SecurityReadAccess)))
+ {
+ return BadValue;
+ }
+
+ ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+ or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
+
+ title_length = stuff->title_length;
+ title_max = (stuff->length << 2) - sizeof(xAppleWMFrameDrawReq);
+
+ if (title_max < title_length)
+ return BadValue;
+
+ title_bytes = (unsigned char *) &stuff[1];
+
+ errno = appleWMProcs->FrameDraw(pWin, stuff->frame_class,
+ stuff->frame_attr, &or, &ir,
+ title_length, title_bytes);
+ if (errno != Success) {
+ return errno;
+ }
+
+ return (client->noClientException);
+}
+
+
+/* dispatch */
+
+static int
+ProcAppleWMDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_AppleWMQueryVersion:
+ return ProcAppleWMQueryVersion(client);
+ }
+
+ if (!LocalClient(client))
+ return WMErrorBase + AppleWMClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_AppleWMSelectInput:
+ return ProcAppleWMSelectInput(client);
+ case X_AppleWMDisableUpdate:
+ return ProcAppleWMDisableUpdate(client);
+ case X_AppleWMReenableUpdate:
+ return ProcAppleWMReenableUpdate(client);
+ case X_AppleWMSetWindowMenu:
+ return ProcAppleWMSetWindowMenu(client);
+ case X_AppleWMSetWindowMenuCheck:
+ return ProcAppleWMSetWindowMenuCheck(client);
+ case X_AppleWMSetFrontProcess:
+ return ProcAppleWMSetFrontProcess(client);
+ case X_AppleWMSetWindowLevel:
+ return ProcAppleWMSetWindowLevel(client);
+ case X_AppleWMSetCanQuit:
+ return ProcAppleWMSetCanQuit(client);
+ case X_AppleWMFrameGetRect:
+ return ProcAppleWMFrameGetRect(client);
+ case X_AppleWMFrameHitTest:
+ return ProcAppleWMFrameHitTest(client);
+ case X_AppleWMFrameDraw:
+ return ProcAppleWMFrameDraw(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static void
+SNotifyEvent(from, to)
+ xAppleWMNotifyEvent *from, *to;
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->time, to->time);
+ cpswapl (from->arg, to->arg);
+}
+
+static int
+SProcAppleWMQueryVersion(
+ register ClientPtr client
+)
+{
+ register int n;
+ REQUEST(xAppleWMQueryVersionReq);
+ swaps(&stuff->length, n);
+ return ProcAppleWMQueryVersion(client);
+}
+
+static int
+SProcAppleWMDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return WMErrorBase + AppleWMClientNotLocal;
+
+ /* only local clients are allowed WM access */
+ switch (stuff->data)
+ {
+ case X_AppleWMQueryVersion:
+ return SProcAppleWMQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
diff --git a/hw/darwin/quartz/applewmExt.h b/hw/darwin/quartz/applewmExt.h
new file mode 100644
index 000000000..650173941
--- /dev/null
+++ b/hw/darwin/quartz/applewmExt.h
@@ -0,0 +1,83 @@
+/*
+ * External interface for the server's AppleWM support
+ */
+/**************************************************************************
+
+Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+Copyright (c) 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, 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/hw/darwin/quartz/applewmExt.h,v 1.3 2003/11/17 22:20:35 dawes Exp $ */
+
+#ifndef _APPLEWMEXT_H_
+#define _APPLEWMEXT_H_
+
+#include "window.h"
+
+typedef int (*DisableUpdateProc)(void);
+typedef int (*EnableUpdateProc)(void);
+typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level);
+typedef int (*FrameGetRectProc)(int type, int class, const BoxRec *outer,
+ const BoxRec *inner, BoxRec *ret);
+typedef int (*FrameHitTestProc)(int class, int x, int y,
+ const BoxRec *outer,
+ const BoxRec *inner, int *ret);
+typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr,
+ const BoxRec *outer, const BoxRec *inner,
+ unsigned int title_len,
+ const unsigned char *title_bytes);
+
+/*
+ * AppleWM implementation function list
+ */
+typedef struct _AppleWMProcs {
+ DisableUpdateProc DisableUpdate;
+ EnableUpdateProc EnableUpdate;
+ SetWindowLevelProc SetWindowLevel;
+ FrameGetRectProc FrameGetRect;
+ FrameHitTestProc FrameHitTest;
+ FrameDrawProc FrameDraw;
+} AppleWMProcsRec, *AppleWMProcsPtr;
+
+extern AppleWMProcsPtr appleWMProcs;
+
+void AppleWMExtensionInit(
+ AppleWMProcsPtr procsPtr
+);
+
+void AppleWMSetScreenOrigin(
+ WindowPtr pWin
+);
+
+void AppleWMSendEvent(
+ int /* type */,
+ unsigned int /* mask */,
+ int /* which */,
+ int /* arg */
+);
+
+unsigned int AppleWMSelectedEvents(
+ void
+);
+
+#endif /* _APPLEWMEXT_H_ */
diff --git a/hw/darwin/quartz/cr/XView.h b/hw/darwin/quartz/cr/XView.h
new file mode 100644
index 000000000..666061dc1
--- /dev/null
+++ b/hw/darwin/quartz/cr/XView.h
@@ -0,0 +1,42 @@
+/*
+ * NSView subclass for Mac OS X rootless X server
+ *
+ * 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/cr/XView.h,v 1.1 2003/06/07 05:49:07 torrey Exp $ */
+
+#import <Cocoa/Cocoa.h>
+
+@interface XView : NSQuickDrawView
+
+- (BOOL)isFlipped;
+- (BOOL)isOpaque;
+- (BOOL)acceptsFirstResponder;
+- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
+- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
+
+- (void)mouseDown:(NSEvent *)anEvent;
+
+@end
diff --git a/hw/darwin/quartz/cr/XView.m b/hw/darwin/quartz/cr/XView.m
new file mode 100644
index 000000000..2bf689ede
--- /dev/null
+++ b/hw/darwin/quartz/cr/XView.m
@@ -0,0 +1,74 @@
+/*
+ * NSView subclass for Mac OS X rootless X server
+ *
+ * Each rootless window contains an instance of this class.
+ * This class handles events while drawing is handled by Carbon
+ * code in the rootless Aqua implementation.
+ *
+ * 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/cr/XView.m,v 1.2 2003/10/16 23:50:16 torrey Exp $ */
+
+#import "XView.h"
+
+
+@implementation XView
+
+- (BOOL)isFlipped
+{
+ return NO;
+}
+
+- (BOOL)isOpaque
+{
+ return YES;
+}
+
+- (BOOL)acceptsFirstResponder
+{
+ return YES;
+}
+
+- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
+{
+ return YES;
+}
+
+- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent
+{
+ return YES;
+}
+
+- (void)mouseDown:(NSEvent *)anEvent
+{
+ // Only X is allowed to restack windows.
+ [NSApp preventWindowOrdering];
+ if (! [NSApp isActive]) {
+ [NSApp activateIgnoringOtherApps:YES];
+ }
+ [[self nextResponder] mouseDown:anEvent];
+}
+
+@end
diff --git a/hw/darwin/quartz/cr/cr.h b/hw/darwin/quartz/cr/cr.h
new file mode 100644
index 000000000..74752f768
--- /dev/null
+++ b/hw/darwin/quartz/cr/cr.h
@@ -0,0 +1,62 @@
+/*
+ * Internal definitions of the Cocoa rootless implementation
+ */
+/*
+ * Copyright (c) 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/cr/cr.h,v 1.3 2003/11/03 05:36:31 tsi Exp $ */
+
+#ifndef _CR_H
+#define _CR_H
+
+#ifdef __OBJC__
+#import <Cocoa/Cocoa.h>
+#import "XView.h"
+#else
+typedef struct OpaqueNSWindow NSWindow;
+typedef struct OpaqueXView XView;
+#endif
+
+#undef BOOL
+#define BOOL xBOOL
+#include "screenint.h"
+#include "window.h"
+#undef BOOL
+
+// Predefined style for the window which is about to be framed
+extern WindowPtr nextWindowToFrame;
+extern unsigned int nextWindowStyle;
+
+typedef struct {
+ NSWindow *window;
+ XView *view;
+ GrafPtr port;
+ CGContextRef context;
+} CRWindowRec, *CRWindowPtr;
+
+Bool CRInit(ScreenPtr pScreen);
+void CRAppleWMInit(void);
+
+#endif /* _CR_H */
diff --git a/hw/darwin/quartz/cr/crAppleWM.m b/hw/darwin/quartz/cr/crAppleWM.m
new file mode 100644
index 000000000..66e832b66
--- /dev/null
+++ b/hw/darwin/quartz/cr/crAppleWM.m
@@ -0,0 +1,157 @@
+/*
+ * Cocoa rootless implementation functions for AppleWM extension
+ */
+/*
+ * Copyright (c) 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/cr/crAppleWM.m,v 1.1 2003/09/16 00:36:14 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "cr.h"
+
+#undef BOOL
+#define BOOL xBOOL
+#include "rootless.h"
+#include "X.h"
+#define _APPLEWM_SERVER_
+#include "applewm.h"
+#include "applewmExt.h"
+#undef BOOL
+
+#define StdDocumentStyleMask (NSTitledWindowMask | \
+ NSClosableWindowMask | \
+ NSMiniaturizableWindowMask | \
+ NSResizableWindowMask)
+
+static int
+CRDisableUpdate(void)
+{
+ return Success;
+}
+
+
+static int
+CREnableUpdate(void)
+{
+ return Success;
+}
+
+
+static int CRSetWindowLevel(
+ WindowPtr pWin,
+ int level)
+{
+ CRWindowPtr crWinPtr;
+
+ crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE);
+ if (crWinPtr == 0)
+ return BadWindow;
+
+ RootlessStopDrawing(pWin, FALSE);
+
+ [crWinPtr->window setLevel:level];
+
+ return Success;
+}
+
+
+static int CRFrameGetRect(
+ int type,
+ int class,
+ const BoxRec *outer,
+ const BoxRec *inner,
+ BoxRec *ret)
+{
+ return Success;
+}
+
+
+static int CRFrameHitTest(
+ int class,
+ int x,
+ int y,
+ const BoxRec *outer,
+ const BoxRec *inner,
+ int *ret)
+{
+ return 0;
+}
+
+
+static int CRFrameDraw(
+ WindowPtr pWin,
+ int class,
+ unsigned int attr,
+ const BoxRec *outer,
+ const BoxRec *inner,
+ unsigned int title_len,
+ const unsigned char *title_bytes)
+{
+ CRWindowPtr crWinPtr;
+ NSWindow *window;
+ Bool hasResizeIndicator;
+
+ /* We assume the window has not yet been framed so
+ RootlessFrameForWindow() will cause it to be. Record the window
+ style so that the appropriate one will be used when it is framed.
+ If the window is already framed, we can't change the window
+ style and the following will have no effect. */
+
+ nextWindowToFrame = pWin;
+ if (class == AppleWMFrameClassDocument)
+ nextWindowStyle = StdDocumentStyleMask;
+ else
+ nextWindowStyle = NSBorderlessWindowMask;
+
+ crWinPtr = (CRWindowPtr) RootlessFrameForWindow(pWin, TRUE);
+ if (crWinPtr == 0)
+ return BadWindow;
+
+ window = crWinPtr->window;
+
+ [window setTitle:[NSString stringWithCString:title_bytes
+ length:title_len]];
+
+ hasResizeIndicator = (attr & AppleWMFrameGrowBox) ? YES : NO;
+ [window setShowsResizeIndicator:hasResizeIndicator];
+
+ return Success;
+}
+
+
+static AppleWMProcsRec crAppleWMProcs = {
+ CRDisableUpdate,
+ CREnableUpdate,
+ CRSetWindowLevel,
+ CRFrameGetRect,
+ CRFrameHitTest,
+ CRFrameDraw
+};
+
+
+void CRAppleWMInit(void)
+{
+ AppleWMExtensionInit(&crAppleWMProcs);
+}
diff --git a/hw/darwin/quartz/cr/crFrame.m b/hw/darwin/quartz/cr/crFrame.m
new file mode 100644
index 000000000..e3e83ebc4
--- /dev/null
+++ b/hw/darwin/quartz/cr/crFrame.m
@@ -0,0 +1,403 @@
+/*
+ * Cocoa rootless implementation frame functions
+ */
+/*
+ * Copyright (c) 2001 Greg Parker. 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/cr/crFrame.m,v 1.5 2003/11/13 20:26:31 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "cr.h"
+
+#undef BOOL
+#define BOOL xBOOL
+#include "rootless.h"
+#undef BOOL
+
+WindowPtr nextWindowToFrame = NULL;
+unsigned int nextWindowStyle = 0;
+
+static void CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape);
+
+
+/*
+ * CRCreateFrame
+ * Create a new physical window.
+ * Rootless windows must not autodisplay! Autodisplay can cause a deadlock.
+ * Event thread - autodisplay: locks view hierarchy, then window
+ * X Server thread - window resize: locks window, then view hierarchy
+ * Deadlock occurs if each thread gets one lock and waits for the other.
+ */
+static Bool
+CRCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
+ int newX, int newY, RegionPtr pShape)
+{
+ CRWindowPtr crWinPtr;
+ NSRect bounds;
+ NSWindow *theWindow;
+ XView *theView;
+ unsigned int theStyleMask = NSBorderlessWindowMask;
+
+ crWinPtr = (CRWindowPtr) xalloc(sizeof(CRWindowRec));
+
+ bounds = NSMakeRect(newX,
+ NSHeight([[NSScreen mainScreen] frame]) -
+ newY - pFrame->height,
+ pFrame->width, pFrame->height);
+
+ // Check if AppleWM has specified a style for this window
+ if (pFrame->win == nextWindowToFrame) {
+ theStyleMask = nextWindowStyle;
+ }
+ nextWindowToFrame = NULL;
+
+ // Create an NSWindow for the new X11 window
+ theWindow = [[NSWindow alloc] initWithContentRect:bounds
+ styleMask:theStyleMask
+ backing:NSBackingStoreBuffered
+ defer:NO];
+ if (!theWindow) return FALSE;
+
+ [theWindow setBackgroundColor:[NSColor clearColor]]; // erase transparent
+ [theWindow setAlphaValue:1.0]; // draw opaque
+ [theWindow setOpaque:YES]; // changed when window is shaped
+
+ [theWindow useOptimizedDrawing:YES]; // Has no overlapping sub-views
+ [theWindow setAutodisplay:NO]; // See comment above
+ [theWindow disableFlushWindow]; // We do all the flushing manually
+ [theWindow setHasShadow:YES]; // All windows have shadows
+ [theWindow setReleasedWhenClosed:YES]; // Default, but we want to be sure
+
+ theView = [[XView alloc] initWithFrame:bounds];
+ [theWindow setContentView:theView];
+ [theWindow setInitialFirstResponder:theView];
+
+ [theWindow setAcceptsMouseMovedEvents:YES];
+
+ crWinPtr->window = theWindow;
+ crWinPtr->view = theView;
+
+ [theView lockFocus];
+ // Fill the window with white to make sure alpha channel is set
+ NSEraseRect(bounds);
+ crWinPtr->port = [theView qdPort];
+ crWinPtr->context = [[NSGraphicsContext currentContext] graphicsPort];
+ // CreateCGContextForPort(crWinPtr->port, &crWinPtr->context);
+ [theView unlockFocus];
+
+ // Store the implementation private frame ID
+ pFrame->wid = (RootlessFrameID) crWinPtr;
+
+ // Reshape the frame if it was created shaped.
+ if (pShape != NULL)
+ CRReshapeFrame(pFrame->wid, pShape);
+
+ return TRUE;
+}
+
+
+/*
+ * CRDestroyFrame
+ * Destroy a frame.
+ */
+static void
+CRDestroyFrame(RootlessFrameID wid)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+
+ [crWinPtr->window orderOut:nil];
+ [crWinPtr->window close];
+ [crWinPtr->view release];
+ free(crWinPtr);
+}
+
+
+/*
+ * CRMoveFrame
+ * Move a frame on screen.
+ */
+static void
+CRMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+ NSPoint topLeft;
+
+ topLeft = NSMakePoint(newX,
+ NSHeight([[NSScreen mainScreen] frame]) - newY);
+
+ [crWinPtr->window setFrameTopLeftPoint:topLeft];
+}
+
+
+/*
+ * CRResizeFrame
+ * Move and resize a frame.
+ */
+static void
+CRResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
+ int newX, int newY, unsigned int newW, unsigned int newH,
+ unsigned int gravity)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+ NSRect bounds = NSMakeRect(newX, NSHeight([[NSScreen mainScreen] frame]) -
+ newY - newH, newW, newH);
+
+ [crWinPtr->window setFrame:bounds display:NO];
+}
+
+
+/*
+ * CRRestackFrame
+ * Change the frame order. Put the frame behind nextWid or on top if
+ * it is NULL. Unmapped frames are mapped by restacking them.
+ */
+static void
+CRRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+ CRWindowPtr crNextWinPtr = (CRWindowPtr) nextWid;
+
+ if (crNextWinPtr) {
+ int upperNum = [crNextWinPtr->window windowNumber];
+
+ [crWinPtr->window orderWindow:NSWindowBelow relativeTo:upperNum];
+ } else {
+ [crWinPtr->window makeKeyAndOrderFront:nil];
+ }
+}
+
+
+/*
+ * CRReshapeFrame
+ * Set the shape of a frame.
+ */
+static void
+CRReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+ NSRect bounds = [crWinPtr->view frame];
+ int winHeight = NSHeight(bounds);
+ BoxRec localBox = {0, 0, NSWidth(bounds), winHeight};
+
+ [crWinPtr->view lockFocus];
+
+ if (pShape != NULL) {
+ // Calculate the region outside the new shape.
+ REGION_INVERSE(NULL, pShape, pShape, &localBox);
+ }
+
+ // If window is currently shaped we need to undo the previous shape.
+ if (![crWinPtr->window isOpaque]) {
+ [[NSColor whiteColor] set];
+ NSRectFillUsingOperation(bounds, NSCompositeDestinationAtop);
+ }
+
+ if (pShape != NULL) {
+ int count = REGION_NUM_RECTS(pShape);
+ BoxRec *extRects = REGION_RECTS(pShape);
+ BoxRec *rects, *end;
+
+ // Make transparent if window is now shaped.
+ [crWinPtr->window setOpaque:NO];
+
+ // Clear the areas outside the window shape
+ [[NSColor clearColor] set];
+ for (rects = extRects, end = extRects+count; rects < end; rects++) {
+ int rectHeight = rects->y2 - rects->y1;
+ NSRectFill( NSMakeRect(rects->x1,
+ winHeight - rects->y1 - rectHeight,
+ rects->x2 - rects->x1, rectHeight) );
+ }
+ [[NSGraphicsContext currentContext] flushGraphics];
+
+ // force update of window shadow
+ [crWinPtr->window setHasShadow:NO];
+ [crWinPtr->window setHasShadow:YES];
+
+ } else {
+ [crWinPtr->window setOpaque:YES];
+ [[NSGraphicsContext currentContext] flushGraphics];
+ }
+
+ [crWinPtr->view unlockFocus];
+}
+
+
+/*
+ * CRUnmapFrame
+ * Unmap a frame.
+ */
+static void
+CRUnmapFrame(RootlessFrameID wid)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+
+ [crWinPtr->window orderOut:nil];
+}
+
+
+/*
+ * CRStartDrawing
+ * When a window's buffer is not being drawn to, the CoreGraphics
+ * window server may compress or move it. Call this routine
+ * to lock down the buffer during direct drawing. It returns
+ * a pointer to the backing buffer.
+ */
+static void
+CRStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+ PixMapHandle pix;
+
+ [crWinPtr->view lockFocus];
+ crWinPtr->port = [crWinPtr->view qdPort];
+ LockPortBits(crWinPtr->port);
+ [crWinPtr->view unlockFocus];
+ pix = GetPortPixMap(crWinPtr->port);
+
+ *pixelData = GetPixBaseAddr(pix);
+ *bytesPerRow = GetPixRowBytes(pix) & 0x3fff; // fixme is mask needed?
+}
+
+
+/*
+ * CRStopDrawing
+ * When direct access to a window's buffer is no longer needed, this
+ * routine should be called to allow CoreGraphics to compress or
+ * move it.
+ */
+static void
+CRStopDrawing(RootlessFrameID wid, Bool flush)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+
+ UnlockPortBits(crWinPtr->port);
+
+ if (flush) {
+ QDFlushPortBuffer(crWinPtr->port, NULL);
+ }
+}
+
+
+/*
+ * CRUpdateRegion
+ * Flush a region from a window's backing buffer to the screen.
+ */
+static void
+CRUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+
+#ifdef ROOTLESS_TRACK_DAMAGE
+ int count = REGION_NUM_RECTS(pDamage);
+ BoxRec *rects = REGION_RECTS(pDamage);
+ BoxRec *end;
+
+ static RgnHandle rgn = NULL;
+ static RgnHandle box = NULL;
+
+ if (!rgn) rgn = NewRgn();
+ if (!box) box = NewRgn();
+
+ for (end = rects+count; rects < end; rects++) {
+ Rect qdRect;
+ qdRect.left = rects->x1;
+ qdRect.top = rects->y1;
+ qdRect.right = rects->x2;
+ qdRect.bottom = rects->y2;
+
+ RectRgn(box, &qdRect);
+ UnionRgn(rgn, box, rgn);
+ }
+
+ QDFlushPortBuffer(crWinPtr->port, rgn);
+
+ SetEmptyRgn(rgn);
+ SetEmptyRgn(box);
+
+#else /* !ROOTLESS_TRACK_DAMAGE */
+ QDFlushPortBuffer(crWinPtr->port, NULL);
+#endif
+}
+
+
+/*
+ * CRDamageRects
+ * Mark damaged rectangles as requiring redisplay to screen.
+ */
+static void
+CRDamageRects(RootlessFrameID wid, int count, const BoxRec *rects,
+ int shift_x, int shift_y)
+{
+ CRWindowPtr crWinPtr = (CRWindowPtr) wid;
+ const BoxRec *end;
+
+ for (end = rects + count; rects < end; rects++) {
+ Rect qdRect;
+ qdRect.left = rects->x1 + shift_x;
+ qdRect.top = rects->y1 + shift_y;
+ qdRect.right = rects->x2 + shift_x;
+ qdRect.bottom = rects->y2 + shift_y;
+
+ QDAddRectToDirtyRegion(crWinPtr->port, &qdRect);
+ }
+}
+
+
+static RootlessFrameProcsRec CRRootlessProcs = {
+ CRCreateFrame,
+ CRDestroyFrame,
+ CRMoveFrame,
+ CRResizeFrame,
+ CRRestackFrame,
+ CRReshapeFrame,
+ CRUnmapFrame,
+ CRStartDrawing,
+ CRStopDrawing,
+ CRUpdateRegion,
+ CRDamageRects,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+
+/*
+ * Initialize CR implementation
+ */
+Bool
+CRInit(ScreenPtr pScreen)
+{
+ RootlessInit(pScreen, &CRRootlessProcs);
+
+ rootless_CopyBytes_threshold = 0;
+ rootless_FillBytes_threshold = 0;
+ rootless_CompositePixels_threshold = 0;
+ rootless_CopyWindow_threshold = 0;
+
+ return TRUE;
+}
diff --git a/hw/darwin/quartz/cr/crScreen.m b/hw/darwin/quartz/cr/crScreen.m
new file mode 100644
index 000000000..d259d0bac
--- /dev/null
+++ b/hw/darwin/quartz/cr/crScreen.m
@@ -0,0 +1,321 @@
+/*
+ * Cocoa rootless implementation initialization
+ */
+/*
+ * Copyright (c) 2001 Greg Parker. 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/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "cr.h"
+
+#undef BOOL
+#define BOOL xBOOL
+#include "darwin.h"
+#include "quartz.h"
+#include "quartzCursor.h"
+#include "rootless.h"
+#include "safeAlpha.h"
+#include "pseudoramiX.h"
+#include "applewmExt.h"
+
+#include "regionstr.h"
+#include "scrnintstr.h"
+#include "picturestr.h"
+#include "globals.h"
+#undef BOOL
+
+// Name of GLX bundle using AGL framework
+static const char *crOpenGLBundle = "glxAGL.bundle";
+
+static Class classXView = nil;
+
+
+/*
+ * CRDisplayInit
+ * Find all screens.
+ *
+ * Multihead note: When rootless mode uses PseudoramiX, the
+ * X server only sees one screen; only PseudoramiX itself knows
+ * about all of the screens.
+ */
+static void
+CRDisplayInit(void)
+{
+ ErrorF("Display mode: Rootless Quartz -- Cocoa implementation\n");
+
+ if (noPseudoramiXExtension) {
+ darwinScreensFound = [[NSScreen screens] count];
+ } else {
+ darwinScreensFound = 1; // only PseudoramiX knows about the rest
+ }
+
+ CRAppleWMInit();
+}
+
+
+/*
+ * CRScreenParams
+ * Set the basic screen parameters.
+ */
+static void
+CRScreenParams(int index, DarwinFramebufferPtr dfb)
+{
+ dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
+ dfb->colorBitsPerPixel = 3 * dfb->bitsPerComponent;
+
+ if (noPseudoramiXExtension) {
+ NSScreen *screen = [[NSScreen screens] objectAtIndex:index];
+ NSRect frame = [screen frame];
+
+ // set x, y so (0,0) is top left of main screen
+ dfb->x = NSMinX(frame);
+ dfb->y = NSHeight([[NSScreen mainScreen] frame]) -
+ NSHeight(frame) - NSMinY(frame);
+
+ dfb->width = NSWidth(frame);
+ dfb->height = NSHeight(frame);
+ dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8;
+
+ // Shift the usable part of main screen down to avoid the menu bar.
+ if (NSEqualRects(frame, [[NSScreen mainScreen] frame])) {
+ dfb->y += aquaMenuBarHeight;
+ dfb->height -= aquaMenuBarHeight;
+ }
+
+ } else {
+ int i;
+ NSRect unionRect = NSMakeRect(0, 0, 0, 0);
+ NSArray *screens = [NSScreen screens];
+
+ // Get the union of all screens (minus the menu bar on main screen)
+ for (i = 0; i < [screens count]; i++) {
+ NSScreen *screen = [screens objectAtIndex:i];
+ NSRect frame = [screen frame];
+ frame.origin.y = [[NSScreen mainScreen] frame].size.height -
+ frame.size.height - frame.origin.y;
+ if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
+ frame.origin.y += aquaMenuBarHeight;
+ frame.size.height -= aquaMenuBarHeight;
+ }
+ unionRect = NSUnionRect(unionRect, frame);
+ }
+
+ // Use unionRect as the screen size for the X server.
+ dfb->x = unionRect.origin.x;
+ dfb->y = unionRect.origin.y;
+ dfb->width = unionRect.size.width;
+ dfb->height = unionRect.size.height;
+ dfb->pitch = (dfb->width) * (dfb->bitsPerPixel) / 8;
+
+ // Tell PseudoramiX about the real screens.
+ // InitOutput() will move the big screen to (0,0),
+ // so compensate for that here.
+ for (i = 0; i < [screens count]; i++) {
+ NSScreen *screen = [screens objectAtIndex:i];
+ NSRect frame = [screen frame];
+ int j;
+
+ // Skip this screen if it's a mirrored copy of an earlier screen.
+ for (j = 0; j < i; j++) {
+ if (NSEqualRects(frame, [[screens objectAtIndex:j] frame])) {
+ ErrorF("PseudoramiX screen %d is a mirror of screen %d.\n",
+ i, j);
+ break;
+ }
+ }
+ if (j < i) continue; // this screen is a mirrored copy
+
+ frame.origin.y = [[NSScreen mainScreen] frame].size.height -
+ frame.size.height - frame.origin.y;
+
+ if (NSEqualRects([screen frame], [[NSScreen mainScreen] frame])) {
+ frame.origin.y += aquaMenuBarHeight;
+ frame.size.height -= aquaMenuBarHeight;
+ }
+
+ ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y);
+
+ frame.origin.x -= unionRect.origin.x;
+ frame.origin.y -= unionRect.origin.y;
+
+ ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
+ i, (int)frame.origin.x, (int)frame.origin.y);
+
+ PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
+ frame.size.width, frame.size.height);
+ }
+ }
+}
+
+
+/*
+ * CRAddScreen
+ * Init the framebuffer and record pixmap parameters for the screen.
+ */
+static Bool
+CRAddScreen(int index, ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
+ CGRect cgRect;
+ CGDisplayCount numDisplays;
+ CGDisplayCount allocatedDisplays = 0;
+ CGDirectDisplayID *displays = NULL;
+ CGDisplayErr cgErr;
+
+ CRScreenParams(index, dfb);
+
+ dfb->colorType = TrueColor;
+
+ // No frame buffer - it's all in window pixmaps.
+ dfb->framebuffer = NULL; // malloc(dfb.pitch * dfb.height);
+
+ // Get all CoreGraphics displays covered by this X11 display.
+ cgRect = CGRectMake(dfb->x, dfb->y, dfb->width, dfb->height);
+ do {
+ cgErr = CGGetDisplaysWithRect(cgRect, 0, NULL, &numDisplays);
+ if (cgErr) break;
+ allocatedDisplays = numDisplays;
+ displays = xrealloc(displays,
+ numDisplays * sizeof(CGDirectDisplayID));
+ cgErr = CGGetDisplaysWithRect(cgRect, allocatedDisplays, displays,
+ &numDisplays);
+ if (cgErr != CGDisplayNoErr) break;
+ } while (numDisplays > allocatedDisplays);
+
+ if (cgErr != CGDisplayNoErr || numDisplays == 0) {
+ ErrorF("Could not find CGDirectDisplayID(s) for X11 screen %d: %dx%d @ %d,%d.\n",
+ index, dfb->width, dfb->height, dfb->x, dfb->y);
+ return FALSE;
+ }
+
+ // This X11 screen covers all CoreGraphics displays we just found.
+ // If there's more than one CG display, then video mirroring is on
+ // or PseudoramiX is on.
+ displayInfo->displayCount = allocatedDisplays;
+ displayInfo->displayIDs = displays;
+
+ return TRUE;
+}
+
+
+/*
+ * CRSetupScreen
+ * Setup the screen for rootless access.
+ */
+static Bool
+CRSetupScreen(int index, ScreenPtr pScreen)
+{
+ // Add alpha protecting replacements for fb screen functions
+ pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
+ pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
+
+#ifdef RENDER
+ {
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ ps->Composite = SafeAlphaComposite;
+ }
+#endif /* RENDER */
+
+ // Initialize generic rootless code
+ return CRInit(pScreen);
+}
+
+
+/*
+ * CRInitInput
+ * Finalize CR specific setup.
+ */
+static void
+CRInitInput(int argc, char **argv)
+{
+ int i;
+
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ AppleWMSetScreenOrigin(WindowTable[i]);
+}
+
+
+/*
+ * CRIsX11Window
+ * Returns TRUE if cr is displaying this window.
+ */
+static Bool
+CRIsX11Window(void *nsWindow, int windowNumber)
+{
+ NSWindow *theWindow = nsWindow;
+
+ if (!theWindow)
+ return FALSE;
+
+ if ([[theWindow contentView] isKindOfClass:classXView])
+ return TRUE;
+ else
+ return FALSE;
+}
+
+
+/*
+ * Quartz display mode function list.
+ */
+static QuartzModeProcsRec crModeProcs = {
+ CRDisplayInit,
+ CRAddScreen,
+ CRSetupScreen,
+ CRInitInput,
+ QuartzInitCursor,
+ QuartzReallySetCursor,
+ QuartzSuspendXCursor,
+ QuartzResumeXCursor,
+ NULL, // No capture or release in rootless mode
+ NULL,
+ CRIsX11Window,
+ RootlessFrameForWindow,
+ TopLevelParent,
+ NULL, // No support for DRI surfaces
+ NULL
+};
+
+
+/*
+ * QuartzModeBundleInit
+ * Initialize the display mode bundle after loading.
+ */
+Bool
+QuartzModeBundleInit(void)
+{
+ quartzProcs = &crModeProcs;
+ quartzOpenGLBundle = crOpenGLBundle;
+ classXView = [XView class];
+ return TRUE;
+}
diff --git a/hw/darwin/quartz/fullscreen/fullscreen.c b/hw/darwin/quartz/fullscreen/fullscreen.c
new file mode 100644
index 000000000..fc390e87f
--- /dev/null
+++ b/hw/darwin/quartz/fullscreen/fullscreen.c
@@ -0,0 +1,567 @@
+/*
+ * Screen routines for full screen Quartz mode
+ *
+ * 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
+ * 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(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/fullscreen/fullscreen.c,v 1.2 2003/11/12 20:21:52 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "darwin.h"
+#include "quartz.h"
+#include "quartzCursor.h"
+#include "colormapst.h"
+#include "scrnintstr.h"
+#include "micmap.h"
+#include "shadow.h"
+
+// Full screen specific per screen storage structure
+typedef struct {
+ CGDirectDisplayID displayID;
+ CFDictionaryRef xDisplayMode;
+ CFDictionaryRef aquaDisplayMode;
+ CGDirectPaletteRef xPalette;
+ CGDirectPaletteRef aquaPalette;
+ unsigned char *framebuffer;
+ unsigned char *shadowPtr;
+} FSScreenRec, *FSScreenPtr;
+
+#define FULLSCREEN_PRIV(pScreen) \
+ ((FSScreenPtr)pScreen->devPrivates[fsScreenIndex].ptr)
+
+static int fsScreenIndex;
+static CGDirectDisplayID *quartzDisplayList = NULL;
+static int quartzNumScreens = 0;
+static FSScreenPtr quartzScreens[MAXSCREENS];
+
+static int darwinCmapPrivateIndex = -1;
+static unsigned long darwinCmapGeneration = 0;
+
+#define CMAP_PRIV(pCmap) \
+ ((CGDirectPaletteRef) (pCmap)->devPrivates[darwinCmapPrivateIndex].ptr)
+
+/*
+ =============================================================================
+
+ Colormap handling
+
+ =============================================================================
+*/
+
+/*
+ * FSInitCmapPrivates
+ * 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.
+ */
+static Bool
+FSInitCmapPrivates(
+ ColormapPtr pCmap)
+{
+ return TRUE;
+}
+
+
+/*
+ * FSCreateColormap
+ * This is a callback from X after a new colormap is created.
+ * We allocate a new CoreGraphics pallete for each colormap.
+ */
+static Bool
+FSCreateColormap(
+ ColormapPtr pCmap)
+{
+ CGDirectPaletteRef pallete;
+
+ // Allocate private storage for the hardware dependent colormap info.
+ if (darwinCmapGeneration != serverGeneration) {
+ if ((darwinCmapPrivateIndex =
+ AllocateColormapPrivateIndex(FSInitCmapPrivates)) < 0)
+ {
+ return FALSE;
+ }
+ darwinCmapGeneration = serverGeneration;
+ }
+
+ pallete = CGPaletteCreateDefaultColorPalette();
+ if (!pallete) return FALSE;
+
+ CMAP_PRIV(pCmap) = pallete;
+ return TRUE;
+}
+
+
+/*
+ * FSDestroyColormap
+ * This is called by DIX FreeColormap after it has uninstalled a colormap
+ * and notified all interested parties. We deallocated the corresponding
+ * CoreGraphics pallete.
+ */
+static void
+FSDestroyColormap(
+ ColormapPtr pCmap)
+{
+ CGPaletteRelease( CMAP_PRIV(pCmap) );
+}
+
+
+/*
+ * FSInstallColormap
+ * Set the current CoreGraphics pallete to the pallete corresponding
+ * to the provided colormap.
+ */
+static void
+FSInstallColormap(
+ ColormapPtr pCmap)
+{
+ CGDirectPaletteRef palette = CMAP_PRIV(pCmap);
+ ScreenPtr pScreen = pCmap->pScreen;
+ FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
+
+ // Inform all interested parties that the map is being changed.
+ miInstallColormap(pCmap);
+
+ if (quartzServerVisible)
+ CGDisplaySetPalette(fsDisplayInfo->displayID, palette);
+
+ fsDisplayInfo->xPalette = palette;
+}
+
+
+/*
+ * FSStoreColors
+ * This is a callback from X to change the hardware colormap
+ * when using PsuedoColor in full screen mode.
+ */
+static void
+FSStoreColors(
+ ColormapPtr pCmap,
+ int numEntries,
+ xColorItem *pdefs)
+{
+ CGDirectPaletteRef palette = CMAP_PRIV(pCmap);
+ ScreenPtr pScreen = pCmap->pScreen;
+ FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
+ CGDeviceColor color;
+ int i;
+
+ if (! palette)
+ return;
+
+ for (i = 0; i < numEntries; i++) {
+ color.red = pdefs[i].red / 65535.0;
+ color.green = pdefs[i].green / 65535.0;
+ color.blue = pdefs[i].blue / 65535.0;
+ CGPaletteSetColorAtIndex(palette, color, pdefs[i].pixel);
+ }
+
+ // Update hardware colormap
+ if (quartzServerVisible)
+ CGDisplaySetPalette(fsDisplayInfo->displayID, palette);
+}
+
+
+/*
+ =============================================================================
+
+ Switching between Aqua and X
+
+ =============================================================================
+*/
+
+/*
+ * FSCapture
+ * Capture the screen so we can draw. Called directly from the main thread
+ * to synchronize with hiding the menubar.
+ */
+static void FSCapture(void)
+{
+ int i;
+
+ if (quartzRootless) return;
+
+ for (i = 0; i < quartzNumScreens; i++) {
+ FSScreenPtr fsDisplayInfo = quartzScreens[i];
+ CGDirectDisplayID cgID = fsDisplayInfo->displayID;
+
+ if (!CGDisplayIsCaptured(cgID)) {
+ CGDisplayCapture(cgID);
+ fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
+ if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
+ CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
+ if (fsDisplayInfo->xPalette)
+ CGDisplaySetPalette(cgID, fsDisplayInfo->xPalette);
+ }
+ }
+}
+
+
+/*
+ * FSRelease
+ * Release the screen so others can draw.
+ */
+static void FSRelease(void)
+{
+ int i;
+
+ if (quartzRootless) return;
+
+ for (i = 0; i < quartzNumScreens; i++) {
+ FSScreenPtr fsDisplayInfo = quartzScreens[i];
+ CGDirectDisplayID cgID = fsDisplayInfo->displayID;
+
+ if (CGDisplayIsCaptured(cgID)) {
+ if (fsDisplayInfo->xDisplayMode != fsDisplayInfo->aquaDisplayMode)
+ CGDisplaySwitchToMode(cgID, fsDisplayInfo->aquaDisplayMode);
+ if (fsDisplayInfo->aquaPalette)
+ CGDisplaySetPalette(cgID, fsDisplayInfo->aquaPalette);
+ CGDisplayRelease(cgID);
+ }
+ }
+}
+
+
+/*
+ * FSSuspendScreen
+ * Suspend X11 cursor and drawing to the screen.
+ */
+static void FSSuspendScreen(
+ ScreenPtr pScreen)
+{
+ QuartzSuspendXCursor(pScreen);
+ xf86SetRootClip(pScreen, FALSE);
+}
+
+
+/*
+ * FSResumeScreen
+ * Resume X11 cursor and drawing to the screen.
+ */
+static void FSResumeScreen(
+ ScreenPtr pScreen,
+ int x, // cursor location
+ int y )
+{
+ QuartzResumeXCursor(pScreen, x, y);
+ xf86SetRootClip(pScreen, TRUE);
+}
+
+
+/*
+ =============================================================================
+
+ Screen initialization
+
+ =============================================================================
+*/
+
+/*
+ * FSDisplayInit
+ * Full screen specific initialization called from InitOutput.
+ */
+static void FSDisplayInit(void)
+{
+ static unsigned long generation = 0;
+ CGDisplayCount quartzDisplayCount = 0;
+
+ ErrorF("Display mode: Full screen Quartz -- Direct Display\n");
+
+ // Allocate private storage for each screen's mode specific info
+ if (generation != serverGeneration) {
+ fsScreenIndex = AllocateScreenPrivateIndex();
+ generation = serverGeneration;
+ }
+
+ // Find all the CoreGraphics displays
+ CGGetActiveDisplayList(0, NULL, &quartzDisplayCount);
+ quartzDisplayList = xalloc(quartzDisplayCount * sizeof(CGDirectDisplayID));
+ CGGetActiveDisplayList(quartzDisplayCount, quartzDisplayList,
+ &quartzDisplayCount);
+
+ darwinScreensFound = quartzDisplayCount;
+ atexit(FSRelease);
+}
+
+
+/*
+ * FSFindDisplayMode
+ * Find the appropriate display mode to use in full screen mode.
+ * If display mode is not the same as the current Aqua mode, switch
+ * to the new mode.
+ */
+static Bool FSFindDisplayMode(
+ FSScreenPtr fsDisplayInfo)
+{
+ CGDirectDisplayID cgID = fsDisplayInfo->displayID;
+ size_t height, width, bpp;
+ boolean_t exactMatch;
+
+ fsDisplayInfo->aquaDisplayMode = CGDisplayCurrentMode(cgID);
+
+ // If no user options, use current display mode
+ if (darwinDesiredWidth == 0 && darwinDesiredDepth == -1 &&
+ darwinDesiredRefresh == -1)
+ {
+ fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
+ return TRUE;
+ }
+
+ // If the user has no choice for size, use current
+ if (darwinDesiredWidth == 0) {
+ width = CGDisplayPixelsWide(cgID);
+ height = CGDisplayPixelsHigh(cgID);
+ } else {
+ width = darwinDesiredWidth;
+ height = darwinDesiredHeight;
+ }
+
+ switch (darwinDesiredDepth) {
+ case 0:
+ bpp = 8;
+ break;
+ case 1:
+ bpp = 16;
+ break;
+ case 2:
+ bpp = 32;
+ break;
+ default:
+ bpp = CGDisplayBitsPerPixel(cgID);
+ }
+
+ if (darwinDesiredRefresh == -1) {
+ fsDisplayInfo->xDisplayMode =
+ CGDisplayBestModeForParameters(cgID, bpp, width, height,
+ &exactMatch);
+ } else {
+ fsDisplayInfo->xDisplayMode =
+ CGDisplayBestModeForParametersAndRefreshRate(cgID, bpp,
+ width, height, darwinDesiredRefresh, &exactMatch);
+ }
+ if (!exactMatch) {
+ fsDisplayInfo->xDisplayMode = fsDisplayInfo->aquaDisplayMode;
+ return FALSE;
+ }
+
+ // Switch to the new display mode
+ CGDisplaySwitchToMode(cgID, fsDisplayInfo->xDisplayMode);
+ return TRUE;
+}
+
+
+/*
+ * FSAddScreen
+ * Do initialization of each screen for Quartz in full screen mode.
+ */
+static Bool FSAddScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ QuartzScreenPtr displayInfo = QUARTZ_PRIV(pScreen);
+ CGDirectDisplayID cgID = quartzDisplayList[index];
+ CGRect bounds;
+ FSScreenPtr fsDisplayInfo;
+
+ // Allocate space for private per screen fullscreen specific storage.
+ fsDisplayInfo = xalloc(sizeof(FSScreenRec));
+ FULLSCREEN_PRIV(pScreen) = fsDisplayInfo;
+
+ displayInfo->displayCount = 1;
+ displayInfo->displayIDs = xrealloc(displayInfo->displayIDs,
+ 1 * sizeof(CGDirectDisplayID));
+ displayInfo->displayIDs[0] = cgID;
+
+ fsDisplayInfo->displayID = cgID;
+ fsDisplayInfo->xDisplayMode = 0;
+ fsDisplayInfo->aquaDisplayMode = 0;
+ fsDisplayInfo->xPalette = 0;
+ fsDisplayInfo->aquaPalette = 0;
+
+ // Capture full screen because X doesn't like read-only framebuffer.
+ // We need to do this before we (potentially) switch the display mode.
+ CGDisplayCapture(cgID);
+
+ if (! FSFindDisplayMode(fsDisplayInfo)) {
+ ErrorF("Could not support specified display mode on screen %i.\n",
+ index);
+ xfree(fsDisplayInfo);
+ return FALSE;
+ }
+
+ // Don't need to flip y-coordinate as CoreGraphics treats (0, 0)
+ // as the top left of main screen.
+ bounds = CGDisplayBounds(cgID);
+ dfb->x = bounds.origin.x;
+ dfb->y = bounds.origin.y;
+ dfb->width = bounds.size.width;
+ dfb->height = bounds.size.height;
+ dfb->pitch = CGDisplayBytesPerRow(cgID);
+ dfb->bitsPerPixel = CGDisplayBitsPerPixel(cgID);
+
+ if (dfb->bitsPerPixel == 8) {
+ if (CGDisplayCanSetPalette(cgID)) {
+ dfb->colorType = PseudoColor;
+ } else {
+ dfb->colorType = StaticColor;
+ }
+ dfb->bitsPerComponent = 8;
+ dfb->colorBitsPerPixel = 8;
+ } else {
+ dfb->colorType = TrueColor;
+ dfb->bitsPerComponent = CGDisplayBitsPerSample(cgID);
+ dfb->colorBitsPerPixel = CGDisplaySamplesPerPixel(cgID) *
+ dfb->bitsPerComponent;
+ }
+
+ fsDisplayInfo->framebuffer = CGDisplayBaseAddress(cgID);
+
+ // allocate shadow framebuffer
+ fsDisplayInfo->shadowPtr = xalloc(dfb->pitch * dfb->height);
+ dfb->framebuffer = fsDisplayInfo->shadowPtr;
+
+ return TRUE;
+}
+
+
+/*
+ * FSShadowUpdate
+ * Update the damaged regions of the shadow framebuffer on the display.
+ */
+static void FSShadowUpdate(
+ ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
+ RegionPtr damage = &pBuf->damage;
+ int numBox = REGION_NUM_RECTS(damage);
+ BoxPtr pBox = REGION_RECTS(damage);
+ int pitch = dfb->pitch;
+ int bpp = dfb->bitsPerPixel/8;
+
+ErrorF("FSShadowUpdate: %i\n", quartzServerVisible);
+
+ // Don't update if the X server is not visible
+ if (!quartzServerVisible)
+ return;
+
+ // Loop through all the damaged boxes
+ while (numBox--) {
+ int width, height, offset;
+ unsigned char *src, *dst;
+
+ width = (pBox->x2 - pBox->x1) * bpp;
+ height = pBox->y2 - pBox->y1;
+ offset = (pBox->y1 * pitch) + (pBox->x1 * bpp);
+ src = fsDisplayInfo->shadowPtr + offset;
+ dst = fsDisplayInfo->framebuffer + offset;
+
+ while (height--) {
+ memcpy(dst, src, width);
+ dst += pitch;
+ src += pitch;
+ }
+
+ // Get the next box
+ pBox++;
+ }
+}
+
+
+/*
+ * FSSetupScreen
+ * Finalize full screen specific setup of each screen.
+ */
+static Bool FSSetupScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ FSScreenPtr fsDisplayInfo = FULLSCREEN_PRIV(pScreen);
+ CGDirectDisplayID cgID = fsDisplayInfo->displayID;
+
+ErrorF("FSSetupScreen\n");
+ // Initialize shadow framebuffer support
+ if (! shadowInit(pScreen, FSShadowUpdate, NULL)) {
+ ErrorF("Failed to initalize shadow framebuffer for screen %i.\n",
+ index);
+ return FALSE;
+ }
+
+ if (dfb->colorType == PseudoColor) {
+ // Initialize colormap handling
+ size_t aquaBpp;
+
+ // If Aqua is using 8 bits we need to keep track of its pallete.
+ CFNumberGetValue(CFDictionaryGetValue(fsDisplayInfo->aquaDisplayMode,
+ kCGDisplayBitsPerPixel), kCFNumberLongType, &aquaBpp);
+ if (aquaBpp <= 8)
+ fsDisplayInfo->aquaPalette = CGPaletteCreateWithDisplay(cgID);
+
+ pScreen->CreateColormap = FSCreateColormap;
+ pScreen->DestroyColormap = FSDestroyColormap;
+ pScreen->InstallColormap = FSInstallColormap;
+ pScreen->StoreColors = FSStoreColors;
+
+ }
+
+ quartzScreens[quartzNumScreens++] = fsDisplayInfo;
+ return TRUE;
+}
+
+
+/*
+ * Quartz display mode function list.
+ */
+static QuartzModeProcsRec fsModeProcs = {
+ FSDisplayInit,
+ FSAddScreen,
+ FSSetupScreen,
+ NULL, // Not needed
+ QuartzInitCursor,
+ QuartzReallySetCursor,
+ FSSuspendScreen,
+ FSResumeScreen,
+ FSCapture,
+ FSRelease,
+ NULL, // No rootless code in fullscreen
+ NULL,
+ NULL,
+ NULL, // No support for DRI surfaces
+ NULL
+};
+
+
+/*
+ * QuartzModeBundleInit
+ * Initialize the display mode bundle after loading.
+ */
+Bool
+QuartzModeBundleInit(void)
+{
+ quartzProcs = &fsModeProcs;
+ quartzOpenGLBundle = NULL; // Only Mesa support for now
+ return TRUE;
+}
diff --git a/hw/darwin/quartz/fullscreen/quartzCursor.c b/hw/darwin/quartz/fullscreen/quartzCursor.c
new file mode 100644
index 000000000..72ad5ed8e
--- /dev/null
+++ b/hw/darwin/quartz/fullscreen/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/fullscreen/quartzCursor.c,v 1.1 2003/09/16 00:36:15 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/fullscreen/quartzCursor.h b/hw/darwin/quartz/fullscreen/quartzCursor.h
new file mode 100644
index 000000000..d822c3e86
--- /dev/null
+++ b/hw/darwin/quartz/fullscreen/quartzCursor.h
@@ -0,0 +1,44 @@
+/*
+ * 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/fullscreen/quartzCursor.h,v 1.1 2003/09/16 00:36:15 torrey Exp $ */
+
+#ifndef QUARTZCURSOR_H
+#define QUARTZCURSOR_H
+
+#include "screenint.h"
+
+Bool QuartzInitCursor(ScreenPtr pScreen);
+void QuartzReallySetCursor(void);
+void QuartzSuspendXCursor(ScreenPtr pScreen);
+void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
+
+#endif
diff --git a/hw/darwin/quartz/keysym2ucs.c b/hw/darwin/quartz/keysym2ucs.c
new file mode 100644
index 000000000..420830965
--- /dev/null
+++ b/hw/darwin/quartz/keysym2ucs.c
@@ -0,0 +1,909 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.c,v 1.1 2003/11/01 08:13:08 torrey Exp $
+ *
+ * This module converts keysym values into the corresponding ISO 10646
+ * (UCS, Unicode) values.
+ *
+ * The array keysymtab[] contains pairs of X11 keysym values for graphical
+ * characters and the corresponding Unicode value. The function
+ * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
+ * therefore keysymtab[] must remain SORTED by keysym value.
+ *
+ * The keysym -> UTF-8 conversion will hopefully one day be provided
+ * by Xlib via XmbLookupString() and should ideally not have to be
+ * done in X applications. But we are not there yet.
+ *
+ * We allow to represent any UCS character in the range U-00000000 to
+ * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
+ * This admittedly does not cover the entire 31-bit space of UCS, but
+ * it does cover all of the characters up to U-10FFFF, which can be
+ * represented by UTF-16, and more, and it is very unlikely that higher
+ * UCS codes will ever be assigned by ISO. So to get Unicode character
+ * U+ABCD you can directly use keysym 0x0100abcd.
+ *
+ * NOTE: The comments in the table below contain the actual character
+ * encoded in UTF-8, so for viewing and editing best use an editor in
+ * UTF-8 mode.
+ *
+ * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
+ *
+ * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
+ * an initial draft of the mapping table.
+ *
+ * This software is in the public domain. Share and enjoy!
+ *
+ * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
+ */
+
+#include "keysym2ucs.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+struct codepair {
+ unsigned short keysym;
+ unsigned short ucs;
+};
+
+const static struct codepair keysymtab[] = {
+ { 0x01a1, 0x0104 },
+ { 0x01a2, 0x02d8 },
+ { 0x01a3, 0x0141 },
+ { 0x01a5, 0x013d },
+ { 0x01a6, 0x015a },
+ { 0x01a9, 0x0160 },
+ { 0x01aa, 0x015e },
+ { 0x01ab, 0x0164 },
+ { 0x01ac, 0x0179 },
+ { 0x01ae, 0x017d },
+ { 0x01af, 0x017b },
+ { 0x01b1, 0x0105 },
+ { 0x01b2, 0x02db },
+ { 0x01b3, 0x0142 },
+ { 0x01b5, 0x013e },
+ { 0x01b6, 0x015b },
+ { 0x01b7, 0x02c7 },
+ { 0x01b9, 0x0161 },
+ { 0x01ba, 0x015f },
+ { 0x01bb, 0x0165 },
+ { 0x01bc, 0x017a },
+ { 0x01bd, 0x02dd },
+ { 0x01be, 0x017e },
+ { 0x01bf, 0x017c },
+ { 0x01c0, 0x0154 },
+ { 0x01c3, 0x0102 },
+ { 0x01c5, 0x0139 },
+ { 0x01c6, 0x0106 },
+ { 0x01c8, 0x010c },
+ { 0x01ca, 0x0118 },
+ { 0x01cc, 0x011a },
+ { 0x01cf, 0x010e },
+ { 0x01d0, 0x0110 },
+ { 0x01d1, 0x0143 },
+ { 0x01d2, 0x0147 },
+ { 0x01d5, 0x0150 },
+ { 0x01d8, 0x0158 },
+ { 0x01d9, 0x016e },
+ { 0x01db, 0x0170 },
+ { 0x01de, 0x0162 },
+ { 0x01e0, 0x0155 },
+ { 0x01e3, 0x0103 },
+ { 0x01e5, 0x013a },
+ { 0x01e6, 0x0107 },
+ { 0x01e8, 0x010d },
+ { 0x01ea, 0x0119 },
+ { 0x01ec, 0x011b },
+ { 0x01ef, 0x010f },
+ { 0x01f0, 0x0111 },
+ { 0x01f1, 0x0144 },
+ { 0x01f2, 0x0148 },
+ { 0x01f5, 0x0151 },
+ { 0x01f8, 0x0159 },
+ { 0x01f9, 0x016f },
+ { 0x01fb, 0x0171 },
+ { 0x01fe, 0x0163 },
+ { 0x01ff, 0x02d9 },
+ { 0x02a1, 0x0126 },
+ { 0x02a6, 0x0124 },
+ { 0x02a9, 0x0130 },
+ { 0x02ab, 0x011e },
+ { 0x02ac, 0x0134 },
+ { 0x02b1, 0x0127 },
+ { 0x02b6, 0x0125 },
+ { 0x02b9, 0x0131 },
+ { 0x02bb, 0x011f },
+ { 0x02bc, 0x0135 },
+ { 0x02c5, 0x010a },
+ { 0x02c6, 0x0108 },
+ { 0x02d5, 0x0120 },
+ { 0x02d8, 0x011c },
+ { 0x02dd, 0x016c },
+ { 0x02de, 0x015c },
+ { 0x02e5, 0x010b },
+ { 0x02e6, 0x0109 },
+ { 0x02f5, 0x0121 },
+ { 0x02f8, 0x011d },
+ { 0x02fd, 0x016d },
+ { 0x02fe, 0x015d },
+ { 0x03a2, 0x0138 },
+ { 0x03a3, 0x0156 },
+ { 0x03a5, 0x0128 },
+ { 0x03a6, 0x013b },
+ { 0x03aa, 0x0112 },
+ { 0x03ab, 0x0122 },
+ { 0x03ac, 0x0166 },
+ { 0x03b3, 0x0157 },
+ { 0x03b5, 0x0129 },
+ { 0x03b6, 0x013c },
+ { 0x03ba, 0x0113 },
+ { 0x03bb, 0x0123 },
+ { 0x03bc, 0x0167 },
+ { 0x03bd, 0x014a },
+ { 0x03bf, 0x014b },
+ { 0x03c0, 0x0100 },
+ { 0x03c7, 0x012e },
+ { 0x03cc, 0x0116 },
+ { 0x03cf, 0x012a },
+ { 0x03d1, 0x0145 },
+ { 0x03d2, 0x014c },
+ { 0x03d3, 0x0136 },
+ { 0x03d9, 0x0172 },
+ { 0x03dd, 0x0168 },
+ { 0x03de, 0x016a },
+ { 0x03e0, 0x0101 },
+ { 0x03e7, 0x012f },
+ { 0x03ec, 0x0117 },
+ { 0x03ef, 0x012b },
+ { 0x03f1, 0x0146 },
+ { 0x03f2, 0x014d },
+ { 0x03f3, 0x0137 },
+ { 0x03f9, 0x0173 },
+ { 0x03fd, 0x0169 },
+ { 0x03fe, 0x016b },
+ { 0x047e, 0x203e },
+ { 0x04a1, 0x3002 },
+ { 0x04a2, 0x300c },
+ { 0x04a3, 0x300d },
+ { 0x04a4, 0x3001 },
+ { 0x04a5, 0x30fb },
+ { 0x04a6, 0x30f2 },
+ { 0x04a7, 0x30a1 },
+ { 0x04a8, 0x30a3 },
+ { 0x04a9, 0x30a5 },
+ { 0x04aa, 0x30a7 },
+ { 0x04ab, 0x30a9 },
+ { 0x04ac, 0x30e3 },
+ { 0x04ad, 0x30e5 },
+ { 0x04ae, 0x30e7 },
+ { 0x04af, 0x30c3 },
+ { 0x04b0, 0x30fc },
+ { 0x04b1, 0x30a2 },
+ { 0x04b2, 0x30a4 },
+ { 0x04b3, 0x30a6 },
+ { 0x04b4, 0x30a8 },
+ { 0x04b5, 0x30aa },
+ { 0x04b6, 0x30ab },
+ { 0x04b7, 0x30ad },
+ { 0x04b8, 0x30af },
+ { 0x04b9, 0x30b1 },
+ { 0x04ba, 0x30b3 },
+ { 0x04bb, 0x30b5 },
+ { 0x04bc, 0x30b7 },
+ { 0x04bd, 0x30b9 },
+ { 0x04be, 0x30bb },
+ { 0x04bf, 0x30bd },
+ { 0x04c0, 0x30bf },
+ { 0x04c1, 0x30c1 },
+ { 0x04c2, 0x30c4 },
+ { 0x04c3, 0x30c6 },
+ { 0x04c4, 0x30c8 },
+ { 0x04c5, 0x30ca },
+ { 0x04c6, 0x30cb },
+ { 0x04c7, 0x30cc },
+ { 0x04c8, 0x30cd },
+ { 0x04c9, 0x30ce },
+ { 0x04ca, 0x30cf },
+ { 0x04cb, 0x30d2 },
+ { 0x04cc, 0x30d5 },
+ { 0x04cd, 0x30d8 },
+ { 0x04ce, 0x30db },
+ { 0x04cf, 0x30de },
+ { 0x04d0, 0x30df },
+ { 0x04d1, 0x30e0 },
+ { 0x04d2, 0x30e1 },
+ { 0x04d3, 0x30e2 },
+ { 0x04d4, 0x30e4 },
+ { 0x04d5, 0x30e6 },
+ { 0x04d6, 0x30e8 },
+ { 0x04d7, 0x30e9 },
+ { 0x04d8, 0x30ea },
+ { 0x04d9, 0x30eb },
+ { 0x04da, 0x30ec },
+ { 0x04db, 0x30ed },
+ { 0x04dc, 0x30ef },
+ { 0x04dd, 0x30f3 },
+ { 0x04de, 0x309b },
+ { 0x04df, 0x309c },
+ { 0x05ac, 0x060c },
+ { 0x05bb, 0x061b },
+ { 0x05bf, 0x061f },
+ { 0x05c1, 0x0621 },
+ { 0x05c2, 0x0622 },
+ { 0x05c3, 0x0623 },
+ { 0x05c4, 0x0624 },
+ { 0x05c5, 0x0625 },
+ { 0x05c6, 0x0626 },
+ { 0x05c7, 0x0627 },
+ { 0x05c8, 0x0628 },
+ { 0x05c9, 0x0629 },
+ { 0x05ca, 0x062a },
+ { 0x05cb, 0x062b },
+ { 0x05cc, 0x062c },
+ { 0x05cd, 0x062d },
+ { 0x05ce, 0x062e },
+ { 0x05cf, 0x062f },
+ { 0x05d0, 0x0630 },
+ { 0x05d1, 0x0631 },
+ { 0x05d2, 0x0632 },
+ { 0x05d3, 0x0633 },
+ { 0x05d4, 0x0634 },
+ { 0x05d5, 0x0635 },
+ { 0x05d6, 0x0636 },
+ { 0x05d7, 0x0637 },
+ { 0x05d8, 0x0638 },
+ { 0x05d9, 0x0639 },
+ { 0x05da, 0x063a },
+ { 0x05e0, 0x0640 },
+ { 0x05e1, 0x0641 },
+ { 0x05e2, 0x0642 },
+ { 0x05e3, 0x0643 },
+ { 0x05e4, 0x0644 },
+ { 0x05e5, 0x0645 },
+ { 0x05e6, 0x0646 },
+ { 0x05e7, 0x0647 },
+ { 0x05e8, 0x0648 },
+ { 0x05e9, 0x0649 },
+ { 0x05ea, 0x064a },
+ { 0x05eb, 0x064b },
+ { 0x05ec, 0x064c },
+ { 0x05ed, 0x064d },
+ { 0x05ee, 0x064e },
+ { 0x05ef, 0x064f },
+ { 0x05f0, 0x0650 },
+ { 0x05f1, 0x0651 },
+ { 0x05f2, 0x0652 },
+ { 0x06a1, 0x0452 },
+ { 0x06a2, 0x0453 },
+ { 0x06a3, 0x0451 },
+ { 0x06a4, 0x0454 },
+ { 0x06a5, 0x0455 },
+ { 0x06a6, 0x0456 },
+ { 0x06a7, 0x0457 },
+ { 0x06a8, 0x0458 },
+ { 0x06a9, 0x0459 },
+ { 0x06aa, 0x045a },
+ { 0x06ab, 0x045b },
+ { 0x06ac, 0x045c },
+ { 0x06ae, 0x045e },
+ { 0x06af, 0x045f },
+ { 0x06b0, 0x2116 },
+ { 0x06b1, 0x0402 },
+ { 0x06b2, 0x0403 },
+ { 0x06b3, 0x0401 },
+ { 0x06b4, 0x0404 },
+ { 0x06b5, 0x0405 },
+ { 0x06b6, 0x0406 },
+ { 0x06b7, 0x0407 },
+ { 0x06b8, 0x0408 },
+ { 0x06b9, 0x0409 },
+ { 0x06ba, 0x040a },
+ { 0x06bb, 0x040b },
+ { 0x06bc, 0x040c },
+ { 0x06be, 0x040e },
+ { 0x06bf, 0x040f },
+ { 0x06c0, 0x044e },
+ { 0x06c1, 0x0430 },
+ { 0x06c2, 0x0431 },
+ { 0x06c3, 0x0446 },
+ { 0x06c4, 0x0434 },
+ { 0x06c5, 0x0435 },
+ { 0x06c6, 0x0444 },
+ { 0x06c7, 0x0433 },
+ { 0x06c8, 0x0445 },
+ { 0x06c9, 0x0438 },
+ { 0x06ca, 0x0439 },
+ { 0x06cb, 0x043a },
+ { 0x06cc, 0x043b },
+ { 0x06cd, 0x043c },
+ { 0x06ce, 0x043d },
+ { 0x06cf, 0x043e },
+ { 0x06d0, 0x043f },
+ { 0x06d1, 0x044f },
+ { 0x06d2, 0x0440 },
+ { 0x06d3, 0x0441 },
+ { 0x06d4, 0x0442 },
+ { 0x06d5, 0x0443 },
+ { 0x06d6, 0x0436 },
+ { 0x06d7, 0x0432 },
+ { 0x06d8, 0x044c },
+ { 0x06d9, 0x044b },
+ { 0x06da, 0x0437 },
+ { 0x06db, 0x0448 },
+ { 0x06dc, 0x044d },
+ { 0x06dd, 0x0449 },
+ { 0x06de, 0x0447 },
+ { 0x06df, 0x044a },
+ { 0x06e0, 0x042e },
+ { 0x06e1, 0x0410 },
+ { 0x06e2, 0x0411 },
+ { 0x06e3, 0x0426 },
+ { 0x06e4, 0x0414 },
+ { 0x06e5, 0x0415 },
+ { 0x06e6, 0x0424 },
+ { 0x06e7, 0x0413 },
+ { 0x06e8, 0x0425 },
+ { 0x06e9, 0x0418 },
+ { 0x06ea, 0x0419 },
+ { 0x06eb, 0x041a },
+ { 0x06ec, 0x041b },
+ { 0x06ed, 0x041c },
+ { 0x06ee, 0x041d },
+ { 0x06ef, 0x041e },
+ { 0x06f0, 0x041f },
+ { 0x06f1, 0x042f },
+ { 0x06f2, 0x0420 },
+ { 0x06f3, 0x0421 },
+ { 0x06f4, 0x0422 },
+ { 0x06f5, 0x0423 },
+ { 0x06f6, 0x0416 },
+ { 0x06f7, 0x0412 },
+ { 0x06f8, 0x042c },
+ { 0x06f9, 0x042b },
+ { 0x06fa, 0x0417 },
+ { 0x06fb, 0x0428 },
+ { 0x06fc, 0x042d },
+ { 0x06fd, 0x0429 },
+ { 0x06fe, 0x0427 },
+ { 0x06ff, 0x042a },
+ { 0x07a1, 0x0386 },
+ { 0x07a2, 0x0388 },
+ { 0x07a3, 0x0389 },
+ { 0x07a4, 0x038a },
+ { 0x07a5, 0x03aa },
+ { 0x07a7, 0x038c },
+ { 0x07a8, 0x038e },
+ { 0x07a9, 0x03ab },
+ { 0x07ab, 0x038f },
+ { 0x07ae, 0x0385 },
+ { 0x07af, 0x2015 },
+ { 0x07b1, 0x03ac },
+ { 0x07b2, 0x03ad },
+ { 0x07b3, 0x03ae },
+ { 0x07b4, 0x03af },
+ { 0x07b5, 0x03ca },
+ { 0x07b6, 0x0390 },
+ { 0x07b7, 0x03cc },
+ { 0x07b8, 0x03cd },
+ { 0x07b9, 0x03cb },
+ { 0x07ba, 0x03b0 },
+ { 0x07bb, 0x03ce },
+ { 0x07c1, 0x0391 },
+ { 0x07c2, 0x0392 },
+ { 0x07c3, 0x0393 },
+ { 0x07c4, 0x0394 },
+ { 0x07c5, 0x0395 },
+ { 0x07c6, 0x0396 },
+ { 0x07c7, 0x0397 },
+ { 0x07c8, 0x0398 },
+ { 0x07c9, 0x0399 },
+ { 0x07ca, 0x039a },
+ { 0x07cb, 0x039b },
+ { 0x07cc, 0x039c },
+ { 0x07cd, 0x039d },
+ { 0x07ce, 0x039e },
+ { 0x07cf, 0x039f },
+ { 0x07d0, 0x03a0 },
+ { 0x07d1, 0x03a1 },
+ { 0x07d2, 0x03a3 },
+ { 0x07d4, 0x03a4 },
+ { 0x07d5, 0x03a5 },
+ { 0x07d6, 0x03a6 },
+ { 0x07d7, 0x03a7 },
+ { 0x07d8, 0x03a8 },
+ { 0x07d9, 0x03a9 },
+ { 0x07e1, 0x03b1 },
+ { 0x07e2, 0x03b2 },
+ { 0x07e3, 0x03b3 },
+ { 0x07e4, 0x03b4 },
+ { 0x07e5, 0x03b5 },
+ { 0x07e6, 0x03b6 },
+ { 0x07e7, 0x03b7 },
+ { 0x07e8, 0x03b8 },
+ { 0x07e9, 0x03b9 },
+ { 0x07ea, 0x03ba },
+ { 0x07eb, 0x03bb },
+ { 0x07ec, 0x03bc },
+ { 0x07ed, 0x03bd },
+ { 0x07ee, 0x03be },
+ { 0x07ef, 0x03bf },
+ { 0x07f0, 0x03c0 },
+ { 0x07f1, 0x03c1 },
+ { 0x07f2, 0x03c3 },
+ { 0x07f3, 0x03c2 },
+ { 0x07f4, 0x03c4 },
+ { 0x07f5, 0x03c5 },
+ { 0x07f6, 0x03c6 },
+ { 0x07f7, 0x03c7 },
+ { 0x07f8, 0x03c8 },
+ { 0x07f9, 0x03c9 },
+ { 0x08a1, 0x23b7 },
+ { 0x08a2, 0x250c },
+ { 0x08a3, 0x2500 },
+ { 0x08a4, 0x2320 },
+ { 0x08a5, 0x2321 },
+ { 0x08a6, 0x2502 },
+ { 0x08a7, 0x23a1 },
+ { 0x08a8, 0x23a3 },
+ { 0x08a9, 0x23a4 },
+ { 0x08aa, 0x23a6 },
+ { 0x08ab, 0x239b },
+ { 0x08ac, 0x239d },
+ { 0x08ad, 0x239e },
+ { 0x08ae, 0x23a0 },
+ { 0x08af, 0x23a8 },
+ { 0x08b0, 0x23ac },
+ { 0x08bc, 0x2264 },
+ { 0x08bd, 0x2260 },
+ { 0x08be, 0x2265 },
+ { 0x08bf, 0x222b },
+ { 0x08c0, 0x2234 },
+ { 0x08c1, 0x221d },
+ { 0x08c2, 0x221e },
+ { 0x08c5, 0x2207 },
+ { 0x08c8, 0x223c },
+ { 0x08c9, 0x2243 },
+ { 0x08cd, 0x21d4 },
+ { 0x08ce, 0x21d2 },
+ { 0x08cf, 0x2261 },
+ { 0x08d6, 0x221a },
+ { 0x08da, 0x2282 },
+ { 0x08db, 0x2283 },
+ { 0x08dc, 0x2229 },
+ { 0x08dd, 0x222a },
+ { 0x08de, 0x2227 },
+ { 0x08df, 0x2228 },
+ { 0x08ef, 0x2202 },
+ { 0x08f6, 0x0192 },
+ { 0x08fb, 0x2190 },
+ { 0x08fc, 0x2191 },
+ { 0x08fd, 0x2192 },
+ { 0x08fe, 0x2193 },
+ { 0x09e0, 0x25c6 },
+ { 0x09e1, 0x2592 },
+ { 0x09e2, 0x2409 },
+ { 0x09e3, 0x240c },
+ { 0x09e4, 0x240d },
+ { 0x09e5, 0x240a },
+ { 0x09e8, 0x2424 },
+ { 0x09e9, 0x240b },
+ { 0x09ea, 0x2518 },
+ { 0x09eb, 0x2510 },
+ { 0x09ec, 0x250c },
+ { 0x09ed, 0x2514 },
+ { 0x09ee, 0x253c },
+ { 0x09ef, 0x23ba },
+ { 0x09f0, 0x23bb },
+ { 0x09f1, 0x2500 },
+ { 0x09f2, 0x23bc },
+ { 0x09f3, 0x23bd },
+ { 0x09f4, 0x251c },
+ { 0x09f5, 0x2524 },
+ { 0x09f6, 0x2534 },
+ { 0x09f7, 0x252c },
+ { 0x09f8, 0x2502 },
+ { 0x0aa1, 0x2003 },
+ { 0x0aa2, 0x2002 },
+ { 0x0aa3, 0x2004 },
+ { 0x0aa4, 0x2005 },
+ { 0x0aa5, 0x2007 },
+ { 0x0aa6, 0x2008 },
+ { 0x0aa7, 0x2009 },
+ { 0x0aa8, 0x200a },
+ { 0x0aa9, 0x2014 },
+ { 0x0aaa, 0x2013 },
+ { 0x0aae, 0x2026 },
+ { 0x0aaf, 0x2025 },
+ { 0x0ab0, 0x2153 },
+ { 0x0ab1, 0x2154 },
+ { 0x0ab2, 0x2155 },
+ { 0x0ab3, 0x2156 },
+ { 0x0ab4, 0x2157 },
+ { 0x0ab5, 0x2158 },
+ { 0x0ab6, 0x2159 },
+ { 0x0ab7, 0x215a },
+ { 0x0ab8, 0x2105 },
+ { 0x0abb, 0x2012 },
+ { 0x0abc, 0x2329 },
+ { 0x0abe, 0x232a },
+ { 0x0ac3, 0x215b },
+ { 0x0ac4, 0x215c },
+ { 0x0ac5, 0x215d },
+ { 0x0ac6, 0x215e },
+ { 0x0ac9, 0x2122 },
+ { 0x0aca, 0x2613 },
+ { 0x0acc, 0x25c1 },
+ { 0x0acd, 0x25b7 },
+ { 0x0ace, 0x25cb },
+ { 0x0acf, 0x25af },
+ { 0x0ad0, 0x2018 },
+ { 0x0ad1, 0x2019 },
+ { 0x0ad2, 0x201c },
+ { 0x0ad3, 0x201d },
+ { 0x0ad4, 0x211e },
+ { 0x0ad6, 0x2032 },
+ { 0x0ad7, 0x2033 },
+ { 0x0ad9, 0x271d },
+ { 0x0adb, 0x25ac },
+ { 0x0adc, 0x25c0 },
+ { 0x0add, 0x25b6 },
+ { 0x0ade, 0x25cf },
+ { 0x0adf, 0x25ae },
+ { 0x0ae0, 0x25e6 },
+ { 0x0ae1, 0x25ab },
+ { 0x0ae2, 0x25ad },
+ { 0x0ae3, 0x25b3 },
+ { 0x0ae4, 0x25bd },
+ { 0x0ae5, 0x2606 },
+ { 0x0ae6, 0x2022 },
+ { 0x0ae7, 0x25aa },
+ { 0x0ae8, 0x25b2 },
+ { 0x0ae9, 0x25bc },
+ { 0x0aea, 0x261c },
+ { 0x0aeb, 0x261e },
+ { 0x0aec, 0x2663 },
+ { 0x0aed, 0x2666 },
+ { 0x0aee, 0x2665 },
+ { 0x0af0, 0x2720 },
+ { 0x0af1, 0x2020 },
+ { 0x0af2, 0x2021 },
+ { 0x0af3, 0x2713 },
+ { 0x0af4, 0x2717 },
+ { 0x0af5, 0x266f },
+ { 0x0af6, 0x266d },
+ { 0x0af7, 0x2642 },
+ { 0x0af8, 0x2640 },
+ { 0x0af9, 0x260e },
+ { 0x0afa, 0x2315 },
+ { 0x0afb, 0x2117 },
+ { 0x0afc, 0x2038 },
+ { 0x0afd, 0x201a },
+ { 0x0afe, 0x201e },
+ { 0x0ba3, 0x003c },
+ { 0x0ba6, 0x003e },
+ { 0x0ba8, 0x2228 },
+ { 0x0ba9, 0x2227 },
+ { 0x0bc0, 0x00af },
+ { 0x0bc2, 0x22a5 },
+ { 0x0bc3, 0x2229 },
+ { 0x0bc4, 0x230a },
+ { 0x0bc6, 0x005f },
+ { 0x0bca, 0x2218 },
+ { 0x0bcc, 0x2395 },
+ { 0x0bce, 0x22a4 },
+ { 0x0bcf, 0x25cb },
+ { 0x0bd3, 0x2308 },
+ { 0x0bd6, 0x222a },
+ { 0x0bd8, 0x2283 },
+ { 0x0bda, 0x2282 },
+ { 0x0bdc, 0x22a2 },
+ { 0x0bfc, 0x22a3 },
+ { 0x0cdf, 0x2017 },
+ { 0x0ce0, 0x05d0 },
+ { 0x0ce1, 0x05d1 },
+ { 0x0ce2, 0x05d2 },
+ { 0x0ce3, 0x05d3 },
+ { 0x0ce4, 0x05d4 },
+ { 0x0ce5, 0x05d5 },
+ { 0x0ce6, 0x05d6 },
+ { 0x0ce7, 0x05d7 },
+ { 0x0ce8, 0x05d8 },
+ { 0x0ce9, 0x05d9 },
+ { 0x0cea, 0x05da },
+ { 0x0ceb, 0x05db },
+ { 0x0cec, 0x05dc },
+ { 0x0ced, 0x05dd },
+ { 0x0cee, 0x05de },
+ { 0x0cef, 0x05df },
+ { 0x0cf0, 0x05e0 },
+ { 0x0cf1, 0x05e1 },
+ { 0x0cf2, 0x05e2 },
+ { 0x0cf3, 0x05e3 },
+ { 0x0cf4, 0x05e4 },
+ { 0x0cf5, 0x05e5 },
+ { 0x0cf6, 0x05e6 },
+ { 0x0cf7, 0x05e7 },
+ { 0x0cf8, 0x05e8 },
+ { 0x0cf9, 0x05e9 },
+ { 0x0cfa, 0x05ea },
+ { 0x0da1, 0x0e01 },
+ { 0x0da2, 0x0e02 },
+ { 0x0da3, 0x0e03 },
+ { 0x0da4, 0x0e04 },
+ { 0x0da5, 0x0e05 },
+ { 0x0da6, 0x0e06 },
+ { 0x0da7, 0x0e07 },
+ { 0x0da8, 0x0e08 },
+ { 0x0da9, 0x0e09 },
+ { 0x0daa, 0x0e0a },
+ { 0x0dab, 0x0e0b },
+ { 0x0dac, 0x0e0c },
+ { 0x0dad, 0x0e0d },
+ { 0x0dae, 0x0e0e },
+ { 0x0daf, 0x0e0f },
+ { 0x0db0, 0x0e10 },
+ { 0x0db1, 0x0e11 },
+ { 0x0db2, 0x0e12 },
+ { 0x0db3, 0x0e13 },
+ { 0x0db4, 0x0e14 },
+ { 0x0db5, 0x0e15 },
+ { 0x0db6, 0x0e16 },
+ { 0x0db7, 0x0e17 },
+ { 0x0db8, 0x0e18 },
+ { 0x0db9, 0x0e19 },
+ { 0x0dba, 0x0e1a },
+ { 0x0dbb, 0x0e1b },
+ { 0x0dbc, 0x0e1c },
+ { 0x0dbd, 0x0e1d },
+ { 0x0dbe, 0x0e1e },
+ { 0x0dbf, 0x0e1f },
+ { 0x0dc0, 0x0e20 },
+ { 0x0dc1, 0x0e21 },
+ { 0x0dc2, 0x0e22 },
+ { 0x0dc3, 0x0e23 },
+ { 0x0dc4, 0x0e24 },
+ { 0x0dc5, 0x0e25 },
+ { 0x0dc6, 0x0e26 },
+ { 0x0dc7, 0x0e27 },
+ { 0x0dc8, 0x0e28 },
+ { 0x0dc9, 0x0e29 },
+ { 0x0dca, 0x0e2a },
+ { 0x0dcb, 0x0e2b },
+ { 0x0dcc, 0x0e2c },
+ { 0x0dcd, 0x0e2d },
+ { 0x0dce, 0x0e2e },
+ { 0x0dcf, 0x0e2f },
+ { 0x0dd0, 0x0e30 },
+ { 0x0dd1, 0x0e31 },
+ { 0x0dd2, 0x0e32 },
+ { 0x0dd3, 0x0e33 },
+ { 0x0dd4, 0x0e34 },
+ { 0x0dd5, 0x0e35 },
+ { 0x0dd6, 0x0e36 },
+ { 0x0dd7, 0x0e37 },
+ { 0x0dd8, 0x0e38 },
+ { 0x0dd9, 0x0e39 },
+ { 0x0dda, 0x0e3a },
+ { 0x0ddf, 0x0e3f },
+ { 0x0de0, 0x0e40 },
+ { 0x0de1, 0x0e41 },
+ { 0x0de2, 0x0e42 },
+ { 0x0de3, 0x0e43 },
+ { 0x0de4, 0x0e44 },
+ { 0x0de5, 0x0e45 },
+ { 0x0de6, 0x0e46 },
+ { 0x0de7, 0x0e47 },
+ { 0x0de8, 0x0e48 },
+ { 0x0de9, 0x0e49 },
+ { 0x0dea, 0x0e4a },
+ { 0x0deb, 0x0e4b },
+ { 0x0dec, 0x0e4c },
+ { 0x0ded, 0x0e4d },
+ { 0x0df0, 0x0e50 },
+ { 0x0df1, 0x0e51 },
+ { 0x0df2, 0x0e52 },
+ { 0x0df3, 0x0e53 },
+ { 0x0df4, 0x0e54 },
+ { 0x0df5, 0x0e55 },
+ { 0x0df6, 0x0e56 },
+ { 0x0df7, 0x0e57 },
+ { 0x0df8, 0x0e58 },
+ { 0x0df9, 0x0e59 },
+ { 0x0ea1, 0x3131 },
+ { 0x0ea2, 0x3132 },
+ { 0x0ea3, 0x3133 },
+ { 0x0ea4, 0x3134 },
+ { 0x0ea5, 0x3135 },
+ { 0x0ea6, 0x3136 },
+ { 0x0ea7, 0x3137 },
+ { 0x0ea8, 0x3138 },
+ { 0x0ea9, 0x3139 },
+ { 0x0eaa, 0x313a },
+ { 0x0eab, 0x313b },
+ { 0x0eac, 0x313c },
+ { 0x0ead, 0x313d },
+ { 0x0eae, 0x313e },
+ { 0x0eaf, 0x313f },
+ { 0x0eb0, 0x3140 },
+ { 0x0eb1, 0x3141 },
+ { 0x0eb2, 0x3142 },
+ { 0x0eb3, 0x3143 },
+ { 0x0eb4, 0x3144 },
+ { 0x0eb5, 0x3145 },
+ { 0x0eb6, 0x3146 },
+ { 0x0eb7, 0x3147 },
+ { 0x0eb8, 0x3148 },
+ { 0x0eb9, 0x3149 },
+ { 0x0eba, 0x314a },
+ { 0x0ebb, 0x314b },
+ { 0x0ebc, 0x314c },
+ { 0x0ebd, 0x314d },
+ { 0x0ebe, 0x314e },
+ { 0x0ebf, 0x314f },
+ { 0x0ec0, 0x3150 },
+ { 0x0ec1, 0x3151 },
+ { 0x0ec2, 0x3152 },
+ { 0x0ec3, 0x3153 },
+ { 0x0ec4, 0x3154 },
+ { 0x0ec5, 0x3155 },
+ { 0x0ec6, 0x3156 },
+ { 0x0ec7, 0x3157 },
+ { 0x0ec8, 0x3158 },
+ { 0x0ec9, 0x3159 },
+ { 0x0eca, 0x315a },
+ { 0x0ecb, 0x315b },
+ { 0x0ecc, 0x315c },
+ { 0x0ecd, 0x315d },
+ { 0x0ece, 0x315e },
+ { 0x0ecf, 0x315f },
+ { 0x0ed0, 0x3160 },
+ { 0x0ed1, 0x3161 },
+ { 0x0ed2, 0x3162 },
+ { 0x0ed3, 0x3163 },
+ { 0x0ed4, 0x11a8 },
+ { 0x0ed5, 0x11a9 },
+ { 0x0ed6, 0x11aa },
+ { 0x0ed7, 0x11ab },
+ { 0x0ed8, 0x11ac },
+ { 0x0ed9, 0x11ad },
+ { 0x0eda, 0x11ae },
+ { 0x0edb, 0x11af },
+ { 0x0edc, 0x11b0 },
+ { 0x0edd, 0x11b1 },
+ { 0x0ede, 0x11b2 },
+ { 0x0edf, 0x11b3 },
+ { 0x0ee0, 0x11b4 },
+ { 0x0ee1, 0x11b5 },
+ { 0x0ee2, 0x11b6 },
+ { 0x0ee3, 0x11b7 },
+ { 0x0ee4, 0x11b8 },
+ { 0x0ee5, 0x11b9 },
+ { 0x0ee6, 0x11ba },
+ { 0x0ee7, 0x11bb },
+ { 0x0ee8, 0x11bc },
+ { 0x0ee9, 0x11bd },
+ { 0x0eea, 0x11be },
+ { 0x0eeb, 0x11bf },
+ { 0x0eec, 0x11c0 },
+ { 0x0eed, 0x11c1 },
+ { 0x0eee, 0x11c2 },
+ { 0x0eef, 0x316d },
+ { 0x0ef0, 0x3171 },
+ { 0x0ef1, 0x3178 },
+ { 0x0ef2, 0x317f },
+ { 0x0ef3, 0x3181 },
+ { 0x0ef4, 0x3184 },
+ { 0x0ef5, 0x3186 },
+ { 0x0ef6, 0x318d },
+ { 0x0ef7, 0x318e },
+ { 0x0ef8, 0x11eb },
+ { 0x0ef9, 0x11f0 },
+ { 0x0efa, 0x11f9 },
+ { 0x0eff, 0x20a9 },
+#if 0
+ /* FIXME: there is no keysym 0x13a4? But 0x20ac is EuroSign in both
+ keysym and Unicode */
+ { 0x13a4, 0x20ac },
+#endif
+ { 0x13bc, 0x0152 },
+ { 0x13bd, 0x0153 },
+ { 0x13be, 0x0178 },
+ { 0x20ac, 0x20ac },
+
+ /* Special function keys. */
+
+ { 0xff08, 0x0008 }, /* XK_BackSpace */
+ { 0xff09, 0x0009 }, /* XK_Tab */
+ { 0xff0a, 0x000a }, /* XK_Linefeed */
+ { 0xff0d, 0x000d }, /* XK_Return */
+ { 0xff13, 0x0013 }, /* XK_Pause */
+ { 0xff1b, 0x001b }, /* XK_Escape */
+ { 0xff50, 0x0001 }, /* XK_Home */
+ { 0xff51, 0x001c }, /* XK_Left */
+ { 0xff52, 0x001e }, /* XK_Up */
+ { 0xff53, 0x001d }, /* XK_Right */
+ { 0xff54, 0x001f }, /* XK_Down */
+ { 0xff55, 0x000b }, /* XK_Prior */
+ { 0xff56, 0x000c }, /* XK_Next */
+ { 0xff57, 0x0004 }, /* XK_End */
+ { 0xff6a, 0x0005 }, /* XK_Help */
+ { 0xffff, 0x007f }, /* XK_Delete */
+};
+
+long keysym2ucs(int keysym)
+{
+ int min = 0;
+ int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
+ int mid;
+
+ /* first check for Latin-1 characters (1:1 mapping) */
+ if ((keysym >= 0x0020 && keysym <= 0x007e) ||
+ (keysym >= 0x00a0 && keysym <= 0x00ff))
+ return keysym;
+
+ /* also check for directly encoded 24-bit UCS characters */
+ if ((keysym & 0xff000000) == 0x01000000)
+ return keysym & 0x00ffffff;
+
+ /* binary search in table */
+ while (max >= min) {
+ mid = (min + max) / 2;
+ if (keysymtab[mid].keysym < keysym)
+ min = mid + 1;
+ else if (keysymtab[mid].keysym > keysym)
+ max = mid - 1;
+ else {
+ /* found it */
+ return keysymtab[mid].ucs;
+ }
+ }
+
+ /* no matching Unicode value found */
+ return -1;
+}
+
+static int reverse_compare (const void *a, const void *b)
+{
+ const struct codepair *ca = a, *cb = b;
+
+ return ca->ucs - cb->ucs;
+}
+
+int ucs2keysym(long ucs)
+{
+ static struct codepair *reverse_keysymtab;
+
+ int min = 0;
+ int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
+ int mid;
+
+ if (reverse_keysymtab == NULL)
+ {
+ reverse_keysymtab = malloc (sizeof (keysymtab));
+ memcpy (reverse_keysymtab, keysymtab, sizeof (keysymtab));
+
+ qsort (reverse_keysymtab,
+ sizeof (keysymtab) / sizeof (struct codepair),
+ sizeof (struct codepair),
+ reverse_compare);
+ }
+
+ /* first check for Latin-1 characters (1:1 mapping) */
+ if ((ucs >= 0x0020 && ucs <= 0x007e) ||
+ (ucs >= 0x00a0 && ucs <= 0x00ff))
+ return ucs;
+
+ /* binary search in table */
+ while (max >= min) {
+ mid = (min + max) / 2;
+ if (reverse_keysymtab[mid].ucs < ucs)
+ min = mid + 1;
+ else if (reverse_keysymtab[mid].ucs > ucs)
+ max = mid - 1;
+ else {
+ /* found it */
+ return reverse_keysymtab[mid].keysym;
+ }
+ }
+
+ /* finally, assume a directly encoded 24-bit UCS character */
+ return ucs | 0x01000000;
+}
diff --git a/hw/darwin/quartz/keysym2ucs.h b/hw/darwin/quartz/keysym2ucs.h
new file mode 100644
index 000000000..1d9183448
--- /dev/null
+++ b/hw/darwin/quartz/keysym2ucs.h
@@ -0,0 +1,37 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/keysym2ucs.h,v 1.1 2003/11/01 08:13:08 torrey Exp $
+ *
+ * This module converts keysym values into the corresponding ISO 10646
+ * (UCS, Unicode) values.
+ *
+ * The array keysymtab[] contains pairs of X11 keysym values for graphical
+ * characters and the corresponding Unicode value. The function
+ * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
+ * therefore keysymtab[] must remain SORTED by keysym value.
+ *
+ * The keysym -> UTF-8 conversion will hopefully one day be provided
+ * by Xlib via XmbLookupString() and should ideally not have to be
+ * done in X applications. But we are not there yet.
+ *
+ * We allow to represent any UCS character in the range U-00000000 to
+ * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
+ * This admittedly does not cover the entire 31-bit space of UCS, but
+ * it does cover all of the characters up to U-10FFFF, which can be
+ * represented by UTF-16, and more, and it is very unlikely that higher
+ * UCS codes will ever be assigned by ISO. So to get Unicode character
+ * U+ABCD you can directly use keysym 0x0100abcd.
+ *
+ * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
+ *
+ * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
+ * an initial draft of the mapping table.
+ *
+ * This software is in the public domain. Share and enjoy!
+ */
+
+#ifndef KEYSYM2UCS_H
+#define KEYSYM2UCS_H 1
+
+extern long keysym2ucs(int keysym);
+extern int ucs2keysym(long ucs);
+
+#endif /* KEYSYM2UCS_H */
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c
index e55aabd6f..2dd7c3ae5 100644
--- a/hw/darwin/quartz/pseudoramiX.c
+++ b/hw/darwin/quartz/pseudoramiX.c
@@ -32,7 +32,7 @@ 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.3 2003/04/30 23:15:39 torrey Exp $ */
#include "pseudoramiX.h"
@@ -111,7 +111,7 @@ void PseudoramiXExtensionInit(int argc, char *argv[])
if (noPseudoramiXExtension) return;
- if (pseudoramiXNumScreens == 1 || aquaNumScreens == 1) {
+ if (pseudoramiXNumScreens == 1) {
// Only one screen - disable Xinerama extension.
noPseudoramiXExtension = TRUE;
return;
diff --git a/hw/darwin/quartz/pseudoramiX.h b/hw/darwin/quartz/pseudoramiX.h
index d0d596686..23738cfb3 100644
--- a/hw/darwin/quartz/pseudoramiX.h
+++ b/hw/darwin/quartz/pseudoramiX.h
@@ -1,10 +1,9 @@
/*
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.2 2003/04/30 23:15:39 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
index 592a0e4a0..4643886f3 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -29,16 +29,16 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.13 2003/11/12 20:21:51 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"
+#define _APPLEWM_SERVER_
+#include "applewm.h"
+#include "applewmExt.h"
// X headers
#include "scrnintstr.h"
@@ -61,8 +61,8 @@ int quartzServerQuitting = FALSE;
int quartzScreenIndex = 0;
int aquaMenuBarHeight = 0;
int noPseudoramiXExtension = TRUE;
-int aquaNumScreens = 0;
-
+QuartzModeProcsPtr quartzProcs = NULL;
+const char *quartzOpenGLBundle = NULL;
/*
===========================================================================
@@ -73,10 +73,10 @@ int aquaNumScreens = 0;
*/
/*
- * QuartzAddScreen
+ * DarwinModeAddScreen
* Do mode dependent initialization of each screen for Quartz.
*/
-Bool QuartzAddScreen(
+Bool DarwinModeAddScreen(
int index,
ScreenPtr pScreen)
{
@@ -84,34 +84,25 @@ Bool QuartzAddScreen(
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);
- }
+ // do Quartz mode specific initialization
+ return quartzProcs->AddScreen(index, pScreen);
}
/*
- * QuartzSetupScreen
+ * DarwinModeSetupScreen
* Finalize mode specific setup of each screen.
*/
-Bool QuartzSetupScreen(
+Bool DarwinModeSetupScreen(
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;
- }
+ // do Quartz mode specific setup
+ if (! quartzProcs->SetupScreen(index, pScreen))
+ return FALSE;
// setup cursor support
- if (! QuartzInitCursor(pScreen))
+ if (! quartzProcs->InitCursor(pScreen))
return FALSE;
return TRUE;
@@ -119,10 +110,10 @@ Bool QuartzSetupScreen(
/*
- * QuartzInitOutput
+ * DarwinModeInitOutput
* Quartz display initialization.
*/
-void QuartzInitOutput(
+void DarwinModeInitOutput(
int argc,
char **argv )
{
@@ -145,13 +136,8 @@ void QuartzInitOutput(
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();
- }
+ // Do display mode specific initialization
+ quartzProcs->DisplayInit();
// Init PseudoramiX implementation of Xinerama.
// This should be in InitExtensions, but that causes link errors
@@ -163,21 +149,28 @@ void QuartzInitOutput(
/*
- * QuartzInitInput
+ * DarwinModeInitInput
* Inform the main thread the X server is ready to handle events.
*/
-void QuartzInitInput(
+void DarwinModeInitInput(
int argc,
char **argv )
{
- QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
+ if (serverGeneration == 1) {
+ QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
+ }
+
+ // Do final display mode specific initialization before handling events
+ if (quartzProcs->InitInput)
+ quartzProcs->InitInput(argc, argv);
}
/*
* QuartzShow
* Show the X server on screen. Does nothing if already shown.
- * Restore the X clip regions and the X server cursor state.
+ * Calls mode specific screen resume to restore the X clip regions
+ * (if needed) and the X server cursor state.
*/
static void QuartzShow(
int x, // cursor location
@@ -189,9 +182,7 @@ static void QuartzShow(
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);
+ quartzProcs->ResumeScreen(screenInfo.screens[i], x, y);
}
}
}
@@ -201,8 +192,8 @@ static void QuartzShow(
/*
* 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.
+ * hidden. Calls mode specific screen suspend to set X clip regions to
+ * prevent drawing (if needed) and restore the Aqua cursor.
*/
static void QuartzHide(void)
{
@@ -211,9 +202,7 @@ static void QuartzHide(void)
if (quartzServerVisible) {
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i]) {
- QuartzSuspendXCursor(screenInfo.screens[i]);
- if (!quartzRootless)
- xf86SetRootClip(screenInfo.screens[i], FALSE);
+ quartzProcs->SuspendScreen(screenInfo.screens[i]);
}
}
}
@@ -243,20 +232,58 @@ static void QuartzSetRootClip(
/*
- * QuartzProcessEvent
+ * QuartzMessageServerThread
+ * Send the X server thread a message by placing it on the event queue.
+ */
+void
+QuartzMessageServerThread(
+ int type,
+ int argc, ...)
+{
+ xEvent xe;
+ INT32 *argv;
+ int i, max_args;
+ va_list args;
+
+ memset(&xe, 0, sizeof(xe));
+ xe.u.u.type = type;
+ xe.u.clientMessage.u.l.type = type;
+
+ argv = &xe.u.clientMessage.u.l.longs0;
+ max_args = 4;
+
+ if (argc > 0 && argc <= max_args) {
+ va_start (args, argc);
+ for (i = 0; i < argc; i++)
+ argv[i] = (int) va_arg (args, int);
+ va_end (args);
+ }
+
+ DarwinEQEnqueue(&xe);
+}
+
+
+/*
+ * DarwinModeProcessEvent
* Process Quartz specific events.
*/
-void QuartzProcessEvent(
+void DarwinModeProcessEvent(
xEvent *xe)
{
switch (xe->u.u.type) {
- case kXDarwinShow:
+ case kXDarwinActivate:
QuartzShow(xe->u.keyButtonPointer.rootX,
xe->u.keyButtonPointer.rootY);
+ AppleWMSendEvent(AppleWMActivationNotify,
+ AppleWMActivationNotifyMask,
+ AppleWMIsActive, 0);
break;
- case kXDarwinHide:
+ case kXDarwinDeactivate:
+ AppleWMSendEvent(AppleWMActivationNotify,
+ AppleWMActivationNotifyMask,
+ AppleWMIsInactive, 0);
QuartzHide();
break;
@@ -276,18 +303,42 @@ void QuartzProcessEvent(
QuartzWritePasteboard();
break;
+ /*
+ * AppleWM events
+ */
+ case kXDarwinControllerNotify:
+ AppleWMSendEvent(AppleWMControllerNotify,
+ AppleWMControllerNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXDarwinPasteboardNotify:
+ AppleWMSendEvent(AppleWMPasteboardNotify,
+ AppleWMPasteboardNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXDarwinDisplayChanged:
+ case kXDarwinWindowState:
+ case kXDarwinWindowMoved:
+ // FIXME: Not implemented yet
+ break;
+
default:
- ErrorF("Unknown application defined event.\n");
+ ErrorF("Unknown application defined event type %d.\n",
+ xe->u.u.type);
}
}
/*
- * QuartzGiveUp
+ * DarwinModeGiveUp
* Cleanup before X server shutdown
* Release the screen and restore the Aqua cursor.
*/
-void QuartzGiveUp(void)
+void DarwinModeGiveUp(void)
{
#if 0
// Trying to switch cursors when quitting causes deadlock
@@ -301,5 +352,5 @@ void QuartzGiveUp(void)
#endif
if (!quartzRootless)
- QuartzFSRelease();
+ quartzProcs->ReleaseScreens();
}
diff --git a/hw/darwin/quartz/quartz.h b/hw/darwin/quartz/quartz.h
index cd4f732f3..849e10cef 100644
--- a/hw/darwin/quartz/quartz.h
+++ b/hw/darwin/quartz/quartz.h
@@ -1,11 +1,11 @@
/*
* quartz.h
*
- * External interface of the Quartz modes seen by the generic, mode
+ * External interface of the Quartz display modes seen by the generic, mode
* independent parts of the Darwin X server.
*/
/*
- * Copyright (c) 2001-2002 Greg Parker and Torrey T. Lyons.
+ * 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
@@ -30,21 +30,88 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.7 2003/11/12 20:21:51 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);
+#include "screenint.h"
+#include "window.h"
+
+/*------------------------------------------
+ Quartz display mode function types
+ ------------------------------------------*/
+
+/*
+ * Display mode initialization
+ */
+typedef void (*DisplayInitProc)(void);
+typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen);
+typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen);
+typedef void (*InitInputProc)(int argc, char **argv);
+
+/*
+ * Cursor functions
+ */
+typedef Bool (*InitCursorProc)(ScreenPtr pScreen);
+typedef void (*CursorUpdateProc)(void);
+
+/*
+ * Suspend and resume X11 activity
+ */
+typedef void (*SuspendScreenProc)(ScreenPtr pScreen);
+typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y);
+typedef void (*CaptureScreensProc)(void);
+typedef void (*ReleaseScreensProc)(void);
+
+/*
+ * Rootless helper functions
+ */
+typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
+
+/*
+ * Rootless functions for optional export to GLX layer
+ */
+typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create);
+typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow);
+typedef Bool (*CreateSurfaceProc)
+ (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ unsigned int client_id, unsigned int *surface_id,
+ unsigned int key[2], void (*notify) (void *arg, void *data),
+ void *notify_data);
+typedef Bool (*DestroySurfaceProc)
+ (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ void (*notify) (void *arg, void *data), void *notify_data);
+
+/*
+ * Quartz display mode function list
+ */
+typedef struct _QuartzModeProcs {
+ DisplayInitProc DisplayInit;
+ AddScreenProc AddScreen;
+ SetupScreenProc SetupScreen;
+ InitInputProc InitInput;
+
+ InitCursorProc InitCursor;
+ CursorUpdateProc CursorUpdate; // Not used if NULL
+
+ SuspendScreenProc SuspendScreen;
+ ResumeScreenProc ResumeScreen;
+ CaptureScreensProc CaptureScreens; // Only called in fullscreen
+ ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
+
+ IsX11WindowProc IsX11Window;
+
+ FrameForWindowProc FrameForWindow;
+ TopLevelParentProc TopLevelParent;
+ CreateSurfaceProc CreateSurface;
+ DestroySurfaceProc DestroySurface;
+} QuartzModeProcsRec, *QuartzModeProcsPtr;
+
+extern QuartzModeProcsPtr quartzProcs;
+
+Bool QuartzLoadDisplayBundle(const char *dpyBundleName);
#endif
diff --git a/hw/darwin/quartz/quartzAudio.c b/hw/darwin/quartz/quartzAudio.c
index 2dfb313b7..a3e6af127 100644
--- a/hw/darwin/quartz/quartzAudio.c
+++ b/hw/darwin/quartz/quartzAudio.c
@@ -35,7 +35,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.2 2003/05/14 05:27:56 torrey Exp $ */
#include "quartzCommon.h"
#include "quartzAudio.h"
@@ -242,10 +242,10 @@ static void QuartzCoreAudioBell(
/*
- * QuartzBell
+ * DarwinModeBell
* Ring the bell
*/
-void QuartzBell(
+void DarwinModeBell(
int volume, // volume in percent of max
DeviceIntPtr pDevice,
pointer ctrl,
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m
index d6d9bbe32..bba71c041 100644
--- a/hw/darwin/quartz/quartzCocoa.m
+++ b/hw/darwin/quartz/quartzCocoa.m
@@ -33,12 +33,17 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.4 2003/05/14 05:27:56 torrey Exp $ */
+
+#include "quartzCommon.h"
+
+#define BOOL xBOOL
+#include "darwin.h"
+#undef BOOL
#include <Cocoa/Cocoa.h>
#import "Preferences.h"
-#include "quartzCommon.h"
#include "pseudoramiX.h"
extern void FatalError(const char *, ...);
@@ -57,7 +62,7 @@ void QuartzReadPreferences(void)
darwinFakeButtons = [Preferences fakeButtons];
darwinFakeMouse2Mask = [Preferences button2Mask];
darwinFakeMouse3Mask = [Preferences button3Mask];
- quartzMouseAccelChange = [Preferences mouseAccelChange];
+ darwinMouseAccelChange = [Preferences mouseAccelChange];
quartzUseSysBeep = [Preferences systemBeep];
// quartzRootless has already been set
diff --git a/hw/darwin/quartz/quartzCommon.h b/hw/darwin/quartz/quartzCommon.h
index 6c375bd04..e3ae4b850 100644
--- a/hw/darwin/quartz/quartzCommon.h
+++ b/hw/darwin/quartz/quartzCommon.h
@@ -31,7 +31,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.14 2003/11/12 20:21:51 torrey Exp $ */
#ifndef _QUARTZCOMMON_H
#define _QUARTZCOMMON_H
@@ -48,8 +48,6 @@
#undef WindowPtr
#undef Picture
-#include "quartzShared.h"
-
// Quartz specific per screen storage structure
typedef struct {
// List of CoreGraphics displays that this X11 screen covers.
@@ -78,11 +76,17 @@ extern int quartzServerQuitting;
extern int quartzScreenIndex;
extern int aquaMenuBarHeight;
+// Name of GLX bundle for native OpenGL
+extern const char *quartzOpenGLBundle;
+
void QuartzReadPreferences(void);
void QuartzMessageMainThread(unsigned msg, void *data, unsigned length);
+void QuartzMessageServerThread(int type, int argc, ...);
+void QuartzSetWindowMenu(int nitems, const char **items,
+ const char *shortcuts);
void QuartzFSCapture(void);
void QuartzFSRelease(void);
-int QuartzFSUseQDCursor(int depth);
+int QuartzFSUseQDCursor(int depth);
void QuartzBlockHandler(void *blockData, void *pTimeout, void *pReadmask);
void QuartzWakeupHandler(void *blockData, int result, void *pReadmask);
@@ -92,7 +96,11 @@ enum {
kQuartzServerStarted,
kQuartzServerDied,
kQuartzCursorUpdate,
- kQuartzPostEvent
+ kQuartzPostEvent,
+ kQuartzSetWindowMenu,
+ kQuartzSetWindowMenuCheck,
+ kQuartzSetFrontProcess,
+ kQuartzSetCanQuit
};
#endif /* _QUARTZCOMMON_H */
diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/darwin/quartz/quartzKeyboard.c
new file mode 100644
index 000000000..8d580830b
--- /dev/null
+++ b/hw/darwin/quartz/quartzKeyboard.c
@@ -0,0 +1,380 @@
+/*
+ quartzKeyboard.c
+ $Id$
+
+ Code to build a keymap using the Carbon Keyboard Layout API,
+ which is supported on Mac OS X 10.2 and newer.
+
+ Copyright (c) 2003 Apple Computer, 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 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/quartzKeyboard.c,v 1.1 2003/11/01 08:13:08 torrey Exp $ */
+
+#ifdef HAS_KL_API
+
+#include "quartzCommon.h"
+
+#include <CoreServices/CoreServices.h>
+#include <Carbon/Carbon.h>
+
+#include "darwinKeyboard.h"
+#include "keysym.h"
+#include "keysym2ucs.h"
+
+#define HACK_MISSING 1
+#define HACK_KEYPAD 1
+
+enum {
+ MOD_COMMAND = 256,
+ MOD_SHIFT = 512,
+ MOD_OPTION = 2048,
+ MOD_CONTROL = 4096,
+};
+
+#define UKEYSYM(u) ((u) | 0x01000000)
+
+/* Table of keycode->keysym mappings we use to fallback on for important
+ keys that are often not in the Unicode mapping. */
+
+const static struct {
+ unsigned short keycode;
+ KeySym keysym;
+} known_keys[] = {
+ {55, XK_Meta_L},
+ {56, XK_Shift_L},
+ {57, XK_Caps_Lock},
+ {58, XK_Alt_L},
+ {59, XK_Control_L},
+ {60, XK_Shift_R},
+ {61, XK_Alt_R},
+ {62, XK_Control_R},
+
+ {122, XK_F1},
+ {120, XK_F2},
+ {99, XK_F3},
+ {118, XK_F4},
+ {96, XK_F5},
+ {97, XK_F6},
+ {98, XK_F7},
+ {100, XK_F8},
+ {101, XK_F9},
+ {109, XK_F10},
+ {103, XK_F11},
+ {111, XK_F12},
+ {105, XK_F13},
+ {107, XK_F14},
+ {113, XK_F15},
+};
+
+/* Table of keycode->old,new-keysym mappings we use to fixup the numeric
+ keypad entries. */
+
+const static struct {
+ unsigned short keycode;
+ KeySym normal, keypad;
+} known_numeric_keys[] = {
+ {65, XK_period, XK_KP_Decimal},
+ {67, XK_asterisk, XK_KP_Multiply},
+ {69, XK_plus, XK_KP_Add},
+ {75, XK_slash, XK_KP_Divide},
+ {76, 0x01000003, XK_KP_Enter},
+ {78, XK_minus, XK_KP_Subtract},
+ {81, XK_equal, XK_KP_Equal},
+ {82, XK_0, XK_KP_0},
+ {83, XK_1, XK_KP_1},
+ {84, XK_2, XK_KP_2},
+ {85, XK_3, XK_KP_3},
+ {86, XK_4, XK_KP_4},
+ {87, XK_5, XK_KP_5},
+ {88, XK_6, XK_KP_6},
+ {89, XK_7, XK_KP_7},
+ {91, XK_8, XK_KP_8},
+ {92, XK_9, XK_KP_9},
+};
+
+/* Table mapping normal keysyms to their dead equivalents.
+ FIXME: all the unicode keysyms (apart from circumflex) were guessed. */
+
+const static struct {
+ KeySym normal, dead;
+} dead_keys[] = {
+ {XK_grave, XK_dead_grave},
+ {XK_acute, XK_dead_acute},
+ {XK_asciicircum, XK_dead_circumflex},
+ {UKEYSYM (0x2c6), XK_dead_circumflex}, /* MODIFIER LETTER CIRCUMFLEX ACCENT */
+ {XK_asciitilde, XK_dead_tilde},
+ {UKEYSYM (0x2dc), XK_dead_tilde}, /* SMALL TILDE */
+ {XK_macron, XK_dead_macron},
+ {XK_breve, XK_dead_breve},
+ {XK_abovedot, XK_dead_abovedot},
+ {XK_diaeresis, XK_dead_diaeresis},
+ {UKEYSYM (0x2da), XK_dead_abovering}, /* DOT ABOVE */
+ {XK_doubleacute, XK_dead_doubleacute},
+ {XK_caron, XK_dead_caron},
+ {XK_cedilla, XK_dead_cedilla},
+ {XK_ogonek, XK_dead_ogonek},
+ {UKEYSYM (0x269), XK_dead_iota}, /* LATIN SMALL LETTER IOTA */
+ {UKEYSYM (0x2ec), XK_dead_voiced_sound}, /* MODIFIER LETTER VOICING */
+/* {XK_semivoiced_sound, XK_dead_semivoiced_sound}, */
+ {UKEYSYM (0x323), XK_dead_belowdot}, /* COMBINING DOT BELOW */
+ {UKEYSYM (0x309), XK_dead_hook}, /* COMBINING HOOK ABOVE */
+ {UKEYSYM (0x31b), XK_dead_horn}, /* COMBINING HORN */
+};
+
+unsigned int
+DarwinSystemKeymapSeed (void)
+{
+ static unsigned int seed;
+
+ static KeyboardLayoutRef last_key_layout;
+ KeyboardLayoutRef key_layout;
+
+ KLGetCurrentKeyboardLayout (&key_layout);
+
+ if (key_layout != last_key_layout)
+ seed++;
+
+ last_key_layout = key_layout;
+
+ return seed;
+}
+
+static inline UniChar
+macroman2ucs (unsigned char c)
+{
+ /* Precalculated table mapping MacRoman-128 to Unicode. Generated
+ by creating single element CFStringRefs then extracting the
+ first character. */
+
+ static const unsigned short table[128] = {
+ 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1,
+ 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8,
+ 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3,
+ 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc,
+ 0x2020, 0xb0, 0xa2, 0xa3, 0xa7, 0x2022, 0xb6, 0xdf,
+ 0xae, 0xa9, 0x2122, 0xb4, 0xa8, 0x2260, 0xc6, 0xd8,
+ 0x221e, 0xb1, 0x2264, 0x2265, 0xa5, 0xb5, 0x2202, 0x2211,
+ 0x220f, 0x3c0, 0x222b, 0xaa, 0xba, 0x3a9, 0xe6, 0xf8,
+ 0xbf, 0xa1, 0xac, 0x221a, 0x192, 0x2248, 0x2206, 0xab,
+ 0xbb, 0x2026, 0xa0, 0xc0, 0xc3, 0xd5, 0x152, 0x153,
+ 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xf7, 0x25ca,
+ 0xff, 0x178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02,
+ 0x2021, 0xb7, 0x201a, 0x201e, 0x2030, 0xc2, 0xca, 0xc1,
+ 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4,
+ 0xf8ff, 0xd2, 0xda, 0xdb, 0xd9, 0x131, 0x2c6, 0x2dc,
+ 0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, 0x2c7,
+ };
+
+ if (c < 128)
+ return c;
+ else
+ return table[c - 128];
+}
+
+static KeySym
+make_dead_key (KeySym in)
+{
+ int i;
+
+ for (i = 0; i < sizeof (dead_keys) / sizeof (dead_keys[0]); i++)
+ {
+ if (dead_keys[i].normal == in)
+ return dead_keys[i].dead;
+ }
+
+ return in;
+}
+
+Bool
+DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
+{
+ KeyboardLayoutRef key_layout;
+ const void *chr_data;
+ int num_keycodes = NUM_KEYCODES;
+ UInt32 keyboard_type = 0;
+ int is_uchr, i, j;
+ OSStatus err;
+ KeySym *k;
+
+ KLGetCurrentKeyboardLayout (&key_layout);
+ KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
+
+ if (chr_data != NULL)
+ {
+ is_uchr = 1;
+ keyboard_type = LMGetKbdType ();
+ }
+ else
+ {
+ KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
+
+ if (chr_data == NULL)
+ {
+ ErrorF ( "Couldn't get uchr or kchr resource\n");
+ return FALSE;
+ }
+
+ is_uchr = 0;
+ num_keycodes = 128;
+ }
+
+
+ /* Scan the keycode range for the Unicode character that each
+ key produces in the four shift states. Then convert that to
+ an X11 keysym (which may just the bit that says "this is
+ Unicode" if it can't find the real symbol.) */
+
+ for (i = 0; i < num_keycodes; i++)
+ {
+ static const int mods[4] = {0, MOD_SHIFT, MOD_OPTION,
+ MOD_OPTION | MOD_SHIFT};
+
+ k = info->keyMap + i * GLYPHS_PER_KEY;
+
+ for (j = 0; j < 4; j++)
+ {
+ if (is_uchr)
+ {
+ UniChar s[8];
+ UniCharCount len;
+ UInt32 dead_key_state, extra_dead;
+
+ dead_key_state = 0;
+ err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
+ mods[j] >> 8, keyboard_type, 0,
+ &dead_key_state, 8, &len, s);
+ if (err != noErr)
+ continue;
+
+ if (len == 0 && dead_key_state != 0)
+ {
+ /* Found a dead key. Work out which one it is, but
+ remembering that it's dead. */
+
+ extra_dead = 0;
+ err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
+ mods[j] >> 8, keyboard_type,
+ kUCKeyTranslateNoDeadKeysMask,
+ &extra_dead, 8, &len, s);
+ if (err != noErr)
+ continue;
+ }
+
+ if (len > 0 && s[0] != 0x0010)
+ {
+ k[j] = ucs2keysym (s[0]);
+
+ if (dead_key_state != 0)
+ k[j] = make_dead_key (k[j]);
+ }
+ }
+ else
+ {
+ UInt32 c, state = 0;
+ UInt16 code;
+
+ code = i | mods[j];
+ c = KeyTranslate (chr_data, code, &state);
+
+ /* Dead keys are only processed on key-down, so ask
+ to translate those events. When we find a dead key,
+ translating the matching key up event will give
+ us the actual dead character. */
+
+ if (state != 0)
+ {
+ UInt32 state2 = 0;
+ c = KeyTranslate (chr_data, code | 128, &state2);
+ }
+
+ /* Characters seem to be in MacRoman encoding. */
+
+ if (c != 0 && c != 0x0010)
+ {
+ k[j] = ucs2keysym (macroman2ucs (c & 255));
+
+ if (state != 0)
+ k[j] = make_dead_key (k[j]);
+ }
+ }
+ }
+
+ 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;
+ }
+
+ /* Fix up some things that are normally missing.. */
+
+ if (HACK_MISSING)
+ {
+ for (i = 0; i < sizeof (known_keys) / sizeof (known_keys[0]); i++)
+ {
+ k = info->keyMap + known_keys[i].keycode * GLYPHS_PER_KEY;
+
+ if (k[0] == NoSymbol && k[1] == NoSymbol
+ && k[2] == NoSymbol && k[3] == NoSymbol)
+ {
+ k[0] = known_keys[i].keysym;
+ }
+ }
+ }
+
+ /* And some more things. We find the right symbols for the numeric
+ keypad, but not the KP_ keysyms. So try to convert known keycodes. */
+
+ if (HACK_KEYPAD)
+ {
+ for (i = 0; i < sizeof (known_numeric_keys)
+ / sizeof (known_numeric_keys[0]); i++)
+ {
+ k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY;
+
+ if (k[0] == known_numeric_keys[i].normal)
+ {
+ k[0] = known_numeric_keys[i].keypad;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+#else /* !HAS_KL_API */
+
+Bool
+DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
+{
+ return FALSE;
+}
+
+#endif /* HAS_KL_API */
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
index dfa7b8166..bb7c7d214 100644
--- a/hw/darwin/quartz/quartzStartup.c
+++ b/hw/darwin/quartz/quartzStartup.c
@@ -28,13 +28,14 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.9 2003/11/15 00:07:09 torrey Exp $ */
#include <fcntl.h>
#include <unistd.h>
#include <CoreFoundation/CoreFoundation.h>
#include "quartzCommon.h"
#include "darwin.h"
+#include "quartz.h"
#include "opaque.h"
#include "micmap.h"
@@ -50,6 +51,8 @@ static GlxExtensionInitPtr GlxExtensionInit = NULL;
typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *);
static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
+typedef Bool (*QuartzModeBundleInitPtr)(void);
+
/*
* DarwinHandleGUI
@@ -76,19 +79,25 @@ void DarwinHandleGUI(
// Make a pipe to pass events
assert( pipe(fd) == 0 );
- darwinEventFD = fd[0];
- quartzEventWriteFD = fd[1];
- fcntl(darwinEventFD, F_SETFL, O_NONBLOCK);
+ darwinEventReadFD = fd[0];
+ darwinEventWriteFD = fd[1];
+ fcntl(darwinEventReadFD, 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++) {
+ // Display version info without starting Mac OS X UI if requested
+ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+
+ // Determine if we need to start X clients
+ // and what display mode to use
if (!strcmp(argv[i], "-nostartx")) {
quartzStartClients = 0;
} else if (!strcmp( argv[i], "-fullscreen")) {
@@ -98,13 +107,70 @@ void DarwinHandleGUI(
}
}
- quartz = TRUE;
main_exit = NSApplicationMain(argc, argv);
exit(main_exit);
}
/*
+ * QuartzLoadDisplayBundle
+ * Try to load the appropriate bundle containing the back end display code.
+ */
+Bool QuartzLoadDisplayBundle(
+ const char *dpyBundleName)
+{
+ CFBundleRef mainBundle;
+ CFStringRef bundleName;
+ CFURLRef bundleURL;
+ CFBundleRef dpyBundle;
+ QuartzModeBundleInitPtr bundleInit;
+
+ // Get the main bundle for the application
+ mainBundle = CFBundleGetMainBundle();
+
+ // Make CFString from bundle name
+ bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
+ dpyBundleName,
+ kCFStringEncodingASCII,
+ kCFAllocatorNull);
+
+ // Look for the appropriate bundle in the main bundle
+ bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
+ NULL, NULL);
+ if (!bundleURL) {
+ ErrorF("Could not find display mode bundle %s.\n", dpyBundleName);
+ return FALSE;
+ }
+
+ // Make a bundle instance using the URLRef
+ dpyBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
+
+ if (!CFBundleLoadExecutable(dpyBundle)) {
+ ErrorF("Could not load display mode bundle %s.\n", dpyBundleName);
+ return FALSE;
+ }
+
+ // Lookup the bundle initialization function
+ bundleInit = (void *)
+ CFBundleGetFunctionPointerForName(dpyBundle,
+ CFSTR("QuartzModeBundleInit"));
+ if (!bundleInit) {
+ ErrorF("Could not initialize display mode bundle %s.\n",
+ dpyBundleName);
+ return FALSE;
+ }
+ if (!bundleInit())
+ return FALSE;
+
+ // Release the CF objects
+ CFRelease(bundleName);
+ CFRelease(bundleURL);
+
+ return TRUE;
+}
+
+
+/*
* LoadGlxBundle
* The Quartz mode X server needs to dynamically load the appropriate
* bundle before initializing GLX.
@@ -122,10 +188,14 @@ static void LoadGlxBundle(void)
// Choose the bundle to load
ErrorF("Loading GLX bundle ");
if (quartzUseAGL) {
- bundleName = CFSTR("glxAGL.bundle");
- ErrorF("glxAGL.bundle (using Apple's OpenGL)\n");
+ bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
+ quartzOpenGLBundle,
+ kCFStringEncodingASCII,
+ kCFAllocatorNull);
+ ErrorF("%s (using Apple's OpenGL)\n", quartzOpenGLBundle);
} else {
bundleName = CFSTR("glxMesa.bundle");
+ CFRetain(bundleName); // so we can release later
ErrorF("glxMesa.bundle (using Mesa)\n");
}
@@ -155,7 +225,7 @@ static void LoadGlxBundle(void)
}
// Release the CF objects
- CFRelease(mainBundle);
+ CFRelease(bundleName);
CFRelease(bundleURL);
}
@@ -186,7 +256,7 @@ void DarwinGlxWrapInitVisuals(
}
-int QuartzProcessArgument( int argc, char *argv[], int i )
+int DarwinModeProcessArgument( int argc, char *argv[], int i )
{
// fullscreen: CoreGraphics full-screen mode
// rootless: Cocoa rootless mode
@@ -208,7 +278,7 @@ int QuartzProcessArgument( int argc, char *argv[], int i )
QUARTZ_SAFETY_DELAY );
#endif
return 1;
- }
+ }
if ( !strcmp( argv[i], "-quartz" ) ) {
ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
diff --git a/hw/darwin/quartz/xpr/Xplugin.h b/hw/darwin/quartz/xpr/Xplugin.h
new file mode 100644
index 000000000..8985f7b11
--- /dev/null
+++ b/hw/darwin/quartz/xpr/Xplugin.h
@@ -0,0 +1,591 @@
+/* Xplugin.h -- windowing API for rootless X11 server
+ $Id$
+
+ Copyright (c) 2002 Apple Computer, 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 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.
+
+ Note that these interfaces are provided solely for the use of the
+ X11 server. Any other uses are unsupported and strongly discouraged. */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h,v 1.3 2003/06/27 20:21:42 torrey Exp $ */
+
+#ifndef XPLUGIN_H
+#define XPLUGIN_H 1
+
+#include <stdint.h>
+
+/* By default we use the X server definition of BoxRec to define xp_box,
+ so that the compiler can silently convert between the two. But if
+ XP_NO_X_HEADERS is defined, we'll define it ourselves. */
+
+#ifndef XP_NO_X_HEADERS
+# include "miscstruct.h"
+ typedef BoxRec xp_box;
+#else
+ struct xp_box_struct {
+ short x1, y1, x2, y2;
+ };
+ typedef struct xp_box_struct xp_box;
+#endif
+
+typedef unsigned int xp_resource_id;
+typedef xp_resource_id xp_window_id;
+typedef xp_resource_id xp_surface_id;
+typedef unsigned int xp_client_id;
+typedef unsigned int xp_request_type;
+typedef int xp_error;
+typedef int xp_bool;
+
+
+/* Error codes that the functions declared here may return. They all
+ numerically match their X equivalents, i.e. the XP_ can be dropped
+ if <X11/X.h> has been included. */
+
+enum xp_error_enum {
+ XP_Success = 0,
+ XP_BadRequest = 1,
+ XP_BadValue = 2,
+ XP_BadWindow = 3,
+ XP_BadMatch = 8,
+ XP_BadAccess = 10,
+ XP_BadImplementation = 17,
+};
+
+
+/* Event types generated by the plugin. */
+
+enum xp_event_type_enum {
+ /* The global display configuration changed somehow. */
+ XP_EVENT_DISPLAY_CHANGED = 1 << 0,
+
+ /* A window changed state. Argument is xp_window_state_event */
+ XP_EVENT_WINDOW_STATE_CHANGED = 1 << 1,
+
+ /* An async request encountered an error. Argument is of type
+ xp_async_error_event */
+ XP_EVENT_ASYNC_ERROR = 1 << 2,
+
+ /* Sent when a surface is destroyed as a side effect of destroying
+ a window. Arg is of type xp_surface_id. */
+ XP_EVENT_SURFACE_DESTROYED = 1 << 3,
+
+ /* Sent when any GL contexts pointing at the given surface need to
+ call xp_update_gl_context () to refresh their state (because the
+ window moved or was resized. Arg is of type xp_surface_id. */
+ XP_EVENT_SURFACE_CHANGED = 1 << 4,
+
+ /* Sent when a window has been moved. Arg is of type xp_window_id. */
+ XP_EVENT_WINDOW_MOVED = 1 << 5,
+};
+
+/* Function type used to receive events. */
+
+typedef void (xp_event_fun) (unsigned int type, const void *arg,
+ unsigned int arg_size, void *user_data);
+
+
+/* Operation types. Used when reporting errors asynchronously. */
+
+enum xp_request_type_enum {
+ XP_REQUEST_NIL = 0,
+ XP_REQUEST_DESTROY_WINDOW = 1,
+ XP_REQUEST_CONFIGURE_WINDOW = 2,
+ XP_REQUEST_FLUSH_WINDOW = 3,
+ XP_REQUEST_COPY_WINDOW = 4,
+ XP_REQUEST_UNLOCK_WINDOW = 5,
+ XP_REQUEST_DISABLE_UPDATE = 6,
+ XP_REQUEST_REENABLE_UPDATE = 7,
+ XP_REQUEST_HIDE_CURSOR = 8,
+ XP_REQUEST_SHOW_CURSOR = 9,
+ XP_REQUEST_FRAME_DRAW = 10,
+};
+
+/* Structure used to report an error asynchronously. Passed as the "arg"
+ of an XP_EVENT_ASYNC_ERROR event. */
+
+struct xp_async_error_event_struct {
+ xp_request_type request_type;
+ xp_resource_id id;
+ xp_error error;
+};
+
+typedef struct xp_async_error_event_struct xp_async_error_event;
+
+
+/* Possible window states. */
+
+enum xp_window_state_enum {
+ /* The window is not in the global list of possibly-visible windows. */
+ XP_WINDOW_STATE_OFFSCREEN = 1 << 0,
+
+ /* Parts of the window may be obscured by other windows. */
+ XP_WINDOW_STATE_OBSCURED = 1 << 1,
+};
+
+/* Structure passed as argument of an XP_EVENT_WINDOW_STATE_CHANGED event. */
+
+struct xp_window_state_event_struct {
+ xp_window_id id;
+ unsigned int state;
+};
+
+typedef struct xp_window_state_event_struct xp_window_state_event;
+
+
+/* Function type used to supply a colormap for indexed drawables. */
+
+typedef xp_error (xp_colormap_fun) (void *data, int first_color,
+ int n_colors, uint32_t *colors);
+
+
+/* Window attributes structure. Used when creating and configuring windows.
+ Also used when configuring surfaces attached to windows. Functions that
+ take one of these structures also take a bit mask defining which
+ fields are set to meaningful values. */
+
+enum xp_window_changes_enum {
+ XP_ORIGIN = 1 << 0,
+ XP_SIZE = 1 << 1,
+ XP_BOUNDS = XP_ORIGIN | XP_SIZE,
+ XP_SHAPE = 1 << 2,
+ XP_STACKING = 1 << 3,
+ XP_DEPTH = 1 << 4,
+ XP_COLORMAP = 1 << 5,
+ XP_WINDOW_LEVEL = 1 << 6,
+};
+
+struct xp_window_changes_struct {
+ /* XP_ORIGIN */
+ int x, y;
+
+ /* XP_SIZE */
+ unsigned int width, height;
+ int bit_gravity; /* how to resize the backing store */
+
+ /* XP_SHAPE */
+ int shape_nrects; /* -1 = remove shape */
+ xp_box *shape_rects;
+ int shape_tx, shape_ty; /* translation for shape */
+
+ /* XP_STACKING */
+ int stack_mode;
+ xp_window_id sibling; /* may be zero; in ABOVE/BELOW modes
+ it may specify a relative window */
+ /* XP_DEPTH, window-only */
+ unsigned int depth;
+
+ /* XP_COLORMAP, window-only */
+ xp_colormap_fun *colormap;
+ void *colormap_data;
+
+ /* XP_WINDOW_LEVEL, window-only */
+ int window_level;
+};
+
+typedef struct xp_window_changes_struct xp_window_changes;
+
+/* Values for bit_gravity field */
+
+enum xp_bit_gravity_enum {
+ XP_GRAVITY_NONE = 0, /* no gravity, fill everything */
+ XP_GRAVITY_NORTH_WEST = 1, /* anchor to top-left corner */
+ XP_GRAVITY_NORTH_EAST = 2, /* anchor to top-right corner */
+ XP_GRAVITY_SOUTH_EAST = 3, /* anchor to bottom-right corner */
+ XP_GRAVITY_SOUTH_WEST = 4, /* anchor to bottom-left corner */
+};
+
+/* Values for stack_mode field */
+
+enum xp_window_stack_mode_enum {
+ XP_UNMAPPED = 0, /* remove the window */
+ XP_MAPPED_ABOVE = 1, /* display the window on top */
+ XP_MAPPED_BELOW = 2, /* display the window at bottom */
+};
+
+/* Data formats for depth field and composite functions */
+
+enum xp_depth_enum {
+ XP_DEPTH_NIL = 0, /* null source when compositing */
+ XP_DEPTH_ARGB8888,
+ XP_DEPTH_RGB555,
+ XP_DEPTH_A8, /* for masks when compositing */
+ XP_DEPTH_INDEX8,
+};
+
+/* Options that may be passed to the xp_init () function. */
+
+enum xp_init_options_enum {
+ /* Don't mark that this process can be in the foreground. */
+ XP_IN_BACKGROUND = 1 << 0,
+
+ /* Deliver background pointer events to this process. */
+ XP_BACKGROUND_EVENTS = 1 << 1,
+};
+
+
+
+/* Miscellaneous functions */
+
+/* Initialize the plugin library. Only the copy/fill/composite functions
+ may be called without having previously called xp_init () */
+
+extern xp_error xp_init (unsigned int options);
+
+/* Sets the current set of requested notifications to MASK. When any of
+ these arrive, CALLBACK will be invoked with CALLBACK-DATA. Note that
+ calling this function cancels any previously requested notifications
+ that aren't set in MASK. */
+
+extern xp_error xp_select_events (unsigned int mask,
+ xp_event_fun *callback,
+ void *callback_data);
+
+/* Waits for all initiated operations to complete. */
+
+extern xp_error xp_synchronize (void);
+
+/* Causes any display update initiated through the plugin libary to be
+ queued until update is reenabled. Note that calls to these functions
+ nest. */
+
+extern xp_error xp_disable_update (void);
+extern xp_error xp_reenable_update (void);
+
+
+
+/* Cursor functions. */
+
+/* Installs the specified cursor. ARGB-DATA should point to 32-bit
+ premultiplied big-endian ARGB data. The HOT-X,HOT-Y parameters
+ specify the offset to the cursor's hot spot from its top-left
+ corner. */
+
+extern xp_error xp_set_cursor (unsigned int width, unsigned int height,
+ unsigned int hot_x, unsigned int hot_y,
+ const uint32_t *argb_data,
+ unsigned int rowbytes);
+
+/* Hide and show the cursor if it's owned by the current process. Calls
+ to these functions nest. */
+
+extern xp_error xp_hide_cursor (void);
+extern xp_error xp_show_cursor (void);
+
+
+
+/* Window functions. */
+
+/* Create a new window as defined by MASK and VALUES. MASK must contain
+ XP_BOUNDS or an error is raised. The id of the newly created window
+ is stored in *RET-ID if this function returns XP_Success. */
+
+extern xp_error xp_create_window (unsigned int mask,
+ const xp_window_changes *values,
+ xp_window_id *ret_id);
+
+/* Destroys the window identified by ID. */
+
+extern xp_error xp_destroy_window (xp_window_id id);
+
+/* Reconfigures the given window according to MASK and VALUES. */
+
+extern xp_error xp_configure_window (xp_window_id id, unsigned int mask,
+ const xp_window_changes *values);
+
+
+/* Returns true if NATIVE-ID is a window created by the plugin library.
+ If so and RET-ID is non-null, stores the id of the window in *RET-ID. */
+
+extern xp_bool xp_lookup_native_window (unsigned int native_id,
+ xp_window_id *ret_id);
+
+/* If ID names a window created by the plugin library, stores it's native
+ window id in *RET-NATIVE-ID. */
+
+extern xp_error xp_get_native_window (xp_window_id id,
+ unsigned int *ret_native_id);
+
+
+/* Locks the rectangle IN-RECT (or, if null, the entire window) of the
+ given window's backing store. Any other non-null parameters are filled
+ in as follows:
+
+ DEPTH = format of returned data. Currently either XP_DEPTH_ARGB8888
+ or XP_DEPTH_RGB565 (possibly with 8 bit planar alpha). Data is
+ always stored in native byte order.
+
+ BITS[0] = pointer to top-left pixel of locked color data
+ BITS[1] = pointer to top-left of locked alpha data, or null if window
+ has no alpha. If the alpha data is meshed, then BITS[1] = BITS[0].
+
+ ROWBYTES[0,1] = size in bytes of each row of color,alpha data
+
+ OUT-RECT = rectangle specifying the current position and size of the
+ locked region relative to the window origin.
+
+ Note that an error is raised when trying to lock an already locked
+ window. While the window is locked, the only operations that may
+ be performed on it are to modify, access or flush its marked region. */
+
+extern xp_error xp_lock_window (xp_window_id id,
+ const xp_box *in_rect,
+ unsigned int *depth,
+ void *bits[2],
+ unsigned int rowbytes[2],
+ xp_box *out_rect);
+
+/* Mark that the region specified by SHAPE-NRECTS, SHAPE-RECTS,
+ SHAPE-TX, and SHAPE-TY in the specified window has been updated, and
+ will need to subsequently be redisplayed. */
+
+extern xp_error xp_mark_window (xp_window_id id, int shape_nrects,
+ const xp_box *shape_rects,
+ int shape_tx, int shape_ty);
+
+/* Unlocks the specified window. If FLUSH is true, then any marked
+ regions are immediately redisplayed. Note that it's an error to
+ unlock an already unlocked window. */
+
+extern xp_error xp_unlock_window (xp_window_id id, xp_bool flush);
+
+/* If anything is marked in the given window for redisplay, do it now. */
+
+extern xp_error xp_flush_window (xp_window_id id);
+
+/* Moves the contents of the region DX,DY pixels away from that specified
+ by DST_RECTS and DST_NRECTS in the window with SRC-ID to the
+ destination region in the window DST-ID. Note that currently source
+ and destination windows must be the same. */
+
+extern xp_error xp_copy_window (xp_window_id src_id, xp_window_id dst_id,
+ int dst_nrects, const xp_box *dst_rects,
+ int dx, int dy);
+
+/* Returns true if the given window has any regions marked for
+ redisplay. */
+
+extern xp_bool xp_is_window_marked (xp_window_id id);
+
+/* If successful returns a superset of the region marked for update in
+ the given window. Use xp_free_region () to release the returned data. */
+
+extern xp_error xp_get_marked_shape (xp_window_id id,
+ int *ret_nrects, xp_box **ret_rects);
+
+extern void xp_free_shape (int nrects, xp_box *rects);
+
+/* Searches for the first window below ABOVE-ID containing the point X,Y,
+ and returns it's window id in *RET-ID. If no window is found, *RET-ID
+ is set to zero. If ABOVE-ID is zero, finds the topmost window
+ containing the given point. */
+
+extern xp_error xp_find_window (int x, int y, xp_window_id above_id,
+ xp_window_id *ret_id);
+
+/* Returns the current origin and size of the window ID in *BOUNDS-RET if
+ successful. */
+extern xp_error xp_get_window_bounds (xp_window_id id, xp_box *bounds_ret);
+
+
+
+/* Window surface functions. */
+
+/* Create a new VRAM surface on the specified window. If successful,
+ returns the identifier of the new surface in *RET-SID. */
+
+extern xp_error xp_create_surface (xp_window_id id, xp_surface_id *ret_sid);
+
+/* Destroys the specified surface. */
+
+extern xp_error xp_destroy_surface (xp_surface_id sid);
+
+/* Reconfigures the specified surface as defined by MASK and VALUES.
+ Note that specifying XP_DEPTH is an error. */
+
+extern xp_error xp_configure_surface (xp_surface_id sid, unsigned int mask,
+ const xp_window_changes *values);
+
+/* If successful, places the client identifier of the current process
+ in *RET-CLIENT. */
+
+extern xp_error xp_get_client_id (xp_client_id *ret_client);
+
+/* Given a valid window,surface combination created by the current
+ process, attempts to allow the specified external client access
+ to that surface. If successful, returns two integers in RET-KEY
+ which the client can use to import the surface into their process. */
+
+extern xp_error xp_export_surface (xp_window_id wid, xp_surface_id sid,
+ xp_client_id client,
+ unsigned int ret_key[2]);
+
+/* Given a two integer key returned from xp_export_surface (), tries
+ to import the surface into the current process. If successful the
+ local surface identifier is stored in *SID-RET. */
+
+extern xp_error xp_import_surface (const unsigned int key[2],
+ xp_surface_id *sid_ret);
+
+/* If successful, stores the number of surfaces attached to the
+ specified window in *RET. */
+
+extern xp_error xp_get_window_surface_count (xp_window_id id,
+ unsigned int *ret);
+
+/* Attaches the CGLContextObj CGL-CTX to the specified surface. */
+
+extern xp_error xp_attach_gl_context (void *cgl_ctx, xp_surface_id sid);
+
+/* Updates the CGLContextObj CGL-CTX to reflect any recent changes to
+ the surface it's attached to. */
+
+extern xp_error xp_update_gl_context (void *cgl_ctx);
+
+
+
+/* Window frame functions. */
+
+/* Possible arguments to xp_frame_get_rect (). */
+
+enum xp_frame_rect_enum {
+ XP_FRAME_RECT_TITLEBAR = 1,
+ XP_FRAME_RECT_TRACKING = 2,
+ XP_FRAME_RECT_GROWBOX = 3,
+};
+
+/* Classes of window frame. */
+
+enum xp_frame_class_enum {
+ XP_FRAME_CLASS_DOCUMENT = 1 << 0,
+ XP_FRAME_CLASS_DIALOG = 1 << 1,
+ XP_FRAME_CLASS_MODAL_DIALOG = 1 << 2,
+ XP_FRAME_CLASS_SYSTEM_MODAL_DIALOG = 1 << 3,
+ XP_FRAME_CLASS_UTILITY = 1 << 4,
+ XP_FRAME_CLASS_TOOLBAR = 1 << 5,
+ XP_FRAME_CLASS_MENU = 1 << 6,
+ XP_FRAME_CLASS_SPLASH = 1 << 7,
+ XP_FRAME_CLASS_BORDERLESS = 1 << 8,
+};
+
+/* Attributes of window frames. */
+
+enum xp_frame_attr_enum {
+ XP_FRAME_ACTIVE = 0x0001,
+ XP_FRAME_URGENT = 0x0002,
+ XP_FRAME_TITLE = 0x0004,
+ XP_FRAME_PRELIGHT = 0x0008,
+ XP_FRAME_SHADED = 0x0010,
+ XP_FRAME_CLOSE_BOX = 0x0100,
+ XP_FRAME_COLLAPSE = 0x0200,
+ XP_FRAME_ZOOM = 0x0400,
+ XP_FRAME_ANY_BUTTON = 0x0700,
+ XP_FRAME_CLOSE_BOX_CLICKED = 0x0800,
+ XP_FRAME_COLLAPSE_BOX_CLICKED = 0x1000,
+ XP_FRAME_ZOOM_BOX_CLICKED = 0x2000,
+ XP_FRAME_ANY_CLICKED = 0x3800,
+ XP_FRAME_GROW_BOX = 0x4000,
+};
+
+#define XP_FRAME_ATTR_IS_SET(a,b) (((a) & (b)) == (b))
+#define XP_FRAME_ATTR_IS_CLICKED(a,m) ((a) & ((m) << 3))
+#define XP_FRAME_ATTR_SET_CLICKED(a,m) ((a) |= ((m) << 3))
+#define XP_FRAME_ATTR_UNSET_CLICKED(a,m) ((a) &= ~((m) << 3))
+
+#define XP_FRAME_POINTER_ATTRS (XP_FRAME_PRELIGHT \
+ | XP_FRAME_ANY_BUTTON \
+ | XP_FRAME_ANY_CLICKED)
+
+extern xp_error xp_frame_get_rect (int type, int class, const xp_box *outer,
+ const xp_box *inner, xp_box *ret);
+extern xp_error xp_frame_hit_test (int class, int x, int y,
+ const xp_box *outer,
+ const xp_box *inner, int *ret);
+extern xp_error xp_frame_draw (xp_window_id wid, int class, unsigned int attr,
+ const xp_box *outer, const xp_box *inner,
+ unsigned int title_len,
+ const unsigned char *title_bytes);
+
+
+
+/* Memory manipulation functions. */
+
+enum xp_composite_op_enum {
+ XP_COMPOSITE_SRC = 0,
+ XP_COMPOSITE_OVER,
+};
+
+#define XP_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
+ (((op) << 24) | ((src_depth) << 16) \
+ | ((mask_depth) << 8) | ((dest_depth) << 0))
+
+#define XP_COMPOSITE_FUNCTION_OP(f) (((f) >> 24) & 255)
+#define XP_COMPOSITE_FUNCTION_SRC_DEPTH(f) (((f) >> 16) & 255)
+#define XP_COMPOSITE_FUNCTION_MASK_DEPTH(f) (((f) >> 8) & 255)
+#define XP_COMPOSITE_FUNCTION_DEST_DEPTH(f) (((f) >> 0) & 255)
+
+/* Composite WIDTH by HEIGHT pixels from source and mask to destination
+ using a specified function (if source and destination overlap,
+ undefined behavior results).
+
+ For SRC and DEST, the first element of the array is the color data. If
+ the second element is non-null it implies that there is alpha data
+ (which may be meshed or planar). Data without alpha is assumed to be
+ opaque.
+
+ Passing a null SRC-ROWBYTES pointer implies that the data SRC points
+ to is a single element.
+
+ Operations that are not supported will return XP_BadImplementation. */
+
+extern xp_error xp_composite_pixels (unsigned int width, unsigned int height,
+ unsigned int function,
+ void *src[2], unsigned int src_rowbytes[2],
+ void *mask, unsigned int mask_rowbytes,
+ void *dest[2], unsigned int dest_rowbytes[2]);
+
+/* Fill HEIGHT rows of data starting at DST. Each row will have WIDTH
+ bytes filled with the 32-bit pattern VALUE. Each row is DST-ROWBYTES
+ wide in total. */
+
+extern void xp_fill_bytes (unsigned int width,
+ unsigned int height, uint32_t value,
+ void *dst, unsigned int dst_rowbytes);
+
+/* Copy HEIGHT rows of bytes from SRC to DST. Each row will have WIDTH
+ bytes copied. SRC and DST may overlap, and the right thing will happen. */
+
+extern void xp_copy_bytes (unsigned int width, unsigned int height,
+ const void *src, unsigned int src_rowbytes,
+ void *dst, unsigned int dst_rowbytes);
+
+/* Suggestions for the minimum number of bytes or pixels for which it
+ makes sense to use some of the xp_ functions */
+
+extern unsigned int xp_fill_bytes_threshold, xp_copy_bytes_threshold,
+ xp_composite_area_threshold, xp_scroll_area_threshold;
+
+
+#endif /* XPLUGIN_H */
diff --git a/hw/darwin/quartz/xpr/appledri.c b/hw/darwin/quartz/xpr/appledri.c
new file mode 100644
index 000000000..3062d964a
--- /dev/null
+++ b/hw/darwin/quartz/xpr/appledri.c
@@ -0,0 +1,350 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 Apple Computer, 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@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#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 _APPLEDRI_SERVER_
+#include "appledristr.h"
+#include "swaprep.h"
+#include "dri.h"
+#include "dristruct.h"
+
+static int DRIErrorBase = 0;
+
+static DISPATCH_PROC(ProcAppleDRIDispatch);
+static DISPATCH_PROC(SProcAppleDRIDispatch);
+
+static void AppleDRIResetProc(ExtensionEntry* extEntry);
+
+static unsigned char DRIReqCode = 0;
+static int DRIEventBase = 0;
+
+static void SNotifyEvent(xAppleDRINotifyEvent *from, xAppleDRINotifyEvent *to);
+
+typedef struct _DRIEvent *DRIEventPtr;
+typedef struct _DRIEvent {
+ DRIEventPtr next;
+ ClientPtr client;
+ XID clientResource;
+ unsigned int mask;
+} DRIEventRec;
+
+
+void
+AppleDRIExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+ if (DRIExtensionInit() &&
+ (extEntry = AddExtension(APPLEDRINAME,
+ AppleDRINumberEvents,
+ AppleDRINumberErrors,
+ ProcAppleDRIDispatch,
+ SProcAppleDRIDispatch,
+ AppleDRIResetProc,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ DRIEventBase = extEntry->eventBase;
+ EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent;
+ }
+}
+
+/*ARGSUSED*/
+static void
+AppleDRIResetProc (
+ ExtensionEntry* extEntry
+)
+{
+ DRIReset();
+}
+
+static int
+ProcAppleDRIQueryVersion(
+ register ClientPtr client
+)
+{
+ xAppleDRIQueryVersionReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = APPLE_DRI_MAJOR_VERSION;
+ rep.minorVersion = APPLE_DRI_MINOR_VERSION;
+ rep.patchVersion = APPLE_DRI_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ }
+ WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+
+/* surfaces */
+
+static int
+ProcAppleDRIQueryDirectRenderingCapable(
+ register ClientPtr client
+)
+{
+ xAppleDRIQueryDirectRenderingCapableReply rep;
+ Bool isCapable;
+
+ REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
+ REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq);
+ 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(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleDRIAuthConnection(
+ register ClientPtr client
+)
+{
+ xAppleDRIAuthConnectionReply rep;
+
+ REQUEST(xAppleDRIAuthConnectionReq);
+ REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq);
+
+ 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(xAppleDRIAuthConnectionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static void surface_notify(
+ void *_arg,
+ void *data
+)
+{
+ DRISurfaceNotifyArg *arg = _arg;
+ int client_index = (int) data;
+ ClientPtr client;
+ xAppleDRINotifyEvent se;
+
+ if (client_index < 0 || client_index >= currentMaxClients)
+ return;
+
+ client = clients[client_index];
+ if (client == NULL || client == serverClient || client->clientGone)
+ return;
+
+ se.type = DRIEventBase + AppleDRISurfaceNotify;
+ se.kind = arg->kind;
+ se.arg = arg->id;
+ se.sequenceNumber = client->sequence;
+ se.time = currentTime.milliseconds;
+ WriteEventsToClient (client, 1, (xEvent *) &se);
+}
+
+static int
+ProcAppleDRICreateSurface(
+ ClientPtr client
+)
+{
+ xAppleDRICreateSurfaceReply rep;
+ DrawablePtr pDrawable;
+ xp_surface_id sid;
+ unsigned int key[2];
+
+ REQUEST(xAppleDRICreateSurfaceReq);
+ REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ rep.key_0 = rep.key_1 = rep.uid = 0;
+
+ if (!DRICreateSurface( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable, pDrawable,
+ stuff->client_id, &sid, key,
+ surface_notify, (void *) client->index)) {
+ return BadValue;
+ }
+
+ rep.key_0 = key[0];
+ rep.key_1 = key[1];
+ rep.uid = sid;
+
+ WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleDRIDestroySurface(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleDRIDestroySurfaceReq);
+ DrawablePtr pDrawable;
+ REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ if (!DRIDestroySurface( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable, NULL, NULL)) {
+ return BadValue;
+ }
+
+ return (client->noClientException);
+}
+
+
+/* dispatch */
+
+static int
+ProcAppleDRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_AppleDRIQueryVersion:
+ return ProcAppleDRIQueryVersion(client);
+ case X_AppleDRIQueryDirectRenderingCapable:
+ return ProcAppleDRIQueryDirectRenderingCapable(client);
+ }
+
+ if (!LocalClient(client))
+ return DRIErrorBase + AppleDRIClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_AppleDRIAuthConnection:
+ return ProcAppleDRIAuthConnection(client);
+ case X_AppleDRICreateSurface:
+ return ProcAppleDRICreateSurface(client);
+ case X_AppleDRIDestroySurface:
+ return ProcAppleDRIDestroySurface(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static void
+SNotifyEvent(
+ xAppleDRINotifyEvent *from,
+ xAppleDRINotifyEvent *to
+)
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->time, to->time);
+ cpswapl (from->arg, to->arg);
+}
+
+static int
+SProcAppleDRIQueryVersion(
+ register ClientPtr client
+)
+{
+ register int n;
+ REQUEST(xAppleDRIQueryVersionReq);
+ swaps(&stuff->length, n);
+ return ProcAppleDRIQueryVersion(client);
+}
+
+static int
+SProcAppleDRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return DRIErrorBase + AppleDRIClientNotLocal;
+
+ /* only local clients are allowed DRI access */
+ switch (stuff->data)
+ {
+ case X_AppleDRIQueryVersion:
+ return SProcAppleDRIQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
diff --git a/hw/darwin/quartz/xpr/dri.c b/hw/darwin/quartz/xpr/dri.c
new file mode 100644
index 000000000..aa595af85
--- /dev/null
+++ b/hw/darwin/quartz/xpr/dri.c
@@ -0,0 +1,690 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 Apple Computer, 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@valinux.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 _APPLEDRI_SERVER_
+#include "appledristr.h"
+#include "swaprep.h"
+#include "dri.h"
+#include "dristruct.h"
+#include "mi.h"
+#include "mipointer.h"
+#include "rootless.h"
+#include "x-hash.h"
+#include "x-hook.h"
+
+static int DRIScreenPrivIndex = -1;
+static int DRIWindowPrivIndex = -1;
+
+static RESTYPE DRIDrawablePrivResType;
+
+static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */
+
+/* FIXME: don't hardcode this? */
+#define CG_INFO_FILE "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/Info-macos.plist"
+
+/* Corresponds to SU Jaguar Green */
+#define CG_REQUIRED_MAJOR 1
+#define CG_REQUIRED_MINOR 157
+#define CG_REQUIRED_MICRO 11
+
+/* Returns version as major.minor.micro in 10.10.10 fixed form */
+static unsigned int
+get_cg_version (void)
+{
+ static unsigned int version;
+
+ FILE *fh;
+ char *ptr;
+
+ if (version != 0)
+ return version;
+
+ /* I tried CFBundleGetVersion, but it returns zero, so.. */
+
+ fh = fopen (CG_INFO_FILE, "r");
+ if (fh != NULL)
+ {
+ char buf[256];
+
+ while (fgets (buf, sizeof (buf), fh) != NULL)
+ {
+ unsigned char c;
+
+ if (!strstr (buf, "<key>CFBundleShortVersionString</key>")
+ || fgets (buf, sizeof (buf), fh) == NULL)
+ {
+ continue;
+ }
+
+ ptr = strstr (buf, "<string>");
+ if (ptr == NULL)
+ continue;
+
+ ptr += strlen ("<string>");
+
+ /* Now PTR points to "MAJOR.MINOR.MICRO". */
+
+ version = 0;
+
+ again:
+ switch ((c = *ptr++))
+ {
+ case '.':
+ version = version * 1024;
+ goto again;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ version = ((version & ~0x3ff)
+ + (version & 0x3ff) * 10 + (c - '0'));
+ goto again;
+ }
+ break;
+ }
+
+ fclose (fh);
+ }
+
+ return version;
+}
+
+static Bool
+test_cg_version (unsigned int major, unsigned int minor, unsigned int micro)
+{
+ unsigned int cg_ver = get_cg_version ();
+
+ unsigned int cg_major = (cg_ver >> 20) & 0x3ff;
+ unsigned int cg_minor = (cg_ver >> 10) & 0x3ff;
+ unsigned int cg_micro = cg_ver & 0x3ff;
+
+ if (cg_major > major)
+ return TRUE;
+ else if (cg_major < major)
+ return FALSE;
+
+ /* cg_major == major */
+
+ if (cg_minor > minor)
+ return TRUE;
+ else if (cg_minor < minor)
+ return FALSE;
+
+ /* cg_minor == minor */
+
+ if (cg_micro < micro)
+ return FALSE;
+
+ return TRUE;
+}
+
+Bool
+DRIScreenInit(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv;
+ int i;
+
+ pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec));
+ if (!pDRIPriv) {
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ return FALSE;
+ }
+
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv;
+ pDRIPriv->directRenderingSupport = TRUE;
+ pDRIPriv->nrWindows = 0;
+
+ /* Need recent cg for window access update */
+ if (!test_cg_version (CG_REQUIRED_MAJOR,
+ CG_REQUIRED_MINOR,
+ CG_REQUIRED_MICRO))
+ {
+ ErrorF ("[DRI] disabled direct rendering; requires CoreGraphics %d.%d.%d\n",
+ CG_REQUIRED_MAJOR, CG_REQUIRED_MINOR, CG_REQUIRED_MICRO);
+
+ pDRIPriv->directRenderingSupport = FALSE;
+
+ /* Note we don't nuke the dri private, since we need it for
+ managing indirect surfaces. */
+ }
+
+ /* Initialize drawable tables */
+ for (i = 0; i < DRI_MAX_DRAWABLES; i++) {
+ pDRIPriv->DRIDrawables[i] = NULL;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIFinishScreenInit(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ /* Allocate zero sized private area for each window. Should a window
+ * become a DRI window, we'll hang a DRIWindowPrivateRec off of this
+ * private index.
+ */
+ if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0))
+ return FALSE;
+
+ /* Wrap DRI support */
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = DRIValidateTree;
+
+ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = DRIPostValidateTree;
+
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = DRIWindowExposures;
+
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = DRICopyWindow;
+
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = DRIClipNotify;
+
+ ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum);
+
+ return TRUE;
+}
+
+void
+DRICloseScreen(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv && pDRIPriv->directRenderingSupport) {
+ xfree(pDRIPriv);
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ }
+}
+
+Bool
+DRIExtensionInit(void)
+{
+ static unsigned long DRIGeneration = 0;
+
+ if (DRIGeneration != serverGeneration) {
+ if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ DRIGeneration = serverGeneration;
+ }
+
+ /* 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);
+
+ 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
+DRIAuthConnection(ScreenPtr pScreen, unsigned int magic)
+{
+#if 0
+ /* FIXME: something? */
+
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE;
+#endif
+ return TRUE;
+}
+
+static void
+DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, WindowPtr pWin)
+{
+ WindowPtr pTopWin;
+ xp_window_changes wc;
+
+ if (pDRIDrawablePriv->sid == 0)
+ return;
+
+ pTopWin = TopLevelParent(pWin);
+
+ wc.x = pWin->drawable.x - (pTopWin->drawable.x - pTopWin->borderWidth);
+ wc.y = pWin->drawable.y - (pTopWin->drawable.y - pTopWin->borderWidth);
+ wc.width = pWin->drawable.width + 2 * pWin->borderWidth;
+ wc.height = pWin->drawable.height + 2 * pWin->borderWidth;
+ wc.bit_gravity = XP_GRAVITY_NONE;
+
+ wc.shape_nrects = REGION_NUM_RECTS(&pWin->clipList);
+ wc.shape_rects = REGION_RECTS(&pWin->clipList);
+ wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth);
+ wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth);
+
+ xp_configure_surface(pDRIDrawablePriv->sid, XP_BOUNDS | XP_SHAPE, &wc);
+}
+
+Bool
+DRICreateSurface (ScreenPtr pScreen, Drawable id,
+ DrawablePtr pDrawable, xp_client_id client_id,
+ xp_surface_id *surface_id, unsigned int ret_key[2],
+ void (*notify) (void *arg, void *data), void *notify_data)
+{
+ 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 {
+ xp_window_id wid;
+ xp_surface_id sid;
+ xp_error err;
+ unsigned int key[2];
+ xp_window_changes wc;
+
+ /* allocate a DRI Window Private record */
+ if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) {
+ return FALSE;
+ }
+
+ /* find the physical window */
+ wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE);
+ if (wid == 0) {
+ xfree (pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* allocate the physical surface */
+ err = xp_create_surface (wid, &sid);
+ if (err != Success) {
+ xfree (pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* try to give the client access to the surface */
+ if (client_id != 0)
+ {
+ err = xp_export_surface (wid, sid, client_id, key);
+ if (err != Success) {
+ xp_destroy_surface (sid);
+ xfree (pDRIDrawablePriv);
+ return FALSE;
+ }
+ }
+
+ /* Make it visible */
+ wc.stack_mode = XP_MAPPED_ABOVE;
+ wc.sibling = 0;
+ err = xp_configure_surface (sid, XP_STACKING, &wc);
+ if (err != Success)
+ {
+ xp_destroy_surface (sid);
+ xfree (pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* add it to the list of DRI drawables for this screen */
+ pDRIDrawablePriv->sid = sid;
+ pDRIDrawablePriv->pDraw = pDrawable;
+ pDRIDrawablePriv->pScreen = pScreen;
+ pDRIDrawablePriv->refCount = 1;
+ pDRIDrawablePriv->drawableIndex = -1;
+ pDRIDrawablePriv->key[0] = key[0];
+ pDRIDrawablePriv->key[1] = key[1];
+ pDRIDrawablePriv->notifiers = NULL;
+
+ /* save private off of preallocated index */
+ pWin->devPrivates[DRIWindowPrivIndex].ptr =
+ (pointer)pDRIDrawablePriv;
+
+ ++pDRIPriv->nrWindows;
+
+ /* and stash it by surface id */
+ if (surface_hash == NULL)
+ surface_hash = x_hash_table_new (NULL, NULL, NULL, NULL);
+ x_hash_table_insert (surface_hash, (void *) sid, pDRIDrawablePriv);
+
+ /* track this in case this window is destroyed */
+ AddResource(id, DRIDrawablePrivResType, (pointer)pWin);
+
+ /* Initialize shape */
+ DRIUpdateSurface (pDRIDrawablePriv, pWin);
+ }
+
+ if (notify != NULL) {
+ pDRIDrawablePriv->notifiers
+ = x_hook_add (pDRIDrawablePriv->notifiers,
+ notify, notify_data);
+ }
+
+ *surface_id = pDRIDrawablePriv->sid;
+
+ if (ret_key != NULL)
+ {
+ ret_key[0] = pDRIDrawablePriv->key[0];
+ ret_key[1] = pDRIDrawablePriv->key[1];
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ void (*notify) (void *, void *), void *notify_data)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ WindowPtr pWin;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ if (pDRIDrawablePriv != NULL) {
+ if (notify != NULL)
+ {
+ pDRIDrawablePriv->notifiers
+ = x_hook_remove (pDRIDrawablePriv->notifiers,
+ notify, notify_data);
+ }
+ if (--pDRIDrawablePriv->refCount <= 0) {
+ /* This calls back to DRIDrawablePrivDelete
+ which frees the 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) {
+ /* release drawable table entry */
+ pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
+ }
+
+ if (pDRIDrawablePriv->sid != 0) {
+ xp_destroy_surface (pDRIDrawablePriv->sid);
+ x_hash_table_remove (surface_hash, (void *) pDRIDrawablePriv->sid);
+ }
+
+ if (pDRIDrawablePriv->notifiers != NULL)
+ x_hook_free (pDRIDrawablePriv->notifiers);
+
+ xfree(pDRIDrawablePriv);
+ pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL;
+
+ --pDRIPriv->nrWindows;
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+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) {
+ /* FIXME: something? */
+ }
+
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+
+ (*pScreen->WindowExposures)(pWin, prgn, bsreg);
+
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = DRIWindowExposures;
+
+}
+
+void
+DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+
+ if (pDRIPriv->nrWindows > 0) {
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW (pWin);
+ if (pDRIDrawablePriv != NULL) {
+ DRIUpdateSurface (pDRIDrawablePriv, pWin);
+ }
+ }
+
+ /* unwrap */
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+
+ /* call lower layers */
+ (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
+
+ /* rewrap */
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = DRICopyWindow;
+}
+
+int
+DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen = pParent->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ int returnValue;
+
+ /* 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;
+ }
+ pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ 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;
+ }
+}
+
+void
+DRIClipNotify(WindowPtr pWin, int dx, int dy)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+ DRIUpdateSurface (pDRIDrawablePriv, pWin);
+ }
+
+ if(pDRIPriv->wrap.ClipNotify) {
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+
+ (*pScreen->ClipNotify)(pWin, dx, dy);
+
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = DRIClipNotify;
+ }
+}
+
+/* This lets us get at the unwrapped functions so that they can correctly
+ * call the lower level 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 = APPLE_DRI_MAJOR_VERSION;
+ *minorVersion = APPLE_DRI_MINOR_VERSION;
+ *patchVersion = APPLE_DRI_PATCH_VERSION;
+}
+
+void
+DRISurfaceNotify (xp_surface_id id, int kind)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv = NULL;
+ DRISurfaceNotifyArg arg;
+
+ arg.id = id;
+ arg.kind = kind;
+
+ if (surface_hash != NULL)
+ {
+ pDRIDrawablePriv = x_hash_table_lookup (surface_hash,
+ (void *) id, NULL);
+ }
+
+ if (pDRIDrawablePriv == NULL)
+ return;
+
+ if (kind == AppleDRISurfaceNotifyDestroyed)
+ {
+ pDRIDrawablePriv->sid = 0;
+ x_hash_table_remove (surface_hash, (void *) id);
+ }
+
+ x_hook_run (pDRIDrawablePriv->notifiers, &arg);
+
+ if (kind == AppleDRISurfaceNotifyDestroyed)
+ {
+ /* Kill off the handle. */
+
+ FreeResourceByType (pDRIDrawablePriv->pDraw->id,
+ DRIDrawablePrivResType, FALSE);
+ }
+}
diff --git a/hw/darwin/quartz/xpr/dri.h b/hw/darwin/quartz/xpr/dri.h
new file mode 100644
index 000000000..350f61b56
--- /dev/null
+++ b/hw/darwin/quartz/xpr/dri.h
@@ -0,0 +1,130 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright (c) 2002 Apple Computer, 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@precisioninsight.com>
+ *
+ */
+
+/* Prototypes for AppleDRI functions */
+
+#ifndef _DRI_H_
+
+#include "Xdefs.h"
+#include "scrnintstr.h"
+#define _APPLEDRI_SERVER_
+#include "appledri.h"
+#include "Xplugin.h"
+
+typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
+
+
+/*
+ * 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 {
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ ClipNotifyProcPtr ClipNotify;
+} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
+
+typedef struct {
+ xp_surface_id id;
+ int kind;
+} DRISurfaceNotifyArg;
+
+extern Bool DRIScreenInit(ScreenPtr pScreen);
+
+extern Bool DRIFinishScreenInit(ScreenPtr pScreen);
+
+extern void DRICloseScreen(ScreenPtr pScreen);
+
+extern Bool DRIExtensionInit(void);
+
+extern void DRIReset(void);
+
+extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
+ Bool *isCapable);
+
+extern Bool DRIAuthConnection(ScreenPtr pScreen, unsigned int magic);
+
+extern Bool DRICreateSurface(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable,
+ xp_client_id client_id,
+ xp_surface_id *surface_id,
+ unsigned int key[2],
+ void (*notify) (void *arg, void *data),
+ void *notify_data);
+
+extern Bool DRIDestroySurface(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable,
+ void (*notify) (void *arg, void *data),
+ void *notify_data);
+
+extern Bool DRIDrawablePrivDelete(pointer pResource,
+ XID id);
+
+extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
+
+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 void DRIWindowExposures(WindowPtr pWin,
+ RegionPtr prgn,
+ RegionPtr bsreg);
+
+extern void DRISurfaceNotify (xp_surface_id id, int kind);
+
+extern void DRIQueryVersion(int *majorVersion,
+ int *minorVersion,
+ int *patchVersion);
+
+#define _DRI_H_
+
+#endif
diff --git a/hw/darwin/quartz/xpr/dristruct.h b/hw/darwin/quartz/xpr/dristruct.h
new file mode 100644
index 000000000..1a2949b18
--- /dev/null
+++ b/hw/darwin/quartz/xpr/dristruct.h
@@ -0,0 +1,82 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dristruct.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright (c) 2002 Apple Computer, 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@precisioninsight.com>
+ *
+ */
+
+#ifndef DRI_STRUCT_H
+#define DRI_STRUCT_H
+
+#include "dri.h"
+#include "x-list.h"
+
+#define DRI_MAX_DRAWABLES 256
+
+#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
+{
+ xp_surface_id sid;
+ int drawableIndex;
+ DrawablePtr pDraw;
+ ScreenPtr pScreen;
+ int refCount;
+ unsigned int key[2];
+ x_list *notifiers; /* list of (FUN . DATA) */
+} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
+
+#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 nrWindows;
+ DRIWrappedFuncsRec wrap;
+ DrawablePtr DRIDrawables[DRI_MAX_DRAWABLES];
+} DRIScreenPrivRec, *DRIScreenPrivPtr;
+
+#endif /* DRI_STRUCT_H */
diff --git a/hw/darwin/quartz/xpr/x-hash.c b/hw/darwin/quartz/xpr/x-hash.c
new file mode 100644
index 000000000..ad36204c5
--- /dev/null
+++ b/hw/darwin/quartz/xpr/x-hash.c
@@ -0,0 +1,341 @@
+/* x-hash.c - basic hash tables
+ $Id$
+
+ Copyright (c) 2002 Apple Computer, 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 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/xpr/x-hash.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
+
+#include "x-hash.h"
+#include "x-list.h"
+#include <stdlib.h>
+#include <assert.h>
+
+struct x_hash_table_struct {
+ int bucket_index;
+ int total_keys;
+ x_list **buckets;
+
+ x_hash_fun *hash_key;
+ x_compare_fun *compare_keys;
+ x_destroy_fun *destroy_key;
+ x_destroy_fun *destroy_value;
+};
+
+#define ITEM_NEW(k, v) X_PFX (list_prepend) ((x_list *) (k), v)
+#define ITEM_FREE(i) X_PFX (list_free_1) (i)
+#define ITEM_KEY(i) ((void *) (i)->next)
+#define ITEM_VALUE(i) ((i)->data)
+
+#define SPLIT_THRESHOLD_FACTOR 2
+
+/* http://planetmath.org/?op=getobj&from=objects&name=GoodHashTablePrimes */
+static const unsigned int bucket_sizes[] = {
+ 29, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157,
+ 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917,
+ 25165843, 50331653, 100663319, 201326611, 402653189, 805306457,
+ 1610612741
+};
+
+#define N_BUCKET_SIZES (sizeof (bucket_sizes) / sizeof (bucket_sizes[0]))
+
+static inline unsigned int
+hash_table_total_buckets (x_hash_table *h)
+{
+ return bucket_sizes[h->bucket_index];
+}
+
+static inline void
+hash_table_destroy_item (x_hash_table *h, void *k, void *v)
+{
+ if (h->destroy_key != 0)
+ (*h->destroy_key) (k);
+
+ if (h->destroy_value != 0)
+ (*h->destroy_value) (v);
+}
+
+static inline unsigned int
+hash_table_hash_key (x_hash_table *h, void *k)
+{
+ if (h->hash_key != 0)
+ return (*h->hash_key) (k);
+ else
+ return (unsigned int) k;
+}
+
+static inline int
+hash_table_compare_keys (x_hash_table *h, void *k1, void *k2)
+{
+ if (h->compare_keys == 0)
+ return k1 == k2;
+ else
+ return (*h->compare_keys) (k1, k2) == 0;
+}
+
+static void
+hash_table_split (x_hash_table *h)
+{
+ x_list **new, **old;
+ x_list *node, *item, *next;
+ int new_size, old_size;
+ unsigned int b;
+ int i;
+
+ if (h->bucket_index == N_BUCKET_SIZES - 1)
+ return;
+
+ old_size = hash_table_total_buckets (h);
+ old = h->buckets;
+
+ h->bucket_index++;
+
+ new_size = hash_table_total_buckets (h);
+ new = calloc (new_size, sizeof (x_list *));
+
+ if (new == 0)
+ {
+ h->bucket_index--;
+ return;
+ }
+
+ for (i = 0; i < old_size; i++)
+ {
+ for (node = old[i]; node != 0; node = next)
+ {
+ next = node->next;
+ item = node->data;
+
+ b = hash_table_hash_key (h, ITEM_KEY (item)) % new_size;
+
+ node->next = new[b];
+ new[b] = node;
+ }
+ }
+
+ h->buckets = new;
+ free (old);
+}
+
+X_EXTERN x_hash_table *
+X_PFX (hash_table_new) (x_hash_fun *hash,
+ x_compare_fun *compare,
+ x_destroy_fun *key_destroy,
+ x_destroy_fun *value_destroy)
+{
+ x_hash_table *h;
+
+ h = calloc (1, sizeof (x_hash_table));
+ if (h == 0)
+ return 0;
+
+ h->bucket_index = 0;
+ h->buckets = calloc (hash_table_total_buckets (h), sizeof (x_list *));
+
+ if (h->buckets == 0)
+ {
+ free (h);
+ return 0;
+ }
+
+ h->hash_key = hash;
+ h->compare_keys = compare;
+ h->destroy_key = key_destroy;
+ h->destroy_value = value_destroy;
+
+ return h;
+}
+
+X_EXTERN void
+X_PFX (hash_table_free) (x_hash_table *h)
+{
+ int n, i;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ n = hash_table_total_buckets (h);
+
+ for (i = 0; i < n; i++)
+ {
+ for (node = h->buckets[i]; node != 0; node = node->next)
+ {
+ item = node->data;
+ hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item));
+ ITEM_FREE (item);
+ }
+ X_PFX (list_free) (h->buckets[i]);
+ }
+
+ free (h->buckets);
+ free (h);
+}
+
+X_EXTERN unsigned int
+X_PFX (hash_table_size) (x_hash_table *h)
+{
+ assert (h != NULL);
+
+ return h->total_keys;
+}
+
+static void
+hash_table_modify (x_hash_table *h, void *k, void *v, int replace)
+{
+ unsigned int hash_value;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ hash_value = hash_table_hash_key (h, k);
+
+ for (node = h->buckets[hash_value % hash_table_total_buckets (h)];
+ node != 0; node = node->next)
+ {
+ item = node->data;
+
+ if (hash_table_compare_keys (h, ITEM_KEY (item), k))
+ {
+ if (replace)
+ {
+ hash_table_destroy_item (h, ITEM_KEY (item),
+ ITEM_VALUE (item));
+ ITEM_KEY (item) = k;
+ ITEM_VALUE (item) = v;
+ }
+ else
+ {
+ hash_table_destroy_item (h, k, ITEM_VALUE (item));
+ ITEM_VALUE (item) = v;
+ }
+ return;
+ }
+ }
+
+ /* Key isn't already in the table. Insert it. */
+
+ if (h->total_keys + 1
+ > hash_table_total_buckets (h) * SPLIT_THRESHOLD_FACTOR)
+ {
+ hash_table_split (h);
+ }
+
+ hash_value = hash_value % hash_table_total_buckets (h);
+ h->buckets[hash_value] = X_PFX (list_prepend) (h->buckets[hash_value],
+ ITEM_NEW (k, v));
+ h->total_keys++;
+}
+
+X_EXTERN void
+X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v)
+{
+ hash_table_modify (h, k, v, 0);
+}
+
+X_EXTERN void
+X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v)
+{
+ hash_table_modify (h, k, v, 1);
+}
+
+X_EXTERN void
+X_PFX (hash_table_remove) (x_hash_table *h, void *k)
+{
+ unsigned int hash_value;
+ x_list **ptr, *item;
+
+ assert (h != NULL);
+
+ hash_value = hash_table_hash_key (h, k);
+
+ for (ptr = &h->buckets[hash_value % hash_table_total_buckets (h)];
+ *ptr != 0; ptr = &((*ptr)->next))
+ {
+ item = (*ptr)->data;
+
+ if (hash_table_compare_keys (h, ITEM_KEY (item), k))
+ {
+ hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item));
+ ITEM_FREE (item);
+ item = *ptr;
+ *ptr = item->next;
+ X_PFX (list_free_1) (item);
+ h->total_keys--;
+ return;
+ }
+ }
+}
+
+X_EXTERN void *
+X_PFX (hash_table_lookup) (x_hash_table *h, void *k, void **k_ret)
+{
+ unsigned int hash_value;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ hash_value = hash_table_hash_key (h, k);
+
+ for (node = h->buckets[hash_value % hash_table_total_buckets (h)];
+ node != 0; node = node->next)
+ {
+ item = node->data;
+
+ if (hash_table_compare_keys (h, ITEM_KEY (item), k))
+ {
+ if (k_ret != 0)
+ *k_ret = ITEM_KEY (item);
+
+ return ITEM_VALUE (item);
+ }
+ }
+
+ if (k_ret != 0)
+ *k_ret = 0;
+
+ return 0;
+}
+
+X_EXTERN void
+X_PFX (hash_table_foreach) (x_hash_table *h,
+ x_hash_foreach_fun *fun, void *data)
+{
+ int i, n;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ n = hash_table_total_buckets (h);
+
+ for (i = 0; i < n; i++)
+ {
+ for (node = h->buckets[i]; node != 0; node = node->next)
+ {
+ item = node->data;
+ (*fun) (ITEM_KEY (item), ITEM_VALUE (item), data);
+ }
+ }
+}
diff --git a/hw/darwin/quartz/xpr/x-hash.h b/hw/darwin/quartz/xpr/x-hash.h
new file mode 100644
index 000000000..2abb08cd7
--- /dev/null
+++ b/hw/darwin/quartz/xpr/x-hash.h
@@ -0,0 +1,62 @@
+/* x-hash.h -- basic hash table class
+ $Id$
+
+ Copyright (c) 2002 Apple Computer, 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 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/xpr/x-hash.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
+
+#ifndef X_HASH_H
+#define X_HASH_H 1
+
+typedef struct x_hash_table_struct x_hash_table;
+
+typedef int (x_compare_fun) (const void *a, const void *b);
+typedef unsigned int (x_hash_fun) (const void *k);
+typedef void (x_destroy_fun) (void *x);
+typedef void (x_hash_foreach_fun) (void *k, void *v, void *data);
+
+/* for X_PFX and X_EXTERN */
+#include "x-list.h"
+
+X_EXTERN x_hash_table *X_PFX (hash_table_new) (x_hash_fun *hash,
+ x_compare_fun *compare,
+ x_destroy_fun *key_destroy,
+ x_destroy_fun *value_destroy);
+X_EXTERN void X_PFX (hash_table_free) (x_hash_table *h);
+
+X_EXTERN unsigned int X_PFX (hash_table_size) (x_hash_table *h);
+
+X_EXTERN void X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v);
+X_EXTERN void X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v);
+X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k);
+X_EXTERN void *X_PFX (hash_table_lookup) (x_hash_table *h,
+ void *k, void **k_ret);
+X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h,
+ x_hash_foreach_fun *fun,
+ void *data);
+
+#endif /* X_HASH_H */
diff --git a/hw/darwin/quartz/xpr/x-hook.c b/hw/darwin/quartz/xpr/x-hook.c
new file mode 100644
index 000000000..3414e1543
--- /dev/null
+++ b/hw/darwin/quartz/xpr/x-hook.c
@@ -0,0 +1,106 @@
+/* x-hook.c
+ $Id$
+
+ Copyright (c) 2003 Apple Computer, 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 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/xpr/x-hook.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
+
+#include "x-hook.h"
+#include <stdlib.h>
+#include <assert.h>
+
+#define CELL_NEW(f,d) X_PFX (list_prepend) ((x_list *) (f), (d))
+#define CELL_FREE(c) X_PFX (list_free_1) (c)
+#define CELL_FUN(c) ((x_hook_function *) ((c)->next))
+#define CELL_DATA(c) ((c)->data)
+
+X_EXTERN x_list *
+X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data)
+{
+ return X_PFX (list_prepend) (lst, CELL_NEW (fun, data));
+}
+
+X_EXTERN x_list *
+X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data)
+{
+ x_list *node, *cell;
+ x_list *to_delete = NULL;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ cell = node->data;
+ if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data)
+ to_delete = X_PFX (list_prepend) (to_delete, cell);
+ }
+
+ for (node = to_delete; node != NULL; node = node->next)
+ {
+ cell = node->data;
+ lst = X_PFX (list_remove) (lst, cell);
+ CELL_FREE (cell);
+ }
+
+ X_PFX (list_free) (to_delete);
+}
+
+X_EXTERN void
+X_PFX (hook_run) (x_list *lst, void *arg)
+{
+ x_list *node, *cell;
+ x_hook_function **fun;
+ void **data;
+ int length, i;
+
+ length = X_PFX (list_length) (lst);
+ fun = alloca (sizeof (x_hook_function *) * length);
+ data = alloca (sizeof (void *) * length);
+
+ for (i = 0, node = lst; node != NULL; node = node->next, i++)
+ {
+ cell = node->data;
+ fun[i] = CELL_FUN (cell);
+ data[i] = CELL_DATA (cell);
+ }
+
+ for (i = 0; i < length; i++)
+ {
+ (*fun[i]) (arg, data[i]);
+ }
+}
+
+X_EXTERN void
+X_PFX (hook_free) (x_list *lst)
+{
+ x_list *node;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ CELL_FREE (node->data);
+ }
+
+ X_PFX (list_free) (lst);
+}
diff --git a/hw/darwin/quartz/xpr/x-hook.h b/hw/darwin/quartz/xpr/x-hook.h
new file mode 100644
index 000000000..14e8ca1f5
--- /dev/null
+++ b/hw/darwin/quartz/xpr/x-hook.h
@@ -0,0 +1,44 @@
+/* x-hook.h -- lists of function,data pairs to call.
+ $Id$
+
+ Copyright (c) 2003 Apple Computer, 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 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/xpr/x-hook.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */
+
+#ifndef X_HOOK_H
+#define X_HOOK_H 1
+
+#include "x-list.h"
+
+typedef void x_hook_function (void *arg, void *data);
+
+X_EXTERN x_list *X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data);
+X_EXTERN x_list *X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data);
+X_EXTERN void X_PFX (hook_run) (x_list *lst, void *arg);
+X_EXTERN void X_PFX (hook_free) (x_list *lst);
+
+#endif /* X_HOOK_H */
diff --git a/hw/darwin/quartz/xpr/x-list.c b/hw/darwin/quartz/xpr/x-list.c
new file mode 100644
index 000000000..859a5163d
--- /dev/null
+++ b/hw/darwin/quartz/xpr/x-list.c
@@ -0,0 +1,316 @@
+/* x-list.c
+ $Id$
+
+ Copyright (c) 2002 Apple Computer, 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 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/xpr/x-list.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
+
+#include "x-list.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <pthread.h>
+
+/* Allocate in ~4k blocks */
+#define NODES_PER_BLOCK 508
+
+typedef struct x_list_block_struct x_list_block;
+
+struct x_list_block_struct {
+ x_list l[NODES_PER_BLOCK];
+};
+
+static x_list *freelist;
+
+static pthread_mutex_t freelist_lock = PTHREAD_MUTEX_INITIALIZER;
+
+static inline void
+list_free_1 (x_list *node)
+{
+ node->next = freelist;
+ freelist = node;
+}
+
+X_EXTERN void
+X_PFX (list_free_1) (x_list *node)
+{
+ assert (node != NULL);
+
+ pthread_mutex_lock (&freelist_lock);
+
+ list_free_1 (node);
+
+ pthread_mutex_unlock (&freelist_lock);
+}
+
+X_EXTERN void
+X_PFX (list_free) (x_list *lst)
+{
+ x_list *next;
+
+ pthread_mutex_lock (&freelist_lock);
+
+ for (; lst != NULL; lst = next)
+ {
+ next = lst->next;
+ list_free_1 (lst);
+ }
+
+ pthread_mutex_unlock (&freelist_lock);
+}
+
+X_EXTERN x_list *
+X_PFX (list_prepend) (x_list *lst, void *data)
+{
+ x_list *node;
+
+ pthread_mutex_lock (&freelist_lock);
+
+ if (freelist == NULL)
+ {
+ x_list_block *b;
+ int i;
+
+ b = malloc (sizeof (x_list_block));
+
+ for (i = 0; i < NODES_PER_BLOCK - 1; i++)
+ b->l[i].next = &(b->l[i+1]);
+ b->l[i].next = NULL;
+
+ freelist = b->l;
+ }
+
+ node = freelist;
+ freelist = node->next;
+
+ pthread_mutex_unlock (&freelist_lock);
+
+ node->next = lst;
+ node->data = data;
+
+ return node;
+}
+
+X_EXTERN x_list *
+X_PFX (list_append) (x_list *lst, void *data)
+{
+ x_list *head = lst;
+
+ if (lst == NULL)
+ return X_PFX (list_prepend) (NULL, data);
+
+ while (lst->next != NULL)
+ lst = lst->next;
+
+ lst->next = X_PFX (list_prepend) (NULL, data);
+
+ return head;
+}
+
+X_EXTERN x_list *
+X_PFX (list_reverse) (x_list *lst)
+{
+ x_list *head = NULL, *next;
+
+ while (lst != NULL)
+ {
+ next = lst->next;
+ lst->next = head;
+ head = lst;
+ lst = next;
+ }
+
+ return head;
+}
+
+X_EXTERN x_list *
+X_PFX (list_find) (x_list *lst, void *data)
+{
+ for (; lst != NULL; lst = lst->next)
+ {
+ if (lst->data == data)
+ return lst;
+ }
+
+ return NULL;
+}
+
+X_EXTERN x_list *
+X_PFX (list_nth) (x_list *lst, int n)
+{
+ while (n-- > 0 && lst != NULL)
+ lst = lst->next;
+
+ return lst;
+}
+
+X_EXTERN x_list *
+X_PFX (list_filter) (x_list *lst,
+ int (*pred) (void *item, void *data), void *data)
+{
+ x_list *ret = NULL, *node;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ if ((*pred) (node->data, data))
+ ret = X_PFX (list_prepend) (ret, node->data);
+ }
+
+ return X_PFX (list_reverse) (ret);
+}
+
+X_EXTERN x_list *
+X_PFX (list_map) (x_list *lst,
+ void *(*fun) (void *item, void *data), void *data)
+{
+ x_list *ret = NULL, *node;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ X_PFX (list_prepend) (ret, fun (node->data, data));
+ }
+
+ return X_PFX (list_reverse) (ret);
+}
+
+X_EXTERN x_list *
+X_PFX (list_copy) (x_list *lst)
+{
+ x_list *copy = NULL;
+
+ for (; lst != NULL; lst = lst->next)
+ {
+ copy = X_PFX (list_prepend) (copy, lst->data);
+ }
+
+ return X_PFX (list_reverse) (copy);
+}
+
+X_EXTERN x_list *
+X_PFX (list_remove) (x_list *lst, void *data)
+{
+ x_list **ptr, *node;
+
+ for (ptr = &lst; *ptr != NULL;)
+ {
+ node = *ptr;
+
+ if (node->data == data)
+ {
+ *ptr = node->next;
+ X_PFX (list_free_1) (node);
+ }
+ else
+ ptr = &((*ptr)->next);
+ }
+
+ return lst;
+}
+
+X_EXTERN unsigned int
+X_PFX (list_length) (x_list *lst)
+{
+ unsigned int n;
+
+ n = 0;
+ for (; lst != NULL; lst = lst->next)
+ n++;
+
+ return n;
+}
+
+X_EXTERN void
+X_PFX (list_foreach) (x_list *lst,
+ void (*fun) (void *data, void *user_data),
+ void *user_data)
+{
+ for (; lst != NULL; lst = lst->next)
+ {
+ (*fun) (lst->data, user_data);
+ }
+}
+
+static x_list *
+list_sort_1 (x_list *lst, int length,
+ int (*less) (const void *, const void *))
+{
+ x_list *mid, *ptr;
+ x_list *out_head, *out;
+ int mid_point, i;
+
+ /* This is a standard (stable) list merge sort */
+
+ if (length < 2)
+ return lst;
+
+ /* Calculate the halfway point. Split the list into two sub-lists. */
+
+ mid_point = length / 2;
+ ptr = lst;
+ for (i = mid_point - 1; i > 0; i--)
+ ptr = ptr->next;
+ mid = ptr->next;
+ ptr->next = NULL;
+
+ /* Sort each sub-list. */
+
+ lst = list_sort_1 (lst, mid_point, less);
+ mid = list_sort_1 (mid, length - mid_point, less);
+
+ /* Then merge them back together. */
+
+ assert (lst != NULL && mid != NULL);
+
+ if ((*less) (mid->data, lst->data))
+ out = out_head = mid, mid = mid->next;
+ else
+ out = out_head = lst, lst = lst->next;
+
+ while (lst != NULL && mid != NULL)
+ {
+ if ((*less) (mid->data, lst->data))
+ out = out->next = mid, mid = mid->next;
+ else
+ out = out->next = lst, lst = lst->next;
+ }
+
+ if (lst != NULL)
+ out->next = lst;
+ else
+ out->next = mid;
+
+ return out_head;
+}
+
+X_EXTERN x_list *
+X_PFX (list_sort) (x_list *lst, int (*less) (const void *, const void *))
+{
+ int length;
+
+ length = X_PFX (list_length) (lst);
+
+ return list_sort_1 (lst, length, less);
+}
diff --git a/hw/darwin/quartz/xpr/x-list.h b/hw/darwin/quartz/xpr/x-list.h
new file mode 100644
index 000000000..a65cfcb7c
--- /dev/null
+++ b/hw/darwin/quartz/xpr/x-list.h
@@ -0,0 +1,78 @@
+/* x-list.h -- simple list type
+ $Id$
+
+ Copyright (c) 2002 Apple Computer, 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 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/xpr/x-list.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
+
+#ifndef X_LIST_H
+#define X_LIST_H 1
+
+/* This is just a cons. */
+
+typedef struct x_list_struct x_list;
+
+struct x_list_struct {
+ void *data;
+ x_list *next;
+};
+
+#ifndef X_PFX
+# define X_PFX(x) x_ ## x
+#endif
+
+#ifndef X_EXTERN
+# define X_EXTERN __private_extern__
+#endif
+
+X_EXTERN void X_PFX (list_free_1) (x_list *node);
+X_EXTERN x_list *X_PFX (list_prepend) (x_list *lst, void *data);
+
+X_EXTERN x_list *X_PFX (list_append) (x_list *lst, void *data);
+X_EXTERN x_list *X_PFX (list_remove) (x_list *lst, void *data);
+X_EXTERN void X_PFX (list_free) (x_list *lst);
+
+X_EXTERN x_list *X_PFX (list_copy) (x_list *lst);
+X_EXTERN x_list *X_PFX (list_reverse) (x_list *lst);
+X_EXTERN x_list *X_PFX (list_find) (x_list *lst, void *data);
+X_EXTERN x_list *X_PFX (list_nth) (x_list *lst, int n);
+X_EXTERN x_list *X_PFX (list_filter) (x_list *src,
+ int (*pred) (void *item, void *data),
+ void *data);
+X_EXTERN x_list *X_PFX (list_map) (x_list *src,
+ void *(*fun) (void *item, void *data),
+ void *data);
+
+X_EXTERN unsigned int X_PFX (list_length) (x_list *lst);
+X_EXTERN void X_PFX (list_foreach) (x_list *lst, void (*fun)
+ (void *data, void *user_data),
+ void *user_data);
+
+X_EXTERN x_list *X_PFX (list_sort) (x_list *lst, int (*less) (const void *,
+ const void *));
+
+#endif /* X_LIST_H */
diff --git a/hw/darwin/quartz/xpr/xpr.h b/hw/darwin/quartz/xpr/xpr.h
new file mode 100644
index 000000000..3d447b226
--- /dev/null
+++ b/hw/darwin/quartz/xpr/xpr.h
@@ -0,0 +1,47 @@
+/*
+ * Xplugin rootless implementation
+ */
+/*
+ * Copyright (c) 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/xpr/xpr.h,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
+
+#ifndef XPR_H
+#define XPR_H
+
+#include "screenint.h"
+
+extern Bool QuartzModeBundleInit(void);
+
+void AppleDRIExtensionInit(void);
+void xprAppleWMInit(void);
+Bool xprInit(ScreenPtr pScreen);
+Bool xprIsX11Window(void *nsWindow, int windowNumber);
+
+Bool QuartzInitCursor(ScreenPtr pScreen);
+void QuartzSuspendXCursor(ScreenPtr pScreen);
+void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
+
+#endif /* XPR_H */
diff --git a/hw/darwin/quartz/xpr/xprAppleWM.c b/hw/darwin/quartz/xpr/xprAppleWM.c
new file mode 100644
index 000000000..eca0de334
--- /dev/null
+++ b/hw/darwin/quartz/xpr/xprAppleWM.c
@@ -0,0 +1,99 @@
+/*
+ * Xplugin rootless implementation functions for AppleWM extension
+ */
+/*
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 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/xpr/xprAppleWM.c,v 1.1 2003/09/16 00:36:15 torrey Exp $ */
+
+#include "xpr.h"
+#include "applewmExt.h"
+#include "rootless.h"
+#include "Xplugin.h"
+#include "X.h"
+
+
+static int xprSetWindowLevel(
+ WindowPtr pWin,
+ int level)
+{
+ xp_window_id wid;
+ xp_window_changes wc;
+
+ wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE);
+ if (wid == 0)
+ return BadWindow;
+
+ RootlessStopDrawing (pWin, FALSE);
+
+ wc.window_level = level;
+ if (xp_configure_window (wid, XP_WINDOW_LEVEL, &wc) != Success) {
+ return BadValue;
+ }
+
+ return Success;
+}
+
+
+static int xprFrameDraw(
+ WindowPtr pWin,
+ int class,
+ unsigned int attr,
+ const BoxRec *outer,
+ const BoxRec *inner,
+ unsigned int title_len,
+ const unsigned char *title_bytes)
+{
+ xp_window_id wid;
+
+ wid = (xp_window_id) RootlessFrameForWindow (pWin, FALSE);
+ if (wid == 0)
+ return BadWindow;
+
+ if (xp_frame_draw (wid, class, attr, outer, inner,
+ title_len, title_bytes) != Success)
+ {
+ return BadValue;
+ }
+
+ return Success;
+}
+
+
+static AppleWMProcsRec xprAppleWMProcs = {
+ xp_disable_update,
+ xp_reenable_update,
+ xprSetWindowLevel,
+ xp_frame_get_rect,
+ xp_frame_hit_test,
+ xprFrameDraw
+};
+
+
+void xprAppleWMInit(void)
+{
+ AppleWMExtensionInit(&xprAppleWMProcs);
+}
diff --git a/hw/darwin/quartz/xpr/xprCursor.c b/hw/darwin/quartz/xpr/xprCursor.c
new file mode 100644
index 000000000..a3dea69e2
--- /dev/null
+++ b/hw/darwin/quartz/xpr/xprCursor.c
@@ -0,0 +1,420 @@
+/**************************************************************
+ *
+ * Xplugin cursor support
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
+ * Copyright (c) 2002 Apple Computer, 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 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/xpr/xprCursor.c,v 1.2 2003/09/16 00:36:15 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "xpr.h"
+#include "darwin.h"
+#include "Xplugin.h"
+
+#include "mi.h"
+#include "scrnintstr.h"
+#include "cursorstr.h"
+#include "mipointrst.h"
+#include "windowstr.h"
+#include "globals.h"
+#include "servermd.h"
+#include "dixevents.h"
+
+typedef struct {
+ int cursorVisible;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
+
+static int darwinCursorScreenIndex = -1;
+static unsigned long darwinCursorGeneration = 0;
+
+#define CURSOR_PRIV(pScreen) \
+ ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
+
+
+static Bool
+load_cursor(CursorPtr src, int screen)
+{
+ uint32_t *data;
+ uint32_t rowbytes;
+ int width, height;
+ int hot_x, hot_y;
+
+ uint32_t fg_color, bg_color;
+ uint8_t *srow, *sptr;
+ uint8_t *mrow, *mptr;
+ uint32_t *drow, *dptr;
+ unsigned xcount, ycount;
+
+ xp_error err;
+
+ width = src->bits->width;
+ height = src->bits->height;
+ hot_x = src->bits->xhot;
+ hot_y = src->bits->yhot;
+
+#ifdef ARGB_CURSOR
+ if (src->bits->argb != NULL)
+ {
+ rowbytes = src->bits->width * sizeof(CARD32);
+ data = (uint32_t *) src->bits->argb;
+ }
+ else
+#endif
+ {
+ fg_color = 0xFF00 | (src->foreRed >> 8);
+ fg_color <<= 16;
+ fg_color |= src->foreGreen & 0xFF00;
+ fg_color |= src->foreBlue >> 8;
+
+ bg_color = 0xFF00 | (src->backRed >> 8);
+ bg_color <<= 16;
+ bg_color |= src->backGreen & 0xFF00;
+ bg_color |= src->backBlue >> 8;
+
+ fg_color = htonl(fg_color);
+ bg_color = htonl(bg_color);
+
+ /* round up to 8 pixel boundary so we can convert whole bytes */
+ rowbytes = ((src->bits->width * 4) + 31) & ~31;
+ data = alloca(rowbytes * src->bits->height);
+
+ if (!src->bits->emptyMask)
+ {
+ ycount = src->bits->height;
+ srow = src->bits->source; mrow = src->bits->mask;
+ drow = data;
+
+ while (ycount-- > 0)
+ {
+ xcount = (src->bits->width + 7) / 8;
+ sptr = srow; mptr = mrow;
+ dptr = drow;
+
+ while (xcount-- > 0)
+ {
+ uint8_t s, m;
+ int i;
+
+ s = *sptr++; m = *mptr++;
+ for (i = 0; i < 8; i++)
+ {
+#if BITMAP_BIT_ORDER == MSBFirst
+ if (m & 128)
+ *dptr++ = (s & 128) ? fg_color : bg_color;
+ else
+ *dptr++ = 0;
+ s <<= 1; m <<= 1;
+#else
+ if (m & 1)
+ *dptr++ = (s & 1) ? fg_color : bg_color;
+ else
+ *dptr++ = 0;
+ s >>= 1; m >>= 1;
+#endif
+ }
+ }
+
+ srow += BitmapBytePad(src->bits->width);
+ mrow += BitmapBytePad(src->bits->width);
+ drow = (uint32_t *) ((char *) drow + rowbytes);
+ }
+ }
+ else
+ {
+ memset(data, 0, src->bits->height * rowbytes);
+ }
+ }
+
+ err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes);
+ return err == Success;
+}
+
+
+/*
+===========================================================================
+
+ Pointer sprite functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzRealizeCursor
+ * Convert the X cursor representation to native format if possible.
+ */
+static Bool
+QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+{
+ if(pCursor == NULL || pCursor->bits == NULL)
+ return FALSE;
+
+ /* FIXME: cache ARGB8888 representation? */
+
+ return TRUE;
+}
+
+
+/*
+ * QuartzUnrealizeCursor
+ * Free the storage space associated with a realized cursor.
+ */
+static Bool
+QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+{
+ return TRUE;
+}
+
+
+/*
+ * QuartzSetCursor
+ * Set the cursor sprite and position.
+ */
+static void
+QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if (!quartzServerVisible)
+ return;
+
+ if (pCursor == NULL)
+ {
+ if (ScreenPriv->cursorVisible)
+ {
+ xp_hide_cursor();
+ ScreenPriv->cursorVisible = FALSE;
+ }
+ }
+ else
+ {
+ load_cursor(pCursor, pScreen->myNum);
+
+ if (!ScreenPriv->cursorVisible)
+ {
+ xp_show_cursor();
+ ScreenPriv->cursorVisible = TRUE;
+ }
+ }
+}
+
+
+/*
+ * QuartzMoveCursor
+ * Move the cursor. This is a noop for us.
+ */
+static void
+QuartzMoveCursor(ScreenPtr pScreen, int x, int 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 Bool neverMoved = TRUE;
+
+ if (neverMoved)
+ {
+ /* Don't move the cursor the first time. This is the
+ jump-to-center initialization, and it's annoying. */
+ neverMoved = FALSE;
+ return;
+ }
+
+ if (quartzServerVisible)
+ {
+ int sx, sy;
+
+ sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
+ sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+
+ CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y));
+ }
+
+ 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)
+ {
+ /* FIXME: query window server? */
+ *width = 32;
+ *height = 32;
+ }
+ else
+ {
+ (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
+ }
+}
+
+/*
+ * QuartzInitCursor
+ * Initialize cursor support
+ */
+Bool
+QuartzInitCursor(ScreenPtr pScreen)
+{
+ QuartzCursorScreenPtr ScreenPriv;
+ miPointerScreenPtr PointPriv;
+
+ /* 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 == NULL)
+ return FALSE;
+
+ CURSOR_PRIV(pScreen) = ScreenPriv;
+
+ /* override some screen procedures */
+ ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
+ pScreen->QueryBestSize = QuartzCursorQueryBestSize;
+
+ PointPriv = (miPointerScreenPtr) pScreen->devPrivates[miPointerScreenIndex].ptr;
+
+ ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
+ PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
+
+ ScreenPriv->cursorVisible = TRUE;
+ return TRUE;
+}
+
+
+/*
+ * QuartzSuspendXCursor
+ * X server is hiding. Restore the Aqua cursor.
+ */
+void
+QuartzSuspendXCursor(ScreenPtr pScreen)
+{
+}
+
+
+/*
+ * QuartzResumeXCursor
+ * X server is showing. Restore the X cursor.
+ */
+void
+QuartzResumeXCursor(ScreenPtr pScreen, int x, int y)
+{
+ WindowPtr pWin;
+ CursorPtr pCursor;
+
+ pWin = GetSpriteWindow();
+ if (pWin->drawable.pScreen != pScreen)
+ return;
+
+ pCursor = GetSpriteCursor();
+ if (pCursor == NULL)
+ return;
+
+ QuartzSetCursor(pScreen, pCursor, x, y);
+}
diff --git a/hw/darwin/quartz/xpr/xprFrame.c b/hw/darwin/quartz/xpr/xprFrame.c
new file mode 100644
index 000000000..ae24bc42a
--- /dev/null
+++ b/hw/darwin/quartz/xpr/xprFrame.c
@@ -0,0 +1,439 @@
+/*
+ * Xplugin rootless implementation frame functions
+ */
+/*
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 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/xpr/xprFrame.c,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
+
+#include "xpr.h"
+#include "rootless.h"
+#include "Xplugin.h"
+#include "x-hash.h"
+#include "x-list.h"
+
+#include "propertyst.h"
+#include "dix.h"
+#include "Xatom.h"
+#include "windowstr.h"
+
+#include <pthread.h>
+
+#define DEFINE_ATOM_HELPER(func,atom_name) \
+static Atom func (void) { \
+ static int generation; \
+ static Atom atom; \
+ if (generation != serverGeneration) { \
+ generation = serverGeneration; \
+ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
+ } \
+ return atom; \
+}
+
+DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID")
+
+/* Maps xp_window_id -> RootlessWindowRec */
+static x_hash_table *window_hash;
+static pthread_mutex_t window_hash_mutex;
+
+static Bool no_configure_window;
+
+
+static inline xp_error
+xprConfigureWindow(xp_window_id id, unsigned int mask,
+ const xp_window_changes *values)
+{
+ if (!no_configure_window)
+ return xp_configure_window(id, mask, values);
+ else
+ return XP_Success;
+}
+
+
+static void
+xprSetNativeProperty(RootlessWindowPtr pFrame)
+{
+ xp_error err;
+ unsigned int native_id;
+ long data;
+
+ err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id);
+ if (err == Success)
+ {
+ /* FIXME: move this to AppleWM extension */
+
+ data = native_id;
+ ChangeWindowProperty(pFrame->win, xa_native_window_id(),
+ XA_INTEGER, 32, PropModeReplace, 1, &data, TRUE);
+ }
+}
+
+
+/*
+ * Create and display a new frame.
+ */
+Bool
+xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
+ int newX, int newY, RegionPtr pShape)
+{
+ WindowPtr pWin = pFrame->win;
+ xp_window_changes wc;
+ unsigned int mask = 0;
+ xp_error err;
+
+ wc.x = newX;
+ wc.y = newY;
+ wc.width = pFrame->width;
+ wc.height = pFrame->height;
+ wc.bit_gravity = XP_GRAVITY_NONE;
+ mask |= XP_BOUNDS;
+
+ if (pWin->drawable.depth == 8)
+ {
+ wc.depth = XP_DEPTH_INDEX8;
+#if 0
+ wc.colormap = xprColormapCallback;
+ wc.colormap_data = pScreen;
+ mask |= XP_COLORMAP;
+#endif
+ }
+ else if (pWin->drawable.depth == 15)
+ wc.depth = XP_DEPTH_RGB555;
+ else if (pWin->drawable.depth == 24)
+ wc.depth = XP_DEPTH_ARGB8888;
+ else
+ wc.depth = XP_DEPTH_NIL;
+ mask |= XP_DEPTH;
+
+ if (pShape != NULL)
+ {
+ wc.shape_nrects = REGION_NUM_RECTS(pShape);
+ wc.shape_rects = REGION_RECTS(pShape);
+ wc.shape_tx = wc.shape_ty = 0;
+ mask |= XP_SHAPE;
+ }
+
+ err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid);
+
+ if (err != Success)
+ {
+ return FALSE;
+ }
+
+ if (window_hash == NULL)
+ {
+ window_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
+ pthread_mutex_init(&window_hash_mutex, NULL);
+ }
+
+ pthread_mutex_lock(&window_hash_mutex);
+ x_hash_table_insert(window_hash, pFrame->wid, pFrame);
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ xprSetNativeProperty(pFrame);
+
+ return TRUE;
+}
+
+
+/*
+ * Destroy a frame.
+ */
+void
+xprDestroyFrame(RootlessFrameID wid)
+{
+ pthread_mutex_lock(&window_hash_mutex);
+ x_hash_table_remove(window_hash, wid);
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ xp_destroy_window((xp_window_id) wid);
+}
+
+
+/*
+ * Move a frame on screen.
+ */
+void
+xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
+{
+ xp_window_changes wc;
+
+ wc.x = newX;
+ wc.y = newY;
+
+ xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc);
+}
+
+
+/*
+ * Resize and move a frame.
+ */
+void
+xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
+ int newX, int newY, unsigned int newW, unsigned int newH,
+ unsigned int gravity)
+{
+ xp_window_changes wc;
+
+ wc.x = newX;
+ wc.y = newY;
+ wc.width = newW;
+ wc.height = newH;
+ wc.bit_gravity = gravity;
+
+ /* It's unlikely that being async will save us anything here.
+ But it can't hurt. */
+
+ xprConfigureWindow((xp_window_id) wid, XP_BOUNDS, &wc);
+}
+
+
+/*
+ * Change frame stacking.
+ */
+void
+xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
+{
+ xp_window_changes wc;
+
+ /* Stack frame below nextWid it if it exists, or raise
+ frame above everything otherwise. */
+
+ if (nextWid == NULL)
+ {
+ wc.stack_mode = XP_MAPPED_ABOVE;
+ wc.sibling = 0;
+ }
+ else
+ {
+ wc.stack_mode = XP_MAPPED_BELOW;
+ wc.sibling = (xp_window_id) nextWid;
+ }
+
+ xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
+}
+
+
+/*
+ * Change the frame's shape.
+ */
+void
+xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
+{
+ xp_window_changes wc;
+
+ if (pShape != NULL)
+ {
+ wc.shape_nrects = REGION_NUM_RECTS(pShape);
+ wc.shape_rects = REGION_RECTS(pShape);
+ }
+ else
+ {
+ wc.shape_nrects = -1;
+ wc.shape_rects = NULL;
+ }
+
+ wc.shape_tx = wc.shape_ty = 0;
+
+ xprConfigureWindow((xp_window_id) wid, XP_SHAPE, &wc);
+}
+
+
+/*
+ * Unmap a frame.
+ */
+void
+xprUnmapFrame(RootlessFrameID wid)
+{
+ xp_window_changes wc;
+
+ wc.stack_mode = XP_UNMAPPED;
+ wc.sibling = 0;
+
+ xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
+}
+
+
+/*
+ * Start drawing to a frame.
+ * Prepare for direct access to its backing buffer.
+ */
+void
+xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
+{
+ void *data[2];
+ unsigned int rowbytes[2];
+ xp_error err;
+
+ err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL);
+ if (err != Success)
+ FatalError("Could not lock window %i for drawing.", (int) wid);
+
+ *pixelData = data[0];
+ *bytesPerRow = rowbytes[0];
+}
+
+
+/*
+ * Stop drawing to a frame.
+ */
+void
+xprStopDrawing(RootlessFrameID wid, Bool flush)
+{
+ xp_unlock_window((xp_window_id) wid, flush);
+}
+
+
+/*
+ * Flush drawing updates to the screen.
+ */
+void
+xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
+{
+ xp_flush_window((xp_window_id) wid);
+}
+
+
+/*
+ * Mark damaged rectangles as requiring redisplay to screen.
+ */
+void
+xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects,
+ int shift_x, int shift_y)
+{
+ xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y);
+}
+
+
+/*
+ * Called after the window associated with a frame has been switched
+ * to a new top-level parent.
+ */
+void
+xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
+{
+ DeleteProperty(oldWin, xa_native_window_id());
+
+ xprSetNativeProperty(pFrame);
+}
+
+
+/*
+ * Copy area in frame to another part of frame.
+ * Used to accelerate scrolling.
+ */
+void
+xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
+ int dx, int dy)
+{
+ xp_copy_window((xp_window_id) wid, (xp_window_id) wid,
+ dstNrects, dstRects, dx, dy);
+}
+
+
+static RootlessFrameProcsRec xprRootlessProcs = {
+ xprCreateFrame,
+ xprDestroyFrame,
+ xprMoveFrame,
+ xprResizeFrame,
+ xprRestackFrame,
+ xprReshapeFrame,
+ xprUnmapFrame,
+ xprStartDrawing,
+ xprStopDrawing,
+ xprUpdateRegion,
+ xprDamageRects,
+ xprSwitchWindow,
+ xp_copy_bytes,
+ xp_fill_bytes,
+ xp_composite_pixels,
+ xprCopyWindow
+};
+
+
+/*
+ * Initialize XPR implementation
+ */
+Bool
+xprInit(ScreenPtr pScreen)
+{
+ RootlessInit(pScreen, &xprRootlessProcs);
+
+ rootless_CopyBytes_threshold = xp_copy_bytes_threshold;
+ rootless_FillBytes_threshold = xp_fill_bytes_threshold;
+ rootless_CompositePixels_threshold = xp_composite_area_threshold;
+ rootless_CopyWindow_threshold = xp_scroll_area_threshold;
+
+ no_configure_window = FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * Given the id of a physical window, try to find the top-level (or root)
+ * X window that it represents.
+ */
+static WindowPtr
+xprGetXWindow(xp_window_id wid)
+{
+ RootlessWindowRec *winRec;
+
+ if (window_hash == NULL)
+ return NULL;
+
+ winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL);
+
+ return winRec != NULL ? winRec->win : NULL;
+}
+
+
+/*
+ * The windowNumber is an AppKit window number. Returns TRUE if xpr is
+ * displaying a window with that number.
+ */
+Bool
+xprIsX11Window(void *nsWindow, int windowNumber)
+{
+ Bool ret;
+ xp_window_id wid;
+
+ if (window_hash == NULL)
+ return FALSE;
+
+ /* need to lock, since this function can be called by any thread */
+
+ pthread_mutex_lock(&window_hash_mutex);
+
+ if (xp_lookup_native_window(windowNumber, &wid))
+ ret = xprGetXWindow(wid) != NULL;
+ else
+ ret = FALSE;
+
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ return ret;
+}
diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c
new file mode 100644
index 000000000..8090a27b1
--- /dev/null
+++ b/hw/darwin/quartz/xpr/xprScreen.c
@@ -0,0 +1,378 @@
+/*
+ * Xplugin rootless implementation screen functions
+ */
+/*
+ * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 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/xpr/xprScreen.c,v 1.8 2003/11/12 20:21:52 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "quartz.h"
+#include "xpr.h"
+#include "pseudoramiX.h"
+#include "darwin.h"
+#include "rootless.h"
+#include "safeAlpha.h"
+#include "dri.h"
+#include "globals.h"
+#include "Xplugin.h"
+#include "applewmExt.h"
+
+// Name of GLX bundle for native OpenGL
+static const char *xprOpenGLBundle = "glxCGL.bundle";
+
+
+/*
+ * eventHandler
+ * Callback handler for Xplugin events.
+ */
+static void
+eventHandler(unsigned int type, const void *arg,
+ unsigned int arg_size, void *data)
+{
+ switch (type)
+ {
+ case XP_EVENT_DISPLAY_CHANGED:
+ QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
+ break;
+
+ case XP_EVENT_WINDOW_STATE_CHANGED:
+ if (arg_size >= sizeof(xp_window_state_event))
+ {
+ const xp_window_state_event *ws_arg = arg;
+ QuartzMessageServerThread(kXDarwinWindowState, 2,
+ ws_arg->id, ws_arg->state);
+ }
+ break;
+
+ case XP_EVENT_WINDOW_MOVED:
+ if (arg_size == sizeof(xp_window_id))
+ {
+ xp_window_id id = * (xp_window_id *) arg;
+
+ QuartzMessageServerThread(kXDarwinWindowMoved, 1, id);
+ }
+ break;
+
+ case XP_EVENT_SURFACE_DESTROYED:
+ case XP_EVENT_SURFACE_CHANGED:
+ if (arg_size == sizeof(xp_surface_id))
+ {
+ int kind;
+
+ if (type == XP_EVENT_SURFACE_DESTROYED)
+ kind = AppleDRISurfaceNotifyDestroyed;
+ else
+ kind = AppleDRISurfaceNotifyChanged;
+
+ DRISurfaceNotify(*(xp_surface_id *) arg, kind);
+ }
+ break;
+ }
+}
+
+
+/*
+ * displayScreenBounds
+ * Return the display ID for a particular display index.
+ */
+static CGDirectDisplayID
+displayAtIndex(int index)
+{
+ CGError err;
+ CGDisplayCount cnt;
+ CGDirectDisplayID dpy[index+1];
+
+ err = CGGetActiveDisplayList(index + 1, dpy, &cnt);
+ if (err == kCGErrorSuccess && cnt == index + 1)
+ return dpy[index];
+ else
+ return kCGNullDirectDisplay;
+}
+
+
+/*
+ * displayScreenBounds
+ * Return the bounds of a particular display.
+ */
+static CGRect
+displayScreenBounds(CGDirectDisplayID id)
+{
+ CGRect frame;
+
+ frame = CGDisplayBounds(id);
+
+ /* Remove menubar to help standard X11 window managers. */
+
+ if (frame.origin.x == 0 && frame.origin.y == 0)
+ {
+ frame.origin.y += aquaMenuBarHeight;
+ frame.size.height -= aquaMenuBarHeight;
+ }
+
+ return frame;
+}
+
+
+/*
+ * addPseudoramiXScreens
+ * Add a physical screen with PseudoramiX.
+ */
+static void
+addPseudoramiXScreens(int *x, int *y, int *width, int *height)
+{
+ CGDisplayCount i, displayCount;
+ CGDirectDisplayID *displayList = NULL;
+ CGRect unionRect = CGRectNull, frame;
+
+ // Find all the CoreGraphics displays
+ CGGetActiveDisplayList(0, NULL, &displayCount);
+ displayList = xalloc(displayCount * sizeof(CGDirectDisplayID));
+ CGGetActiveDisplayList(displayCount, displayList, &displayCount);
+
+ /* Get the union of all screens */
+ for (i = 0; i < displayCount; i++)
+ {
+ CGDirectDisplayID dpy = displayList[i];
+ frame = displayScreenBounds(dpy);
+ unionRect = CGRectUnion(unionRect, frame);
+ }
+
+ /* Use unionRect as the screen size for the X server. */
+ *x = unionRect.origin.x;
+ *y = unionRect.origin.y;
+ *width = unionRect.size.width;
+ *height = unionRect.size.height;
+
+ /* Tell PseudoramiX about the real screens. */
+ for (i = 0; i < displayCount; i++)
+ {
+ CGDirectDisplayID dpy = displayList[i];
+
+ frame = displayScreenBounds(dpy);
+
+ ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y);
+
+ frame.origin.x -= unionRect.origin.x;
+ frame.origin.y -= unionRect.origin.y;
+
+ ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
+ i, (int)frame.origin.x, (int)frame.origin.y);
+
+ PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
+ frame.size.width, frame.size.height);
+ }
+
+ xfree(displayList);
+}
+
+
+/*
+ * xprDisplayInit
+ * Find number of CoreGraphics displays and initialize Xplugin.
+ */
+static void
+xprDisplayInit(void)
+{
+ CGDisplayCount displayCount;
+
+ ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n");
+
+ CGGetActiveDisplayList(0, NULL, &displayCount);
+
+ /* With PseudoramiX, the X server only sees one screen; only PseudoramiX
+ itself knows about all of the screens. */
+
+ if (noPseudoramiXExtension)
+ darwinScreensFound = displayCount;
+ else
+ darwinScreensFound = 1;
+
+ if (xp_init(XP_IN_BACKGROUND) != Success)
+ {
+ FatalError("Could not initialize the Xplugin library.");
+ }
+
+ xp_select_events(XP_EVENT_DISPLAY_CHANGED
+ | XP_EVENT_WINDOW_STATE_CHANGED
+ | XP_EVENT_WINDOW_MOVED
+ | XP_EVENT_SURFACE_CHANGED
+ | XP_EVENT_SURFACE_DESTROYED,
+ eventHandler, NULL);
+
+ AppleDRIExtensionInit();
+ xprAppleWMInit();
+}
+
+
+/*
+ * xprAddScreen
+ * Init the framebuffer and record pixmap parameters for the screen.
+ */
+static Bool
+xprAddScreen(int index, ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+
+ /* If no specific depth chosen, look for the depth of the main display.
+ Else if 16bpp specified, use that. Else use 32bpp. */
+
+ dfb->colorType = TrueColor;
+ dfb->bitsPerComponent = 8;
+ dfb->bitsPerPixel = 32;
+ dfb->colorBitsPerPixel = 24;
+
+ if (darwinDesiredDepth == -1)
+ {
+ dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
+ dfb->colorBitsPerPixel =
+ CGDisplaySamplesPerPixel(kCGDirectMainDisplay) *
+ dfb->bitsPerComponent;
+ }
+ else if (darwinDesiredDepth == 15)
+ {
+ dfb->bitsPerComponent = 5;
+ dfb->bitsPerPixel = 16;
+ dfb->colorBitsPerPixel = 15;
+ }
+ else if (darwinDesiredDepth == 8)
+ {
+ dfb->colorType = PseudoColor;
+ dfb->bitsPerComponent = 8;
+ dfb->bitsPerPixel = 8;
+ dfb->colorBitsPerPixel = 8;
+ }
+
+ if (noPseudoramiXExtension)
+ {
+ CGDirectDisplayID dpy;
+ CGRect frame;
+
+ dpy = displayAtIndex(index);
+
+ frame = displayScreenBounds(dpy);
+
+ dfb->x = frame.origin.x;
+ dfb->y = frame.origin.y;
+ dfb->width = frame.size.width;
+ dfb->height = frame.size.height;
+ }
+ else
+ {
+ addPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
+ }
+
+ /* Passing zero width (pitch) makes miCreateScreenResources set the
+ screen pixmap to the framebuffer pointer, i.e. NULL. The generic
+ rootless code takes care of making this work. */
+ dfb->pitch = 0;
+ dfb->framebuffer = NULL;
+
+ DRIScreenInit(pScreen);
+
+ return TRUE;
+}
+
+
+/*
+ * xprSetupScreen
+ * Setup the screen for rootless access.
+ */
+static Bool
+xprSetupScreen(int index, ScreenPtr pScreen)
+{
+ // Add alpha protecting replacements for fb screen functions
+ pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
+ pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
+
+#ifdef RENDER
+ {
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ ps->Composite = SafeAlphaComposite;
+ }
+#endif /* RENDER */
+
+ // Initialize generic rootless code
+ if (!xprInit(pScreen))
+ return FALSE;
+
+ return DRIFinishScreenInit(pScreen);
+}
+
+
+/*
+ * xprInitInput
+ * Finalize xpr specific setup.
+ */
+static void
+xprInitInput(int argc, char **argv)
+{
+ int i;
+
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ AppleWMSetScreenOrigin(WindowTable[i]);
+}
+
+
+/*
+ * Quartz display mode function list.
+ */
+static QuartzModeProcsRec xprModeProcs = {
+ xprDisplayInit,
+ xprAddScreen,
+ xprSetupScreen,
+ xprInitInput,
+ QuartzInitCursor,
+ NULL, // No need to update cursor
+ QuartzSuspendXCursor,
+ QuartzResumeXCursor,
+ NULL, // No capture or release in rootless mode
+ NULL,
+ xprIsX11Window,
+ RootlessFrameForWindow,
+ TopLevelParent,
+ DRICreateSurface,
+ DRIDestroySurface
+};
+
+
+/*
+ * QuartzModeBundleInit
+ * Initialize the display mode bundle after loading.
+ */
+Bool
+QuartzModeBundleInit(void)
+{
+ quartzProcs = &xprModeProcs;
+ quartzOpenGLBundle = xprOpenGLBundle;
+ return TRUE;
+}
diff --git a/hw/darwin/utils/dumpkeymap.c b/hw/darwin/utils/dumpkeymap.c
index c1b6ea15b..a264cbc10 100644
--- a/hw/darwin/utils/dumpkeymap.c
+++ b/hw/darwin/utils/dumpkeymap.c
@@ -1,4 +1,4 @@
-// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.3 2000/12/05 21:18:34 dawes Exp $
+// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.4 2003/04/13 14:52:51 herrb Exp $
//=============================================================================
//
// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
@@ -141,6 +141,7 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#if !defined(DUMPKEYMAP_FILE_ONLY)
#include <drivers/event_status_driver.h>
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 71d879fa7..345526d19 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.9 2001/12/14 19:59:45 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.10 2003/11/16 03:16:59 dawes Exp $ */
#include "X11/X.h"
#define NEED_EVENTS
@@ -41,9 +41,7 @@ from The Open Group.
#include "keysym.h"
Bool
-LegalModifier(key, pDev)
- unsigned int key;
- DevicePtr pDev;
+LegalModifier(unsigned int key, DevicePtr pDev)
{
return TRUE;
}
@@ -63,9 +61,7 @@ KeySym map[MAP_LENGTH * LK201_GLYPHS_PER_KEY];
* easy to lift.
*/
static Bool
-GetLK201Mappings(pKeySyms, pModMap)
- KeySymsPtr pKeySyms;
- CARD8 *pModMap;
+GetLK201Mappings(KeySymsPtr pKeySyms, CARD8 *pModMap)
{
#define INDEX(in) ((in - VFB_MIN_KEY) * LK201_GLYPHS_PER_KEY)
int i;
@@ -257,9 +253,7 @@ GetLK201Mappings(pKeySyms, pModMap)
}
static int
-vfbKeybdProc(pDevice, onoff)
- DeviceIntPtr pDevice;
- int onoff;
+vfbKeybdProc(DeviceIntPtr pDevice, int onoff)
{
KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH];
@@ -285,9 +279,7 @@ vfbKeybdProc(pDevice, onoff)
}
static int
-vfbMouseProc(pDevice, onoff)
- DeviceIntPtr pDevice;
- int onoff;
+vfbMouseProc(DeviceIntPtr pDevice, int onoff)
{
BYTE map[4];
DevicePtr pDev = (DevicePtr)pDevice;
@@ -317,9 +309,7 @@ vfbMouseProc(pDevice, onoff)
}
void
-InitInput(argc, argv)
- int argc;
- char *argv[];
+InitInput(int argc, char *argv[])
{
DeviceIntPtr p, k;
p = AddInputDevice(vfbMouseProc, TRUE);
@@ -332,26 +322,18 @@ InitInput(argc, argv)
#ifdef XTESTEXT1
void
-XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey)
- int dev_type;
- int keycode;
- int keystate;
- int mousex;
- int mousey;
+XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex,
+ int mousey)
{
}
void
-XTestGetPointerPos(fmousex, fmousey)
- short *fmousex, *fmousey;
+XTestGetPointerPos(short *fmousex, short *fmousey)
{
}
void
-XTestJumpPointer(jx, jy, dev_type)
- int jx;
- int jy;
- int dev_type;
+XTestJumpPointer(int jx, int jy, int dev_type)
{
}
#endif
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 378728c0c..25f426232 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.22 2003/01/15 02:34:07 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.26 2003/11/16 03:16:59 dawes Exp $ */
#if defined(WIN32)
#include <X11/Xwinsock.h>
@@ -66,8 +66,6 @@ from The Open Group.
#include "miline.h"
#include "mfb.h"
-extern char *display;
-
#define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024
#define VFB_DEFAULT_DEPTH 8
@@ -80,6 +78,7 @@ typedef struct
{
int scrnum;
int width;
+ int paddedBytesWidth;
int paddedWidth;
int height;
int depth;
@@ -92,6 +91,7 @@ typedef struct
Pixel blackPixel;
Pixel whitePixel;
unsigned int lineBias;
+ CloseScreenProcPtr closeScreen;
#ifdef HAS_MMAP
int mmap_fd;
@@ -125,7 +125,7 @@ static Bool Render = TRUE;
static void
-vfbInitializePixmapDepths()
+vfbInitializePixmapDepths(void)
{
int i;
vfbPixmapDepths[1] = TRUE; /* always need bitmaps */
@@ -134,7 +134,7 @@ vfbInitializePixmapDepths()
}
static void
-vfbInitializeDefaultScreens()
+vfbInitializeDefaultScreens(void)
{
int i;
@@ -153,8 +153,7 @@ vfbInitializeDefaultScreens()
}
static int
-vfbBitsPerPixel(depth)
- int depth;
+vfbBitsPerPixel(int depth)
{
if (depth == 1) return 1;
else if (depth <= 8) return 8;
@@ -275,10 +274,7 @@ ddxUseMsg()
}
int
-ddxProcessArgument (argc, argv, i)
- int argc;
- char *argv[];
- int i;
+ddxProcessArgument(int argc, char *argv[], int i)
{
static Bool firstTime = TRUE;
@@ -438,8 +434,7 @@ GetTimeInMillis()
static Bool
-vfbMultiDepthCreateGC(pGC)
- GCPtr pGC;
+vfbMultiDepthCreateGC(GCPtr pGC)
{
switch (vfbBitsPerPixel(pGC->depth))
{
@@ -452,13 +447,13 @@ vfbMultiDepthCreateGC(pGC)
}
static void
-vfbMultiDepthGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
- DrawablePtr pDrawable; /* drawable from which to get bits */
- int wMax; /* largest value of all *pwidths */
- register 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; /* where to put the bits */
+vfbMultiDepthGetSpans(
+ DrawablePtr pDrawable, /* drawable from which to get bits */
+ int wMax, /* largest value of all *pwidths */
+ register 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) /* where to put the bits */
{
switch (pDrawable->bitsPerPixel) {
case 1:
@@ -474,12 +469,9 @@ vfbMultiDepthGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
}
static void
-vfbMultiDepthGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planeMask;
- char *pdstLine;
+vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
+ unsigned int format, unsigned long planeMask,
+ char *pdstLine)
{
switch (pDrawable->bitsPerPixel)
{
@@ -497,9 +489,7 @@ vfbMultiDepthGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
static ColormapPtr InstalledMaps[MAXSCREENS];
static int
-vfbListInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- Colormap *pmaps;
+vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
{
/* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */
@@ -509,8 +499,7 @@ vfbListInstalledColormaps(pScreen, pmaps)
static void
-vfbInstallColormap(pmap)
- ColormapPtr pmap;
+vfbInstallColormap(ColormapPtr pmap)
{
int index = pmap->pScreen->myNum;
ColormapPtr oldpmap = InstalledMaps[index];
@@ -568,8 +557,7 @@ vfbInstallColormap(pmap)
}
static void
-vfbUninstallColormap(pmap)
- ColormapPtr pmap;
+vfbUninstallColormap(ColormapPtr pmap)
{
ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum];
@@ -585,10 +573,7 @@ vfbUninstallColormap(pmap)
}
static void
-vfbStoreColors(pmap, ndef, pdefs)
- ColormapPtr pmap;
- int ndef;
- xColorItem *pdefs;
+vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem *pdefs)
{
XWDColor *pXWDCmap;
int i;
@@ -623,9 +608,7 @@ vfbStoreColors(pmap, ndef, pdefs)
}
static Bool
-vfbSaveScreen(pScreen, on)
- ScreenPtr pScreen;
- int on;
+vfbSaveScreen(ScreenPtr pScreen, int on)
{
return TRUE;
}
@@ -634,10 +617,7 @@ vfbSaveScreen(pScreen, on)
/* this flushes any changes to the screens out to the mmapped file */
static void
-vfbBlockHandler(blockData, pTimeout, pReadmask)
- pointer blockData;
- OSTimePtr pTimeout;
- pointer pReadmask;
+vfbBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
{
int i;
@@ -660,17 +640,13 @@ vfbBlockHandler(blockData, pTimeout, pReadmask)
static void
-vfbWakeupHandler(blockData, result, pReadmask)
- pointer blockData;
- int result;
- pointer pReadmask;
+vfbWakeupHandler(pointer blockData, int result, pointer pReadmask)
{
}
static void
-vfbAllocateMmappedFramebuffer(pvfb)
- vfbScreenInfoPtr pvfb;
+vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
{
#define DUMMY_BUFFER_SIZE 65536
char dummyBuffer[DUMMY_BUFFER_SIZE];
@@ -726,8 +702,7 @@ vfbAllocateMmappedFramebuffer(pvfb)
#ifdef HAS_SHM
static void
-vfbAllocateSharedMemoryFramebuffer(pvfb)
- vfbScreenInfoPtr pvfb;
+vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb)
{
/* create the shared memory segment */
@@ -755,16 +730,11 @@ vfbAllocateSharedMemoryFramebuffer(pvfb)
#endif /* HAS_SHM */
static char *
-vfbAllocateFramebufferMemory(pvfb)
- vfbScreenInfoPtr pvfb;
+vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb)
{
if (pvfb->pfbMemory) return pvfb->pfbMemory; /* already done */
- if (pvfb->bitsPerPixel == 1)
- pvfb->sizeInBytes = (pvfb->paddedWidth * pvfb->height);
- else
- pvfb->sizeInBytes = pvfb->paddedWidth * pvfb->height *
- (pvfb->bitsPerPixel/8);
+ pvfb->sizeInBytes = pvfb->paddedBytesWidth * pvfb->height;
/* Calculate how many entries in colormap. This is rather bogus, because
* the visuals haven't even been set up yet, but we need to know because we
@@ -822,8 +792,7 @@ vfbAllocateFramebufferMemory(pvfb)
static void
-vfbWriteXWDFileHeader(pScreen)
- ScreenPtr pScreen;
+vfbWriteXWDFileHeader(ScreenPtr pScreen)
{
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
XWDFileHeader *pXWDHeader = pvfb->pXWDHeader;
@@ -852,7 +821,7 @@ vfbWriteXWDFileHeader(pScreen)
pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD_PROTO;
#endif
pXWDHeader->bits_per_pixel = pvfb->bitsPerPixel;
- pXWDHeader->bytes_per_line = pvfb->paddedWidth;
+ pXWDHeader->bytes_per_line = pvfb->paddedBytesWidth;
pXWDHeader->ncolors = pvfb->ncolors;
/* visual related fields are written when colormap is installed */
@@ -891,17 +860,13 @@ vfbWriteXWDFileHeader(pScreen)
static Bool
-vfbCursorOffScreen (ppScreen, x, y)
- ScreenPtr *ppScreen;
- int *x, *y;
+vfbCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
{
return FALSE;
}
static void
-vfbCrossScreen (pScreen, entering)
- ScreenPtr pScreen;
- Bool entering;
+vfbCrossScreen (ScreenPtr pScreen, Bool entering)
{
}
@@ -913,19 +878,37 @@ static miPointerScreenFuncRec vfbPointerCursorFuncs =
};
static Bool
-vfbScreenInit(index, pScreen, argc, argv)
- int index;
- ScreenPtr pScreen;
- int argc;
- char ** argv;
+vfbCloseScreen(int index, ScreenPtr pScreen)
+{
+ vfbScreenInfoPtr pvfb = &vfbScreens[index];
+ int i;
+
+ pScreen->CloseScreen = pvfb->closeScreen;
+
+ /*
+ * XXX probably lots of stuff to clean. For now,
+ * clear InstalledMaps[] so that server reset works correctly.
+ */
+ for (i = 0; i < MAXSCREENS; i++)
+ InstalledMaps[i] = NULL;
+
+ return pScreen->CloseScreen(index, pScreen);
+}
+
+static Bool
+vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
{
vfbScreenInfoPtr pvfb = &vfbScreens[index];
int dpix = 100, dpiy = 100;
int ret;
char *pbits;
- pvfb->paddedWidth = PixmapBytePad(pvfb->width, pvfb->depth);
+ pvfb->paddedBytesWidth = PixmapBytePad(pvfb->width, pvfb->depth);
pvfb->bitsPerPixel = vfbBitsPerPixel(pvfb->depth);
+ if (pvfb->bitsPerPixel >= 8 )
+ pvfb->paddedWidth = pvfb->paddedBytesWidth / (pvfb->bitsPerPixel / 8);
+ else
+ pvfb->paddedWidth = pvfb->paddedBytesWidth * 8;
pbits = vfbAllocateFramebufferMemory(pvfb);
if (!pbits) return FALSE;
@@ -935,7 +918,7 @@ vfbScreenInit(index, pScreen, argc, argv)
{
case 1:
ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth * 8);
+ dpix, dpiy, pvfb->paddedWidth);
break;
case 8:
case 16:
@@ -988,16 +971,16 @@ vfbScreenInit(index, pScreen, argc, argv)
miSetZeroLineBias(pScreen, pvfb->lineBias);
+ pvfb->closeScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = vfbCloseScreen;
+
return ret;
} /* end vfbScreenInit */
void
-InitOutput(screenInfo, argc, argv)
- ScreenInfo *screenInfo;
- int argc;
- char **argv;
+InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
{
int i;
int NumFormats = 0;
@@ -1010,9 +993,16 @@ InitOutput(screenInfo, argc, argv)
vfbPixmapDepths[vfbScreens[i].depth] = TRUE;
}
- /* for RENDER we need 32bpp */
- if (Render)
+ /* RENDER needs a good set of pixmaps. */
+ if (Render) {
+ vfbPixmapDepths[1] = TRUE;
+ vfbPixmapDepths[4] = TRUE;
+ vfbPixmapDepths[8] = TRUE;
+ vfbPixmapDepths[15] = TRUE;
+ vfbPixmapDepths[16] = TRUE;
+ vfbPixmapDepths[24] = TRUE;
vfbPixmapDepths[32] = TRUE;
+ }
for (i = 1; i <= 32; i++)
{
diff --git a/hw/xfree86/common/atKeynames.h b/hw/xfree86/common/atKeynames.h
index 23760db5e..17bb21f4d 100644
--- a/hw/xfree86/common/atKeynames.h
+++ b/hw/xfree86/common/atKeynames.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.18 2001/09/29 20:40:30 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.21 2003/10/09 11:43:59 pascal Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -21,6 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: atKeynames.h /main/11 1996/03/09 11:17:41 kaleb $ */
#ifndef _ATKEYNAMES_H
@@ -199,6 +226,71 @@
#define KEY_NFER /* No Kanji Transfer 0x7b */ 123
#define KEY_Yen /* Yen 0x7d */ 125
+#define KEY_Power /* Power Key 0x84 */ 132
+#define KEY_Mute /* Audio Mute 0x85 */ 133
+#define KEY_AudioLower /* Audio Lower 0x86 */ 134
+#define KEY_AudioRaise /* Audio Raise 0x87 */ 135
+#define KEY_Help /* Help 0x88 */ 136
+#define KEY_L1 /* Stop 0x89 */ 137
+#define KEY_L2 /* Again 0x8a */ 138
+#define KEY_L3 /* Props 0x8b */ 139
+#define KEY_L4 /* Undo 0x8c */ 140
+#define KEY_L5 /* Front 0x8d */ 141
+#define KEY_L6 /* Copy 0x8e */ 142
+#define KEY_L7 /* Open 0x8f */ 143
+#define KEY_L8 /* Paste 0x90 */ 144
+#define KEY_L9 /* Find 0x91 */ 145
+#define KEY_L10 /* Cut 0x92 */ 146
+
+/*
+ * Fake 'scancodes' in the following ranges are generated for 2-byte
+ * codes not handled elsewhere. These correspond to most extended keys
+ * on so-called "Internet" keyboards:
+ *
+ * 0x79-0x93
+ * 0x96-0xa1
+ * 0xa3-0xac
+ * 0xb1-0xb4
+ * 0xba-0xbd
+ * 0xc2
+ * 0xcc-0xd2
+ * 0xd6-0xf7
+ */
+
+/*
+ * Remapped 'scancodes' are generated for single-byte codes in the range
+ * 0x59-0x5f,0x62-0x76. These are used for some extra keys on some keyboards.
+ */
+
+#define KEY_0x59 0x95
+#define KEY_0x5A 0xA2
+#define KEY_0x5B 0xAD
+#define KEY_0x5C KEY_KP_EQUAL
+#define KEY_0x5D 0xAE
+#define KEY_0x5E 0xAF
+#define KEY_0x5F 0xB0
+#define KEY_0x62 0xB5
+#define KEY_0x63 0xB6
+#define KEY_0x64 0xB7
+#define KEY_0x65 0xB8
+#define KEY_0x66 0xB9
+#define KEY_0x67 0xBE
+#define KEY_0x68 0xBF
+#define KEY_0x69 0xC0
+#define KEY_0x6A 0xC1
+#define KEY_0x6B 0xC3
+#define KEY_0x6C 0xC4
+#define KEY_0x6D 0xC5
+#define KEY_0x6E 0xC6
+#define KEY_0x6F 0xC7
+#define KEY_0x70 0xC8
+#define KEY_0x71 0xC9
+#define KEY_0x72 0xCA
+#define KEY_0x73 0xCB
+#define KEY_0x74 0xD3
+#define KEY_0x75 0xD4
+#define KEY_0x76 0xD5
+
/* These are for "notused" and "unknown" entries in translation maps. */
#define KEY_NOTUSED 0
#define KEY_UNKNOWN 255
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 4dda2f6c6..bf9fbeee2 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.99 2003/01/29 15:23:20 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.104 2003/11/03 05:11:01 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -21,6 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: compiler.h /main/16 1996/10/25 15:38:34 kaleb $ */
#ifndef _COMPILER_H
@@ -423,23 +450,37 @@ __ustw (unsigned long r5, unsigned short * r11)
# define stq_u(v,p) __ustq(v,p)
# define stl_u(v,p) __ustl(v,p)
# define stw_u(v,p) __ustw(v,p)
-
-# define mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
-# define write_mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
+
+# ifndef __INTEL_COMPILER
+# define mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
+# define write_mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
+# else
+# include "ia64intrin.h"
+# define mem_barrier() __mf()
+# define write_mem_barrier() __mf()
+# endif
/*
* This is overkill, but for different reasons depending on where it is used.
* This is thus general enough to be used everywhere cache flushes are needed.
* It doesn't handle memory access serialisation by other processors, though.
*/
-# define ia64_flush_cache(Addr) \
+# ifndef __INTEL_COMPILER
+# define ia64_flush_cache(Addr) \
__asm__ __volatile__ ( \
"fc %0;;;" \
"sync.i;;;" \
"mf;;;" \
"srlz.i;;;" \
:: "r"(Addr) : "memory")
-
+# else
+# define ia64_flush_cache(Addr) { \
+ __fc(Addr);\
+ __synci();\
+ __mf();\
+ __isrlz();\
+ }
+# endif
# undef outb
# undef outw
# undef outl
@@ -448,7 +489,7 @@ __ustw (unsigned long r5, unsigned short * r11)
# define outw(a,b) _outw(b,a)
# define outl(a,b) _outl(b,a)
-# elif defined(linux) && defined(__x86_64__)
+# elif defined(linux) && defined(__AMD64__)
# include <inttypes.h>
@@ -514,7 +555,7 @@ inl(unsigned short port)
return ret;
}
-# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__)) && defined(__sparc__)
+# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__)
# if !defined(Lynx)
# ifndef ASI_PL
@@ -1515,11 +1556,13 @@ extern void outl(unsigned int a, unsigned int l);
# include <sys/types.h>
# endif /* IN_MODULE */
# endif /* USL */
+# ifndef sgi
# include <sys/inline.h>
+# endif
# else
# include "scoasm.h"
# endif
-# if !defined(__HIGHC__) && !defined(SCO325)
+# if !defined(__HIGHC__) && !defined(SCO325) && !defined(sgi)
# pragma asm partial_optimization outl
# pragma asm partial_optimization outw
# pragma asm partial_optimization outb
diff --git a/hw/xfree86/common/fourcc.h b/hw/xfree86/common/fourcc.h
index 61f403679..e60aa4e83 100644
--- a/hw/xfree86/common/fourcc.h
+++ b/hw/xfree86/common/fourcc.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.3 2001/12/03 22:13:24 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.5 2003/08/24 17:36:48 dawes Exp $ */
+
+/*
+ * Copyright (c) 2000-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/*
This header file contains listings of STANDARD guids for video formats.
@@ -7,6 +34,9 @@
For an explanation of fourcc <-> guid mappings see RFC2361.
*/
+#ifndef _XF86_FOURCC_H_
+#define _XF86_FOURCC_H_ 1
+
#define FOURCC_YUY2 0x32595559
#define XVIMAGE_YUY2 \
{ \
@@ -128,3 +158,4 @@
XvTopToBottom \
}
+#endif /* _XF86_FOURCC_H_ */
diff --git a/hw/xfree86/common/modeline2c.pl b/hw/xfree86/common/modeline2c.pl
index fb76789d6..e31fe28e1 100644
--- a/hw/xfree86/common/modeline2c.pl
+++ b/hw/xfree86/common/modeline2c.pl
@@ -8,9 +8,33 @@
# 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 $
+# Copyright 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+# and 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 copyright holder(s) and author(s).
+#
+# $XFree86: xc/programs/Xserver/hw/xfree86/common/modeline2c.pl,v 1.11 2003/11/03 05:11:01 tsi Exp $
#my %flagshash;
$flagshash{""} = "0";
@@ -32,17 +56,20 @@ $flagshash{"-hsync -vsync interlace"} = "V_NHSYNC | V_NVSYNC | V_INTERLACE";
# stop CVS from expanding the XFree86 Id here...
$proj = "XFree86";
-printf("/* \$$proj: \$ */
+printf("/* \$$proj\$ */
/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
* modeline2c.pl */
/*
- * Copyright 1999 by The XFree86 Project, Inc.
+ * Copyright 1999-2003 by The XFree86 Project, Inc.
*
* Author: Dirk Hohndel <hohndel\@XFree86.Org>
*/
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
#include \"xf86.h\"
#include \"xf86Config.h\"
#include \"xf86Priv.h\"
@@ -50,7 +77,7 @@ printf("/* \$$proj: \$ */
#include \"globals.h\"
-#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT
+#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, 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 [] = {
diff --git a/hw/xfree86/common/scoasm.h b/hw/xfree86/common/scoasm.h
index 12fe46693..dbf8c8f86 100644
--- a/hw/xfree86/common/scoasm.h
+++ b/hw/xfree86/common/scoasm.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/scoasm.h,v 3.0 1996/10/03 08:34:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/scoasm.h,v 3.1 2003/08/24 17:36:49 dawes Exp $ */
+
+/*
+ * Copyright (c) 1996 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/*
* scoasm.h - used to define inline versions of certain functions which
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 119adc5a6..e189e81d2 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.169 2003/02/13 10:49:38 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.172 2003/09/24 02:43:16 dawes Exp $ */
/*
- * Copyright (c) 1997 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -203,6 +226,11 @@ void xf86ProcessActionEvent(ActionEvent action, void *arg);
/* xf86Helper.c */
+#ifdef printf
+#define printf_defined
+#undef printf
+#endif
+
void xf86AddDriver(DriverPtr driver, pointer module, int flags);
void xf86DeleteDriver(int drvIndex);
ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
@@ -221,12 +249,14 @@ void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
const char *format, va_list args);
void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
- const char *format, ...);
-void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...);
-void xf86MsgVerb(MessageType type, int verb, const char *format, ...);
-void xf86Msg(MessageType type, const char *format, ...);
-void xf86ErrorFVerb(int verb, const char *format, ...);
-void xf86ErrorF(const char *format, ...);
+ const char *format, ...) _printf_attribute(4,5);
+void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
+ _printf_attribute(3,4);
+void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
+ _printf_attribute(3,4);
+void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
+void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
+void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
const char *xf86TokenToString(SymTabPtr table, int token);
int xf86StringToToken(SymTabPtr table, const char *string);
void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
@@ -334,6 +364,11 @@ void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
void xf86DeleteModuleInfo(int idx);
#endif
+#ifdef printf_defined
+#define printf xf86printf
+#undef printf_defined
+#endif
+
/* xf86Debug.c */
#ifdef BUILDDEBUG
void xf86Break1(void);
@@ -402,6 +437,12 @@ void xf86RandRSetInitialMode (ScreenPtr pScreen);
Bool VidModeExtensionInit(ScreenPtr pScreen);
+/* xf86Versions.c */
+CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag);
+Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface,
+ CARD32 version, int flags);
+
+
#endif /* _NO_XF86_PROTOTYPES */
#endif /* _XF86_H */
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
new file mode 100644
index 000000000..7c773fee6
--- /dev/null
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -0,0 +1,354 @@
+/* $DHD: xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c,v 1.15 2003/09/24 19:39:36 dawes Exp $ */
+
+/*
+ * Copyright 2003 by David H. Dawes.
+ * Copyright 2003 by X-Oz Technologies.
+ * 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ *
+ * Author: David Dawes <dawes@XFree86.Org>.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c,v 1.2 2003/11/03 05:11:01 tsi Exp $ */
+
+#include "xf86.h"
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "xf86Config.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+/*
+ * Sections for the default built-in configuration.
+ */
+
+#define BUILTIN_MODULE_SECTION \
+ "Section \"Module\"\n" \
+ "\tLoad\t\"extmod\"\n" \
+ "\tLoad\t\"dbe\"\n" \
+ "\tLoad\t\"glx\"\n" \
+ "\tLoad\t\"freetype\"\n" \
+ "EndSection\n\n"
+
+#define BUILTIN_DEVICE_NAME \
+ "\"Builtin Default %s Device %d\""
+
+#define BUILTIN_DEVICE_SECTION_PRE \
+ "Section \"Device\"\n" \
+ "\tIdentifier\t" BUILTIN_DEVICE_NAME "\n" \
+ "\tDriver\t\"%s\"\n"
+
+#define BUILTIN_DEVICE_SECTION_POST \
+ "EndSection\n\n"
+
+#define BUILTIN_DEVICE_SECTION \
+ BUILTIN_DEVICE_SECTION_PRE \
+ BUILTIN_DEVICE_SECTION_POST
+
+#define BUILTIN_MONITOR_NAME \
+ "\"Builtin Default Monitor\""
+
+#define BUILTIN_MONITOR_SECTION \
+ "Section \"Monitor\"\n" \
+ "\tIdentifier\t" BUILTIN_MONITOR_NAME "\n" \
+ "\tOption\t\"TargetRefresh\"\t\"75.0\"\n" \
+ "EndSection\n\n"
+
+#define BUILTIN_SCREEN_NAME \
+ "\"Builtin Default %s Screen %d\""
+
+#define BUILTIN_SCREEN_SECTION \
+ "Section \"Screen\"\n" \
+ "\tIdentifier\t" BUILTIN_SCREEN_NAME "\n" \
+ "\tDevice\t" BUILTIN_DEVICE_NAME "\n" \
+ "\tMonitor\t" BUILTIN_MONITOR_NAME "\n" \
+ "EndSection\n\n"
+
+#define BUILTIN_LAYOUT_SECTION_PRE \
+ "Section \"ServerLayout\"\n" \
+ "\tIdentifier\t\"Builtin Default Layout\"\n"
+
+#define BUILTIN_LAYOUT_SCREEN_LINE \
+ "\tScreen\t" BUILTIN_SCREEN_NAME "\n"
+
+#define BUILTIN_LAYOUT_SECTION_POST \
+ "EndSection\n\n"
+
+
+#ifndef GET_CONFIG_CMD
+#define GET_CONFIG_CMD "getconfig"
+#endif
+
+#ifndef GETCONFIG_DIR
+#define GETCONFIG_DIR PROJECTROOT "/lib/X11/getconfig"
+#endif
+
+#define GETCONFIG_WHITESPACE " \t\n"
+
+static const char **builtinConfig = NULL;
+static int builtinLines = 0;
+static const char *deviceList[] = {
+ "fbdev",
+ "vesa",
+ "vga",
+ NULL
+};
+
+/*
+ * A built-in config file is stored as an array of strings, with each string
+ * representing a single line. AppendToConfig() breaks up the string "s"
+ * into lines, and appends those lines it to builtinConfig.
+ */
+
+static void
+AppendToList(const char *s, const char ***list, int *lines)
+{
+ char *str, *newstr, *p;
+
+ str = xnfstrdup(s);
+ for (p = strtok(str, "\n"); p; p = strtok(NULL, "\n")) {
+ (*lines)++;
+ *list = xnfrealloc(*list, (*lines + 1) * sizeof(**list));
+ newstr = xnfalloc(strlen(p) + 2);
+ strcpy(newstr, p);
+ strcat(newstr, "\n");
+ (*list)[*lines - 1] = newstr;
+ (*list)[*lines] = NULL;
+ }
+ xfree(str);
+}
+
+static void
+FreeList(const char ***list, int *lines)
+{
+ int i;
+
+ for (i = 0; i < *lines; i++) {
+ if ((*list)[i])
+ xfree((*list)[i]);
+ }
+ xfree(*list);
+ *list = NULL;
+ *lines = 0;
+}
+
+static void
+FreeConfig(void)
+{
+ FreeList(&builtinConfig, &builtinLines);
+}
+
+static void
+AppendToConfig(const char *s)
+{
+ AppendToList(s, &builtinConfig, &builtinLines);
+}
+
+Bool
+xf86AutoConfig(void)
+{
+ const char **p;
+ char buf[1024];
+ pciVideoPtr *pciptr, info = NULL;
+ char *driver = NULL;
+ FILE *gp = NULL;
+ ConfigStatus ret;
+
+ /* Find the primary device, and get some information about it. */
+ if (xf86PciVideoInfo) {
+ for (pciptr = xf86PciVideoInfo; (info = *pciptr); pciptr++) {
+ if (xf86IsPrimaryPci(info)) {
+ break;
+ }
+ }
+ if (!info) {
+ ErrorF("Primary device is not PCI\n");
+ }
+ } else {
+ ErrorF("xf86PciVideoInfo is not set\n");
+ }
+
+ if (info) {
+ char *tmp;
+ char *path = NULL, *a, *b;
+ char *searchPath = NULL;
+
+ /*
+ * Look for the getconfig program first in the xf86ModulePath
+ * directories, then in BINDIR. If it isn't found in any of those
+ * locations, just use the normal search path.
+ */
+
+ if (xf86ModulePath) {
+ a = xnfstrdup(xf86ModulePath);
+ b = strtok(a, ",");
+ while (b) {
+ path = xnfrealloc(path,
+ strlen(b) + 1 + strlen(GET_CONFIG_CMD) + 1);
+ sprintf(path, "%s/%s", b, GET_CONFIG_CMD);
+ if (access(path, X_OK) == 0)
+ break;
+ b = strtok(NULL, ",");
+ }
+ if (!b) {
+ xfree(path);
+ path = NULL;
+ }
+ xfree(a);
+ }
+
+#ifdef BINDIR
+ if (!path) {
+ path = xnfstrdup(BINDIR "/" GET_CONFIG_CMD);
+ if (access(path, X_OK) != 0) {
+ xfree(path);
+ path = NULL;
+ }
+ }
+#endif
+
+ if (!path)
+ path = xnfstrdup(GET_CONFIG_CMD);
+
+ /*
+ * Build up the config file directory search path:
+ *
+ * /etc/X11
+ * PROJECTROOT/etc/X11
+ * xf86ModulePath
+ * PROJECTROOT/lib/X11/getconfig (GETCONFIG_DIR)
+ */
+
+ searchPath = xnfalloc(strlen("/etc/X11") + 1 +
+ strlen(PROJECTROOT "/etc/X11") + 1 +
+ (xf86ModulePath ? strlen(xf86ModulePath) : 0)
+ + 1 +
+ strlen(GETCONFIG_DIR) + 1);
+ strcpy(searchPath, "/etc/X11," PROJECTROOT "/etc/X11,");
+ if (xf86ModulePath && *xf86ModulePath) {
+ strcat(searchPath, xf86ModulePath);
+ strcat(searchPath, ",");
+ }
+ strcat(searchPath, GETCONFIG_DIR);
+
+ ErrorF("xf86AutoConfig: Primary PCI is %d:%d:%d\n",
+ info->bus, info->device, info->func);
+
+ snprintf(buf, sizeof(buf), "%s"
+#ifdef DEBUG
+ " -D"
+#endif
+ " -X %d"
+ " -I %s"
+ " -v 0x%04x -d 0x%04x -r 0x%02x -s 0x%04x"
+ " -b 0x%04x -c 0x%04x",
+ path,
+ (unsigned int)xf86GetVersion(),
+ searchPath,
+ info->vendor, info->chipType, info->chipRev,
+ info->subsysVendor, info->subsysCard,
+ info->class << 8 | info->subclass);
+ ErrorF("Running \"%s\"\n", buf);
+ gp = Popen(buf, "r");
+ if (gp) {
+ if (fgets(buf, sizeof(buf) - 1, gp)) {
+ buf[strlen(buf) - 1] = '\0';
+ tmp = strtok(buf, GETCONFIG_WHITESPACE);
+ if (tmp)
+ driver = xnfstrdup(tmp);
+ }
+ }
+ xfree(path);
+ xfree(searchPath);
+ }
+
+ AppendToConfig(BUILTIN_MODULE_SECTION);
+ AppendToConfig(BUILTIN_MONITOR_SECTION);
+
+ if (driver) {
+ snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION_PRE,
+ driver, 0, driver);
+ AppendToConfig(buf);
+ ErrorF("New driver is \"%s\"\n", driver);
+ buf[0] = '\t';
+ while (fgets(buf + 1, sizeof(buf) - 2, gp)) {
+ AppendToConfig(buf);
+ ErrorF("Extra line: %s", buf);
+ }
+ AppendToConfig(BUILTIN_DEVICE_SECTION_POST);
+ snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION,
+ driver, 0, driver, 0);
+ AppendToConfig(buf);
+ }
+
+ if (gp)
+ Pclose(gp);
+
+ for (p = deviceList; *p; p++) {
+ snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p);
+ AppendToConfig(buf);
+ snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0);
+ AppendToConfig(buf);
+ }
+
+ AppendToConfig(BUILTIN_LAYOUT_SECTION_PRE);
+ if (driver) {
+ snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, driver, 0);
+ AppendToConfig(buf);
+ }
+ for (p = deviceList; *p; p++) {
+ snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, *p, 0);
+ AppendToConfig(buf);
+ }
+ AppendToConfig(BUILTIN_LAYOUT_SECTION_POST);
+
+#ifdef BUILTIN_EXTRA
+ AppendToConfig(BUILTIN_EXTRA);
+#endif
+
+ if (driver)
+ xfree(driver);
+
+ xf86MsgVerb(X_DEFAULT, 0,
+ "Using default built-in configuration (%d lines)\n",
+ builtinLines);
+
+ xf86MsgVerb(X_DEFAULT, 3, "--- Start of built-in configuration ---\n");
+ for (p = builtinConfig; *p; p++)
+ xf86ErrorFVerb(3, "\t%s", *p);
+ xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n");
+
+ xf86setBuiltinConfig(builtinConfig);
+ ret = xf86HandleConfigFile(TRUE);
+ FreeConfig();
+ switch(ret) {
+ case CONFIG_OK:
+ return TRUE;
+ default:
+ xf86Msg(X_ERROR, "Error parsing the built-in default configuration.\n");
+ return FALSE;
+ }
+}
+
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index fd9e3c3d1..2ffbfa964 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1,7 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.76 2003/02/21 17:19:34 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.79 2003/11/03 05:11:01 tsi Exp $ */
/*
- * Copyright (c) 1997-1999 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
+
#define REDUCER
/*
* This file contains the interfaces to the bus-specific code
@@ -1280,14 +1304,14 @@ xf86PrintResList(int verb, resPtr list)
switch (list->res_type & ResExtMask) {
case ResBlock:
xf86ErrorFVerb(verb,
- "\t[%d] %d\t%d\t0x%08lx - 0x%08lx (0x%lx)",
+ "\t[%d] %d\t%ld\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 ",
+ xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx ",
i, list->entityIndex,
(list->res_type & ResDomain) >> 24,
list->sparse_base,list->sparse_mask);
@@ -1581,7 +1605,6 @@ xf86GetSparse(unsigned long type, memType fixed_bits,
memType new_mask;
memType mask1;
memType base;
- memType bits;
memType counter = 0;
memType counter1;
memType max_counter = ~(memType)0;
@@ -1653,7 +1676,6 @@ xf86GetSparse(unsigned long type, memType fixed_bits,
counter = 0;
while (1) {
- bits = make_base(counter,new_mask) | fixed_bits;
counter1 = 0;
while (1) {
base = make_base(counter1,mask1);
@@ -2134,7 +2156,7 @@ 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"
+ "0x%lx:0x%lx 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",
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index 6a129ad56..fbeca7f9c 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -1,6 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.21 2002/11/25 14:04:56 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.23 2003/08/24 17:36:50 dawes Exp $ */
+
/*
- * Copyright (c) 1997 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -98,7 +122,6 @@ typedef struct x_BusAccRec {
int primary_bus;
PCITAG acc;
pciBridgesSave save;
- void (*func)(PCITAG,int,CARD32,CARD32);
} pci;
} busdep;
} BusAccRec, *BusAccPtr;
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 1738222f5..8f6dd2803 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1,17 +1,48 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.269 2003/02/20 04:36:07 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.277 2003/10/15 22:51:48 dawes Exp $ */
/*
- * Copyright 1991-2002 by The XFree86 Project, Inc.
- * Copyright 1997 by Metro Link, Inc.
- *
* Loosely based on code bearing the following copyright:
*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ */
+
+/*
+ * Copyright 1992-2003 by The XFree86 Project, Inc.
+ * Copyright 1997 by Metro Link, 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:
*
- * <Put copyright message here>
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
*
- * Author: Dirk Hohndel <hohndel@XFree86.Org> and others.
+ * 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/*
+ *
+ * Authors:
+ * Dirk Hohndel <hohndel@XFree86.Org>
+ * David Dawes <dawes@XFree86.Org>
+ * Marc La France <tsi@XFree86.Org>
+ * Egbert Eich <eich@XFree86.Org>
+ * ... and others
*/
#ifdef XF86DRI
@@ -19,6 +50,10 @@
#include <grp.h>
#endif
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
+
#include "xf86.h"
#include "xf86Parser.h"
#include "xf86tokens.h"
@@ -905,9 +940,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
if (!xf86NameCmp(s,"flush")) {
xf86Msg(X_CONFIG, "Flushing logfile enabled\n");
xf86Info.log = LogFlush;
+ LogSetParameter(XLOG_FLUSH, TRUE);
} else if (!xf86NameCmp(s,"sync")) {
xf86Msg(X_CONFIG, "Syncing logfile enabled\n");
xf86Info.log = LogSync;
+ LogSetParameter(XLOG_SYNC, TRUE);
} else {
xf86Msg(X_WARNING,"Unknown Log option\n");
}
@@ -1143,6 +1180,11 @@ configInputKbd(IDevPtr inputp)
xf86Msg(X_PROBED, "Keyboard type: Sun\n");
break;
#endif
+#ifdef WSKBD_TYPE_SUN5
+ case WSKBD_TYPE_SUN5:
+ xf86Msg(X_PROBED, "Keyboard type: Sun5\n");
+ break;
+#endif
default:
xf86ConfigError("Unsupported wskbd type \"%d\"",
xf86Info.wsKbdType);
@@ -1314,105 +1356,297 @@ configInputKbd(IDevPtr inputp)
return TRUE;
}
+/*
+ * Locate the core input devices. These can be specified/located in
+ * the following ways, in order of priority:
+ *
+ * 1. The InputDevices named by the -pointer and -keyboard command line
+ * options.
+ * 2. The "CorePointer" and "CoreKeyboard" InputDevices referred to by
+ * the active ServerLayout.
+ * 3. The first InputDevices marked as "CorePointer" and "CoreKeyboard".
+ * 4. The first InputDevices that use the 'mouse' and 'keyboard' or 'kbd'
+ * drivers.
+ * 5. Default devices with an empty (default) configuration. These defaults
+ * will reference the 'mouse' and 'keyboard' drivers.
+ */
+
static Bool
checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
{
- Bool havePointer = FALSE, haveKeyboard = FALSE;
+ IDevPtr corePointer = NULL, coreKeyboard = NULL;
Bool foundPointer = FALSE, foundKeyboard = FALSE;
+ const char *pointerMsg = NULL, *keyboardMsg = NULL;
IDevPtr indp;
IDevRec Pointer, Keyboard;
XF86ConfInputPtr confInput;
+ XF86ConfInputRec defPtr, defKbd;
int count = 0;
MessageType from = X_DEFAULT;
- /* Check if a core pointer or core keyboard is needed. */
+ /*
+ * First check if a core pointer or core keyboard have been specified
+ * in the active ServerLayout. If more than one is specified for either,
+ * remove the core attribute from the later ones.
+ */
for (indp = servlayoutp->inputs; indp->identifier; indp++) {
- if ((indp->commonOptions &&
- xf86FindOption(indp->commonOptions, "CorePointer")) ||
- (indp->extraOptions &&
- xf86FindOption(indp->extraOptions, "CorePointer"))) {
- havePointer = TRUE;
+ pointer opt1 = NULL, opt2 = NULL;
+ if (indp->commonOptions &&
+ xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) {
+ opt1 = indp->commonOptions;
+ }
+ if (indp->extraOptions &&
+ xf86CheckBoolOption(indp->extraOptions, "CorePointer", FALSE)) {
+ opt2 = indp->extraOptions;
+ }
+ if (opt1 || opt2) {
+ if (!corePointer) {
+ corePointer = indp;
+ } else {
+ if (opt1)
+ xf86ReplaceBoolOption(opt1, "CorePointer", FALSE);
+ if (opt2)
+ xf86ReplaceBoolOption(opt2, "CorePointer", FALSE);
+ xf86Msg(X_WARNING, "Duplicate core pointer devices. "
+ "Removing core pointer attribute from \"%s\"\n",
+ indp->identifier);
+ }
+ }
+ opt1 = opt2 = NULL;
+ if (indp->commonOptions &&
+ xf86CheckBoolOption(indp->commonOptions, "CoreKeyboard", FALSE)) {
+ opt1 = indp->commonOptions;
}
- if ((indp->commonOptions &&
- xf86FindOption(indp->commonOptions, "CoreKeyboard")) ||
- (indp->extraOptions &&
- xf86FindOption(indp->extraOptions, "CoreKeyboard"))) {
- haveKeyboard = TRUE;
+ if (indp->extraOptions &&
+ xf86CheckBoolOption(indp->extraOptions, "CoreKeyboard", FALSE)) {
+ opt2 = indp->extraOptions;
+ }
+ if (opt1 || opt2) {
+ if (!coreKeyboard) {
+ coreKeyboard = indp;
+ } else {
+ if (opt1)
+ xf86ReplaceBoolOption(opt1, "CoreKeyboard", FALSE);
+ if (opt2)
+ xf86ReplaceBoolOption(opt2, "CoreKeyboard", FALSE);
+ xf86Msg(X_WARNING, "Duplicate core keyboard devices. "
+ "Removing core keyboard attribute from \"%s\"\n",
+ indp->identifier);
+ }
}
count++;
}
- if (!havePointer) {
- if (xf86PointerName) {
- confInput = xf86findInput(xf86PointerName,
- xf86configptr->conf_input_lst);
- if (!confInput) {
- xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
- xf86PointerName);
- return FALSE;
+
+ confInput = NULL;
+
+ /* 1. Check for the -pointer command line option. */
+ if (xf86PointerName) {
+ confInput = xf86findInput(xf86PointerName,
+ xf86configptr->conf_input_lst);
+ if (!confInput) {
+ xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
+ xf86PointerName);
+ return FALSE;
+ }
+ from = X_CMDLINE;
+ /*
+ * If one was already specified in the ServerLayout, it needs to be
+ * removed.
+ */
+ if (corePointer) {
+ for (indp = servlayoutp->inputs; indp->identifier; indp++)
+ if (indp == corePointer)
+ break;
+ for (; indp->identifier; indp++)
+ indp[0] = indp[1];
+ count--;
+ }
+ corePointer = NULL;
+ foundPointer = TRUE;
+ }
+
+ /* 2. ServerLayout-specified core pointer. */
+ if (corePointer) {
+ foundPointer = TRUE;
+ from = X_CONFIG;
+ }
+
+ /* 3. First core pointer device. */
+ if (!foundPointer) {
+ XF86ConfInputPtr p;
+
+ for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
+ if (p->inp_option_lst &&
+ xf86CheckBoolOption(p->inp_option_lst, "CorePointer", FALSE)) {
+ confInput = p;
+ foundPointer = TRUE;
+ from = X_DEFAULT;
+ pointerMsg = "first core pointer device";
+ break;
}
- from = X_CMDLINE;
- } else {
+ }
+ }
+
+ /* 4. First pointer with 'mouse' as the driver. */
+ if (!foundPointer) {
+ confInput = xf86findInput(CONF_IMPLICIT_POINTER,
+ xf86configptr->conf_input_lst);
+ if (!confInput) {
+ confInput = xf86findInputByDriver("mouse",
+ xf86configptr->conf_input_lst);
+ }
+ if (confInput) {
+ foundPointer = TRUE;
from = X_DEFAULT;
- confInput = xf86findInput(CONF_IMPLICIT_POINTER,
- xf86configptr->conf_input_lst);
- if (!confInput && implicitLayout) {
- confInput = xf86findInputByDriver("mouse",
- xf86configptr->conf_input_lst);
- }
+ pointerMsg = "first mouse device";
+ }
+ }
+
+ /* 5. Built-in default. */
+ if (!foundPointer) {
+ bzero(&defPtr, sizeof(defPtr));
+ defPtr.inp_identifier = "<default pointer>";
+ defPtr.inp_driver = "mouse";
+ confInput = &defPtr;
+ foundPointer = TRUE;
+ from = X_DEFAULT;
+ pointerMsg = "default mouse configuration";
+ }
+
+ /* Add the core pointer device to the layout, and set it to Core. */
+ if (foundPointer && confInput) {
+ foundPointer = configInput(&Pointer, confInput, from);
+ if (foundPointer) {
+ count++;
+ indp = xnfrealloc(servlayoutp->inputs,
+ (count + 1) * sizeof(IDevRec));
+ indp[count - 1] = Pointer;
+ indp[count - 1].extraOptions =
+ xf86addNewOption(NULL, "CorePointer", NULL);
+ indp[count].identifier = NULL;
+ servlayoutp->inputs = indp;
}
- if (confInput)
- foundPointer = configInput(&Pointer, confInput, from);
- }
- if (!haveKeyboard) {
- if (xf86KeyboardName) {
- confInput = xf86findInput(xf86KeyboardName,
- xf86configptr->conf_input_lst);
- if (!confInput) {
- xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
- xf86KeyboardName);
- return FALSE;
+ }
+
+ if (!foundPointer) {
+ /* This shouldn't happen. */
+ xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
+ return FALSE;
+ }
+
+ confInput = NULL;
+
+ /* 1. Check for the -keyboard command line option. */
+ if (xf86KeyboardName) {
+ confInput = xf86findInput(xf86KeyboardName,
+ xf86configptr->conf_input_lst);
+ if (!confInput) {
+ xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
+ xf86KeyboardName);
+ return FALSE;
+ }
+ from = X_CMDLINE;
+ /*
+ * If one was already specified in the ServerLayout, it needs to be
+ * removed.
+ */
+ if (coreKeyboard) {
+ for (indp = servlayoutp->inputs; indp->identifier; indp++)
+ if (indp == coreKeyboard)
+ break;
+ for (; indp->identifier; indp++)
+ indp[0] = indp[1];
+ count--;
+ }
+ coreKeyboard = NULL;
+ foundKeyboard = TRUE;
+ }
+
+ /* 2. ServerLayout-specified core keyboard. */
+ if (coreKeyboard) {
+ foundKeyboard = TRUE;
+ from = X_CONFIG;
+ }
+
+ /* 3. First core keyboard device. */
+ if (!foundKeyboard) {
+ XF86ConfInputPtr p;
+
+ for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
+ if (p->inp_option_lst &&
+ xf86CheckBoolOption(p->inp_option_lst, "CoreKeyboard", FALSE)) {
+ confInput = p;
+ foundKeyboard = TRUE;
+ from = X_DEFAULT;
+ keyboardMsg = "first core keyboard device";
+ break;
}
- from = X_CMDLINE;
- } else {
+ }
+ }
+
+ /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
+ if (!foundKeyboard) {
+ confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
+ xf86configptr->conf_input_lst);
+ if (!confInput) {
+ confInput = xf86findInputByDriver("keyboard",
+ xf86configptr->conf_input_lst);
+ }
+ if (!confInput) {
+ confInput = xf86findInputByDriver("kbd",
+ xf86configptr->conf_input_lst);
+ }
+ if (confInput) {
+ foundKeyboard = TRUE;
from = X_DEFAULT;
- confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
- xf86configptr->conf_input_lst);
- if (!confInput && implicitLayout) {
- confInput = xf86findInputByDriver("keyboard",
- xf86configptr->conf_input_lst);
- }
+ pointerMsg = "first keyboard device";
}
- if (confInput)
- foundKeyboard = configInput(&Keyboard, confInput, from);
}
- if (foundPointer) {
- count++;
- indp = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(IDevRec));
- indp[count - 1] = Pointer;
- indp[count - 1].extraOptions = xf86addNewOption(NULL, "CorePointer", NULL);
- indp[count].identifier = NULL;
- servlayoutp->inputs = indp;
- } else if (!havePointer) {
- if (implicitLayout)
- xf86Msg(X_ERROR, "Unable to find a core pointer device\n");
- else
- xf86Msg(X_ERROR, "No core pointer device specified\n");
- return FALSE;
+
+ /* 5. Built-in default. */
+ if (!foundKeyboard) {
+ bzero(&defKbd, sizeof(defKbd));
+ defKbd.inp_identifier = "<default keyboard>";
+ defKbd.inp_driver = "keyboard";
+ confInput = &defKbd;
+ foundKeyboard = TRUE;
+ keyboardMsg = "default keyboard configuration";
+ from = X_DEFAULT;
}
- if (foundKeyboard) {
- count++;
- indp = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(IDevRec));
- indp[count - 1] = Keyboard;
- indp[count - 1].extraOptions = xf86addNewOption(NULL, "CoreKeyboard", NULL);
- indp[count].identifier = NULL;
- servlayoutp->inputs = indp;
- } else if (!haveKeyboard) {
- if (implicitLayout)
- xf86Msg(X_ERROR, "Unable to find a core keyboard device\n");
- else
- xf86Msg(X_ERROR, "No core keyboard device specified\n");
+
+ /* Add the core keyboard device to the layout, and set it to Core. */
+ if (foundKeyboard && confInput) {
+ foundKeyboard = configInput(&Keyboard, confInput, from);
+ if (foundKeyboard) {
+ count++;
+ indp = xnfrealloc(servlayoutp->inputs,
+ (count + 1) * sizeof(IDevRec));
+ indp[count - 1] = Keyboard;
+ indp[count - 1].extraOptions =
+ xf86addNewOption(NULL, "CoreKeyboard", NULL);
+ indp[count].identifier = NULL;
+ servlayoutp->inputs = indp;
+ }
+ }
+
+ if (!foundKeyboard) {
+ /* This shouldn't happen. */
+ xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
return FALSE;
}
+
+ if (pointerMsg) {
+ xf86Msg(X_WARNING, "The core pointer device wasn't specified "
+ "explicitly in the layout.\n"
+ "\tUsing the %s.\n", pointerMsg);
+ }
+
+ if (keyboardMsg) {
+ xf86Msg(X_WARNING, "The core keyboard device wasn't specified "
+ "explicitly in the layout.\n"
+ "\tUsing the %s.\n", keyboardMsg);
+ }
+
return TRUE;
}
@@ -1767,6 +2001,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
int count = 0;
XF86ConfDisplayPtr dispptr;
XF86ConfAdaptorLinkPtr conf_adaptor;
+ Bool defaultMonitor = FALSE;
xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier,
scrnum);
@@ -1779,8 +2014,29 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
screenp->defaultbpp = conf_screen->scrn_defaultbpp;
screenp->defaultfbbpp = conf_screen->scrn_defaultfbbpp;
screenp->monitor = xnfcalloc(1, sizeof(MonRec));
- if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor))
- return FALSE;
+ /* If no monitor is specified, create a default one. */
+ if (!conf_screen->scrn_monitor) {
+ XF86ConfMonitorRec defMon;
+
+ bzero(&defMon, sizeof(defMon));
+ defMon.mon_identifier = "<default monitor>";
+ /*
+ * TARGET_REFRESH_RATE may be defined to effectively limit the
+ * default resolution to the largest that has a "good" refresh
+ * rate.
+ */
+#ifdef TARGET_REFRESH_RATE
+ defMon.mon_option_lst = xf86ReplaceRealOption(defMon.mon_option_lst,
+ "TargetRefresh",
+ TARGET_REFRESH_RATE);
+#endif
+ if (!configMonitor(screenp->monitor, &defMon))
+ return FALSE;
+ defaultMonitor = TRUE;
+ } else {
+ if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor))
+ return FALSE;
+ }
screenp->device = xnfcalloc(1, sizeof(GDevRec));
configDevice(screenp->device,conf_screen->scrn_device, TRUE);
screenp->device->myScreenSection = screenp;
@@ -1822,6 +2078,10 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
conf_adaptor = (XF86ConfAdaptorLinkPtr)conf_adaptor->list.next;
}
+ if (defaultMonitor) {
+ xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n"
+ "\tUsing a default monitor configuration.\n", screenp->id);
+ }
return TRUE;
}
@@ -2149,7 +2409,7 @@ configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
return TRUE;
}
-
+
static Bool
modeIsPresent(char * modename,MonPtr monitorp)
{
@@ -2207,35 +2467,38 @@ addDefaultModes(MonPtr monitorp)
/*
* load the config file and fill the global data structure
*/
-Bool
-xf86HandleConfigFile(void)
+ConfigStatus
+xf86HandleConfigFile(Bool autoconfig)
{
const char *filename;
char *searchpath;
MessageType from = X_DEFAULT;
- if (getuid() == 0)
- searchpath = ROOT_CONFIGPATH;
- else
- searchpath = USER_CONFIGPATH;
-
- if (xf86ConfigFile)
- from = X_CMDLINE;
+ if (!autoconfig) {
+ if (getuid() == 0)
+ searchpath = ROOT_CONFIGPATH;
+ else
+ searchpath = USER_CONFIGPATH;
- filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT);
- if (filename) {
- xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename);
- xf86ConfigFile = xnfstrdup(filename);
- } else {
- xf86Msg(X_ERROR, "Unable to locate/open config file");
if (xf86ConfigFile)
- xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile);
- xf86ErrorFVerb(0, "\n");
- return FALSE;
+ from = X_CMDLINE;
+
+ filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT);
+ if (filename) {
+ xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename);
+ xf86ConfigFile = xnfstrdup(filename);
+ } else {
+ xf86Msg(X_ERROR, "Unable to locate/open config file");
+ if (xf86ConfigFile)
+ xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile);
+ xf86ErrorFVerb(0, "\n");
+ return CONFIG_NOFILE;
+ }
}
+
if ((xf86configptr = xf86readConfigFile ()) == NULL) {
xf86Msg(X_ERROR, "Problem parsing the config file\n");
- return FALSE;
+ return CONFIG_PARSE_ERROR;
}
xf86closeConfigFile ();
@@ -2260,7 +2523,7 @@ xf86HandleConfigFile(void)
if (!configImpliedLayout(&xf86ConfigLayout,
xf86configptr->conf_screen_lst)) {
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
- return FALSE;
+ return CONFIG_PARSE_ERROR;
}
} else {
if (xf86configptr->conf_flags != NULL) {
@@ -2272,13 +2535,13 @@ xf86HandleConfigFile(void)
if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst,
dfltlayout)) {
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
- return FALSE;
+ return CONFIG_PARSE_ERROR;
}
} else {
if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst,
NULL)) {
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
- return FALSE;
+ return CONFIG_PARSE_ERROR;
}
}
}
@@ -2293,7 +2556,7 @@ xf86HandleConfigFile(void)
#endif
) {
ErrorF ("Problem when converting the config data structures\n");
- return FALSE;
+ return CONFIG_PARSE_ERROR;
}
/*
@@ -2317,7 +2580,7 @@ xf86HandleConfigFile(void)
if (xf86AllowMouseOpenFail)
xf86Info.allowMouseOpenFail = TRUE;
- return TRUE;
+ return CONFIG_OK;
}
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
index 6a24df0e0..e54da3d09 100644
--- a/hw/xfree86/common/xf86Config.h
+++ b/hw/xfree86/common/xf86Config.h
@@ -1,6 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.5 2000/02/24 05:36:50 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.7 2003/10/08 14:58:27 dawes Exp $ */
+
/*
- * Copyright 1997 by The XFree86 Project, Inc
+ * Copyright (c) 1997-2000 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
#ifndef _xf86_config_h
@@ -13,6 +37,12 @@
extern XF86ConfigPtr xf86configptr;
#endif
+typedef enum _ConfigStatus {
+ CONFIG_OK = 0,
+ CONFIG_PARSE_ERROR,
+ CONFIG_NOFILE
+} ConfigStatus;
+
/*
* prototypes
*/
@@ -22,6 +52,8 @@ char ** xf86DriverlistFromCompile(void);
char ** xf86InputDriverlistFromConfig(void);
char ** xf86InputDriverlistFromCompile(void);
Bool xf86BuiltinInputDriver(const char *);
-Bool xf86HandleConfigFile(void);
+ConfigStatus xf86HandleConfigFile(Bool);
+
+Bool xf86AutoConfig(void);
#endif /* _xf86_config_h */
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 687730ea5..3dde4ba7d 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.78 2003/01/18 07:27:13 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.81 2003/10/29 04:17:21 dawes Exp $ */
/*
* Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
*
@@ -46,7 +46,7 @@
#include "Configint.h"
#include "vbe.h"
#include "xf86DDC.h"
-#ifdef __sparc__
+#if defined(__sparc__) && !defined(__OpenBSD__)
#include "xf86Bus.h"
#include "xf86Sbus.h"
#endif
@@ -55,7 +55,7 @@
typedef struct _DevToConfig {
GDevRec GDev;
pciVideoPtr pVideo;
-#ifdef __sparc__
+#if defined(__sparc__) && !defined(__OpenBSD__)
sbusDevicePtr sVideo;
#endif
int iDriver;
@@ -280,6 +280,8 @@ configureInputSection (void)
DFLT_MOUSE_DEV = "/dev/wsmouse";
DFLT_MOUSE_PROTO = "wsmouse";
close(fd);
+ } else {
+ ErrorF("cannot open /dev/wsmouse\n");
}
#endif
@@ -868,7 +870,7 @@ DoConfigure()
xf86DoConfigurePass1 = FALSE;
/* Try to get DDC information filled in */
xf86ConfigFile = filename;
- if (!xf86HandleConfigFile()) {
+ if (xf86HandleConfigFile(FALSE) != CONFIG_OK) {
goto bail;
}
@@ -990,7 +992,7 @@ DoConfigure()
ErrorF("To test the server, run 'XFree86 -xf86config %s'\n\n", filename);
bail:
- OsCleanup();
+ OsCleanup(TRUE);
AbortDDX();
fflush(stderr);
exit(0);
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 1a214c4ad..22b7b00e6 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.35 2003/02/13 10:49:38 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.37 2003/11/07 22:20:17 dawes Exp $ */
+/*
+ * Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: xf86Cursor.c /main/10 1996/10/19 17:58:23 kaleb $ */
#define NEED_EVENTS
@@ -77,11 +104,16 @@ xf86InitViewport(ScrnInfoPtr pScr)
/*
* Compute the initial Viewport if necessary
*/
- if (pScr->frameX0 < 0)
- {
+ if (pScr->display) {
+ if (pScr->display->frameX0 < 0) {
pScr->frameX0 = (pScr->virtualX - pScr->modes->HDisplay) / 2;
pScr->frameY0 = (pScr->virtualY - pScr->modes->VDisplay) / 2;
+ } else {
+ pScr->frameX0 = pScr->display->frameX0;
+ pScr->frameY0 = pScr->display->frameY0;
}
+ }
+
pScr->frameX1 = pScr->frameX0 + pScr->modes->HDisplay - 1;
pScr->frameY1 = pScr->frameY0 + pScr->modes->VDisplay - 1;
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 1ad8b42ff..5e4bc29b6 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -1,9 +1,32 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.47 2003/08/24 17:36:51 dawes Exp $ */
/*
- 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 $ */
+ * Copyright (c) 1998-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ *
+ * Written by Mark Vojkovich
+ */
#include "xf86.h"
#include "xf86str.h"
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index 0de054ff3..df968797c 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.8 2003/02/13 02:41:09 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.11 2003/11/11 21:02:28 dawes Exp $ */
/*
- * Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -14,6 +37,8 @@
#include "xf86.h"
#include "xf86Priv.h"
#ifdef DPMSExtension
+#define DPMS_SERVER
+#include "extensions/dpms.h"
#include "dpmsproc.h"
#endif
@@ -30,6 +55,7 @@ Bool
xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
{
#ifdef DPMSExtension
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
DPMSPtr pDPMS;
pointer DPMSOpt;
@@ -45,13 +71,12 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
return FALSE;
pDPMS = (DPMSPtr)pScreen->devPrivates[DPMSIndex].ptr;
- pDPMS->Set = set;
+ pScrn->DPMSSet = set;
pDPMS->Flags = flags;
- DPMSOpt = xf86FindOption(xf86Screens[pScreen->myNum]->options, "dpms");
+ DPMSOpt = xf86FindOption(pScrn->options, "dpms");
if (DPMSOpt) {
if ((pDPMS->Enabled
- = xf86SetBoolOption(xf86Screens[pScreen->myNum]->options,
- "dpms",FALSE))
+ = xf86SetBoolOption(pScrn->options, "dpms", FALSE))
&& !DPMSDisabledSwitch)
DPMSEnabled = TRUE;
xf86MarkOptionUsed(DPMSOpt);
@@ -111,18 +136,23 @@ DPMSSet(int level)
{
int i;
DPMSPtr pDPMS;
+ ScrnInfoPtr pScrn;
DPMSPowerLevel = level;
if (DPMSIndex < 0)
return;
+ if (level != DPMSModeOn)
+ SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverActive);
+
/* For each screen, set the DPMS level */
for (i = 0; i < xf86NumScreens; i++) {
+ pScrn = xf86Screens[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);
+ if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) {
+ xf86EnableAccess(pScrn);
+ pScrn->DPMSSet(pScrn, level, 0);
}
}
}
@@ -137,6 +167,7 @@ DPMSSupported(void)
{
int i;
DPMSPtr pDPMS;
+ ScrnInfoPtr pScrn;
if (DPMSIndex < 0) {
return FALSE;
@@ -144,8 +175,9 @@ DPMSSupported(void)
/* For each screen, check if DPMS is supported */
for (i = 0; i < xf86NumScreens; i++) {
+ pScrn = xf86Screens[i];
pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr;
- if (pDPMS && pDPMS->Set)
+ if (pDPMS && pScrn->DPMSSet)
return TRUE;
}
return FALSE;
diff --git a/hw/xfree86/common/xf86Date.h b/hw/xfree86/common/xf86Date.h
index 506e05370..754e20d18 100644
--- a/hw/xfree86/common/xf86Date.h
+++ b/hw/xfree86/common/xf86Date.h
@@ -1,7 +1,33 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.3.2.3 2003/05/10 01:10:10 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.52 2003/11/21 06:01:44 dawes Exp $ */
+/*
+ * Copyright (c) 2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef XF86_DATE
-#define XF86_DATE "9 May 2003"
+#define XF86_DATE "20 November 2003"
#endif
diff --git a/hw/xfree86/common/xf86Debug.c b/hw/xfree86/common/xf86Debug.c
index b069743a1..3bf21689f 100644
--- a/hw/xfree86/common/xf86Debug.c
+++ b/hw/xfree86/common/xf86Debug.c
@@ -1,4 +1,35 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.4 2001/12/13 18:01:50 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.7 2003/09/24 02:43:17 dawes Exp $ */
+
+/*
+ * Copyright (c) 2000-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
#include <sys/time.h>
#include <unistd.h>
@@ -154,7 +185,7 @@ xf86SPTimestamp(xf86TsPtr* timestamp, char *str)
else
diff = ((*timestamp)->sec - ts.tv_sec) * 1000
+(- ts.tv_usec + (*timestamp)->usec) / 1000;
- ErrorF("%s Elapsed: %i\n",str,diff);
+ ErrorF("%s Elapsed: %li\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
index abef13110..7257b204b 100644
--- a/hw/xfree86/common/xf86DefModes.c
+++ b/hw/xfree86/common/xf86DefModes.c
@@ -1,14 +1,17 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.9 2002/11/11 04:24:40 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.10 2003/11/03 05:11:02 tsi Exp $ */
/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
* modeline2c.pl */
/*
- * Copyright 1999 by The XFree86 Project, Inc.
+ * Copyright 1999-2003 by The XFree86 Project, Inc.
*
* Author: Dirk Hohndel <hohndel@XFree86.Org>
*/
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
#include "xf86.h"
#include "xf86Config.h"
#include "xf86Priv.h"
@@ -16,7 +19,7 @@
#include "globals.h"
-#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT
+#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, 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 [] = {
diff --git a/hw/xfree86/common/xf86DoProbe.c b/hw/xfree86/common/xf86DoProbe.c
index 518f67214..eece97719 100644
--- a/hw/xfree86/common/xf86DoProbe.c
+++ b/hw/xfree86/common/xf86DoProbe.c
@@ -1,10 +1,34 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.11 2002/07/02 02:00:03 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.14 2003/10/29 04:17:21 dawes Exp $ */
/*
- * finish setting up the server
- * Load the driver modules and call their probe functions.
+ * Copyright (c) 1999-2002 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:
*
- * Copyright 1999 by The XFree86 Project, Inc.
+ * 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/*
+ * finish setting up the server
+ * Load the driver modules and call their probe functions.
*/
#include <ctype.h>
@@ -67,16 +91,14 @@ DoProbe()
/* If we have a result, then call driver's Identify function */
if (xf86DriverList[i]->Identify != NULL) {
- int verbose = xf86Verbose;
-
- xf86Verbose = 1;
+ int verbose = xf86SetVerbosity(1);
(*xf86DriverList[i]->Identify)(0);
- xf86Verbose = verbose;
+ xf86SetVerbosity(verbose);
}
}
}
- OsCleanup();
+ OsCleanup(TRUE);
AbortDDX();
fflush(stderr);
exit(0);
diff --git a/hw/xfree86/common/xf86DoScanPci.c b/hw/xfree86/common/xf86DoScanPci.c
index 2328d2b05..8938c1d96 100644
--- a/hw/xfree86/common/xf86DoScanPci.c
+++ b/hw/xfree86/common/xf86DoScanPci.c
@@ -1,11 +1,34 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.15 2003/09/23 06:43:46 dawes Exp $ */
+/*
+ * Copyright (c) 1999-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
-/* $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>
@@ -38,11 +61,12 @@ void DoScanPci(int argc, char **argv, int i)
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...
+ * The old verbosity processing that was here isn't useful anymore, but
+ * for compatibility purposes, ignore verbosity changes after the -scanpci
+ * flag.
*/
- globalVerbose = --xf86Verbose;
+ 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
@@ -51,14 +75,19 @@ void DoScanPci(int argc, char **argv, int i)
if ((skip = ddxProcessArgument(argc, argv, j)))
j += (skip - 1);
}
+
/*
- * was the verbosity level increased?
+ * Was the verbosity level increased? If so, set it back.
*/
- if( (globalVerbose == 0) && (xf86Verbose > 0) )
- scanpciVerbose = xf86Verbose - globalVerbose -1;
- else
- scanpciVerbose = xf86Verbose - globalVerbose;
- xf86Verbose = globalVerbose;
+ if (xf86Verbose > globalVerbose)
+ xf86SetVerbosity(globalVerbose);
+
+ /*
+ * Setting scanpciVerbose to 0 will ensure that the output will go to
+ * stderr for all reasonable default stderr verbosity levels.
+ */
+ scanpciVerbose = 0;
+
/*
* now get the loader set up and load the scanpci module
*/
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 4d0efbcb9..1c3f3a34f 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.146 2003/02/20 04:20:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.158 2003/11/03 05:11:02 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -21,10 +21,41 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */
/* [JCH-96/01/21] Extended std reverse map to four buttons. */
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
+
#include "X.h"
#include "Xpoll.h"
#include "Xproto.h"
@@ -315,10 +346,14 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
CloseDownClient(server);
}
break;
-#if !defined(__SOL8__) && (!defined(sun) || defined(i386))
+#if !defined(__SOL8__) && !defined(__UNIXOS2__) && !defined(sgi) && \
+ (!defined(sun) || defined(i386))
case ACTION_SWITCHSCREEN:
if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) {
int vtno = *((int *) arg);
+#ifdef SCO
+ vtno--;
+#endif
#if defined(QNX4)
xf86Info.vtRequestsPending = vtno;
#else
@@ -329,8 +364,12 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
break;
case ACTION_SWITCHSCREEN_NEXT:
if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
+#if defined(SCO) /* Shouldn't this be true for (sun) && (i386) && (SVR4) ? */
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
+#else
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno + 1) < 0)
-#if defined(SCO) || (defined(sun) && defined (i386) && defined (SVR4))
+#endif
+#if defined (SCO) || (defined(sun) && defined (i386) && defined (SVR4))
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 0) < 0)
#else
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) < 0)
@@ -339,12 +378,36 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
}
break;
case ACTION_SWITCHSCREEN_PREV:
- if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
+ if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) {
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno - 1) < 0)
ErrorF("Failed to switch consoles (%s)\n", strerror(errno));
}
break;
#endif
+ case ACTION_MESSAGE:
+ {
+ char *retstr, *message = (char *) arg;
+ ScrnInfoPtr pScr = XF86SCRNINFO(xf86Info.currentScreen);
+
+#ifdef DEBUG
+ ErrorF("ActionMessage: '%s'\n", message);
+#endif
+ /* Okay the message made it to the ddx. The common layer */
+ /* can check for relevant messages here and react to any */
+ /* that have a global effect. For example: */
+ /* */
+ /* if (!strcmp(message, "foo") { */
+ /* do_foo(); break */
+ /* } */
+ /* */
+ /* otherwise fallback to sending a key event message to */
+ /* the current screen's driver: */
+ if (*pScr->HandleMessage) {
+ (void) (*pScr->HandleMessage)(pScr->scrnIndex,
+ "KeyEventMessage", message, &retstr);
+ }
+ }
+ break;
default:
break;
}
@@ -384,7 +447,7 @@ xf86PostKbdEvent(unsigned key)
#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
static Bool first_time = TRUE;
#endif
-#if defined(__sparc__)
+#if defined(__sparc__) && defined(__linux__)
static int kbdSun = -1;
#endif
/* Disable any keyboard processing while in suspend */
@@ -400,7 +463,7 @@ xf86PostKbdEvent(unsigned key)
}
#endif
-#if defined (__sparc__)
+#if defined (__sparc__) && defined(__linux__)
if (kbdSun == -1) {
if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun"))
|| (xf86Info.xkbrules && !strcmp(xf86Info.xkbrules, "sun")))
@@ -410,26 +473,7 @@ xf86PostKbdEvent(unsigned key)
}
if (kbdSun)
goto special;
-#endif /* __sparc__ */
-
-#if defined (i386) && defined (SVR4)
- /*
- * PANIX returns DICOP standards based keycodes in using 106jp
- * keyboard. We need to remap some keys.
- */
- if(xf86Info.panix106 == TRUE){
- switch (scanCode) {
- case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */
- case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/
- case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */
- case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */
- case 0x6B: scanCode = KEY_Left; break; /* Cur Left */
- case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */
- case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */
- case 0x73: scanCode = KEY_RCtrl; break; /* not needed */
- }
- }
-#endif /* i386 && SVR4 */
+#endif /* __sparc__ && __linux__ */
#ifdef __linux__
if (xf86Info.kbdCustomKeycodes) {
@@ -461,6 +505,56 @@ xf86PostKbdEvent(unsigned key)
break;
#endif
}
+#if defined (i386) && defined (SVR4)
+ /*
+ * PANIX returns DICOP standards based keycodes in using 106jp
+ * keyboard. We need to remap some keys.
+ */
+ if(xf86Info.panix106 == TRUE){
+ switch (scanCode) {
+ case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */
+ case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/
+ case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */
+ case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */
+ case 0x6B: scanCode = KEY_Left; break; /* Cur Left */
+ case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */
+ case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */
+ case 0x73: scanCode = KEY_RCtrl; break; /* not needed */
+ }
+ } else
+#endif /* i386 && SVR4 */
+ {
+ switch (scanCode) {
+ case 0x59: scanCode = KEY_0x59; break;
+ case 0x5a: scanCode = KEY_0x5A; break;
+ case 0x5b: scanCode = KEY_0x5B; break;
+ case 0x5c: scanCode = KEY_KP_Equal; break; /* Keypad Equal */
+ case 0x5d: scanCode = KEY_0x5D; break;
+ case 0x5e: scanCode = KEY_0x5E; break;
+ case 0x5f: scanCode = KEY_0x5F; break;
+ case 0x62: scanCode = KEY_0x62; break;
+ case 0x63: scanCode = KEY_0x63; break;
+ case 0x64: scanCode = KEY_0x64; break;
+ case 0x65: scanCode = KEY_0x65; break;
+ case 0x66: scanCode = KEY_0x66; break;
+ case 0x67: scanCode = KEY_0x67; break;
+ case 0x68: scanCode = KEY_0x68; break;
+ case 0x69: scanCode = KEY_0x69; break;
+ case 0x6a: scanCode = KEY_0x6A; break;
+ case 0x6b: scanCode = KEY_0x6B; break;
+ case 0x6c: scanCode = KEY_0x6C; break;
+ case 0x6d: scanCode = KEY_0x6D; break;
+ case 0x6e: scanCode = KEY_0x6E; break;
+ case 0x6f: scanCode = KEY_0x6F; break;
+ case 0x70: scanCode = KEY_0x70; break;
+ case 0x71: scanCode = KEY_0x71; break;
+ case 0x72: scanCode = KEY_0x72; break;
+ case 0x73: scanCode = KEY_0x73; break;
+ case 0x74: scanCode = KEY_0x74; break;
+ case 0x75: scanCode = KEY_0x75; break;
+ case 0x76: scanCode = KEY_0x76; break;
+ }
+ }
}
else if (
@@ -534,6 +628,19 @@ xf86PostKbdEvent(unsigned key)
scanCode = KEY_Pause; /* pause */
}
+#ifndef __sparc64__
+ /*
+ * PC keyboards generate separate key codes for
+ * Alt+Print and Control+Pause but in the X keyboard model
+ * they need to get the same key code as the base key on the same
+ * physical keyboard key.
+ */
+ if (scanCode == KEY_SysReqest)
+ scanCode = KEY_Print;
+ else if (scanCode == KEY_Break)
+ scanCode = KEY_Pause;
+#endif
+
/*
* and now get some special keysequences
*/
@@ -568,7 +675,7 @@ customkeycodes:
}
}
#endif
-#if defined (__sparc__)
+#if defined (__sparc__) && defined(__linux__)
special:
if (kbdSun) {
switch (scanCode) {
@@ -602,7 +709,7 @@ special:
*/
scanCode--;
}
-#endif /* defined (__sparc__) */
+#endif /* defined (__sparc__) && defined(__linux__) */
#ifdef XKB
if ((xf86Info.ddxSpecialKeys == SKWhenNeeded &&
@@ -692,9 +799,6 @@ special:
int vtno = specialkey - KEY_F1 + 1;
if (specialkey == KEY_F11 || specialkey == KEY_F12)
vtno = specialkey - KEY_F11 + 11;
-#ifdef SCO325
- vtno--;
-#endif
if (down)
xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
return;
@@ -829,17 +933,6 @@ special:
#endif
/*
- * PC keyboards generate separate key codes for
- * Alt+Print and Control+Pause but in the X keyboard model
- * they need to get the same key code as the base key on the same
- * physical keyboard key.
- */
- if (scanCode == KEY_SysReqest)
- scanCode = KEY_Print;
- else if (scanCode == KEY_Break)
- scanCode = KEY_Pause;
-
- /*
* Now map the scancodes to real X-keycodes ...
*/
keycode = scanCode + MIN_KEYCODE;
@@ -1060,16 +1153,16 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
pInfo = xf86InputDevs;
while (pInfo) {
if (pInfo->read_input && pInfo->fd >= 0 &&
- (FD_ISSET(pInfo->fd, ((fd_set *)pReadmask)) != 0)) {
+ (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
int sigstate = xf86BlockSIGIO();
pInfo->read_input(pInfo);
xf86UnblockSIGIO(sigstate);
/*
- * Must break here because more than one device may share
- * the same file descriptor.
+ * Remove the descriptior from the set because more than one
+ * device may share the same file descriptor.
*/
- break;
+ FD_CLR(pInfo->fd, &devicesWithInput);
}
pInfo = pInfo->next;
}
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 99c53fb0b..c6dee3731 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.40 2003/02/20 04:05:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.41 2003/08/24 17:36:52 dawes Exp $ */
/*
- * Copyright (c) 1997 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 73050eab7..713e7861a 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1,10 +1,36 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.128 2003/02/26 23:45:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.135 2003/10/08 14:58:27 dawes Exp $ */
/*
- * Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/*
* Authors: Dirk Hohndel <hohndel@XFree86.Org>
* David Dawes <dawes@XFree86.Org>
+ * ... and others
*
* This file includes the helper functions that the server provides for
* different drivers.
@@ -38,7 +64,6 @@
#endif
static int xf86ScrnInfoPrivateCount = 0;
-static FILE *logfile = NULL;
#ifdef XFree86LOADER
@@ -405,6 +430,14 @@ xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
/* Can the screen handle 24bpp pixmaps for 32bpp fb */
#define DO_PIX24FOR32(f) ((f & Support32bppFb) && (f & SupportConvert24to32))
+#ifndef GLOBAL_DEFAULT_DEPTH
+#define GLOBAL_DEFAULT_DEPTH 16
+#endif
+
+#ifndef GLOBAL_DEFAULT_FBBPP
+#define GLOBAL_DEFAULT_FBBPP 16
+#endif
+
Bool
xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
int depth24flags)
@@ -449,6 +482,39 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
scrp->depth = scrp->confScreen->defaultdepth;
scrp->depthFrom = X_CONFIG;
}
+
+ if (scrp->confScreen->defaultfbbpp <= 0 &&
+ scrp->confScreen->defaultdepth <= 0) {
+ /*
+ * Check for DefaultDepth and DefaultFbBpp options in the
+ * Device sections.
+ */
+ int i;
+ GDevPtr device;
+ Bool found = FALSE;
+
+ for (i = 0; i < scrp->numEntities; i++) {
+ device = xf86GetDevFromEntity(scrp->entityList[i],
+ scrp->entityInstanceList[i]);
+ if (device && device->options) {
+ if (xf86FindOption(device->options, "DefaultDepth")) {
+ scrp->depth = xf86SetIntOption(device->options,
+ "DefaultDepth", -1);
+ scrp->depthFrom = X_CONFIG;
+ found = TRUE;
+ }
+ if (xf86FindOption(device->options, "DefaultFbBpp")) {
+ scrp->bitsPerPixel = xf86SetIntOption(device->options,
+ "DefaultFbBpp",
+ -1);
+ scrp->bitsPerPixelFrom = X_CONFIG;
+ found = TRUE;
+ }
+ }
+ if (found)
+ break;
+ }
+ }
}
/* If none of these is set, pick a default */
@@ -459,8 +525,8 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
if (depth > 0)
scrp->depth = depth;
} else {
- scrp->bitsPerPixel = 8;
- scrp->depth = 8;
+ scrp->bitsPerPixel = GLOBAL_DEFAULT_FBBPP;
+ scrp->depth = GLOBAL_DEFAULT_DEPTH;
}
}
@@ -610,11 +676,46 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
break;
}
}
+
+ /*
+ * If an exact match can't be found, see if there is one with no
+ * depth or fbbpp specified.
+ */
+ if (i == scrp->confScreen->numdisplays) {
+ for (i = 0, disp = scrp->confScreen->displays;
+ i < scrp->confScreen->numdisplays; i++, disp++) {
+ if (disp->depth <= 0 && disp->fbbpp <= 0) {
+ scrp->display = disp;
+ break;
+ }
+ }
+ }
+
+ /*
+ * If all else fails, create a default one.
+ */
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->numdisplays++;
+ scrp->confScreen->displays =
+ xnfrealloc(scrp->confScreen->displays,
+ scrp->confScreen->numdisplays * sizeof(DispRec));
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Creating default Display subsection in Screen section\n"
+ "\t\"%s\" for depth/fbbpp %d/%d\n",
scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel);
- return FALSE;
+ memset(&scrp->confScreen->displays[i], 0, sizeof(DispRec));
+ scrp->confScreen->displays[i].blackColour.red = -1;
+ scrp->confScreen->displays[i].blackColour.green = -1;
+ scrp->confScreen->displays[i].blackColour.blue = -1;
+ scrp->confScreen->displays[i].whiteColour.red = -1;
+ scrp->confScreen->displays[i].whiteColour.green = -1;
+ scrp->confScreen->displays[i].whiteColour.blue = -1;
+ scrp->confScreen->displays[i].defaultVisual = -1;
+ scrp->confScreen->displays[i].modes = xnfalloc(sizeof(char *));
+ scrp->confScreen->displays[i].modes[0] = NULL;
+ scrp->confScreen->displays[i].depth = depth;
+ scrp->confScreen->displays[i].fbbpp = fbbpp;
+ scrp->display = &scrp->confScreen->displays[i];
}
/*
@@ -720,15 +821,17 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
if (scrp->weight.red)
xf86DrvMsg(scrp->scrnIndex, weightFrom, "RGB weight %d%d%d\n",
- scrp->weight.red, scrp->weight.green, scrp->weight.blue);
+ (int)scrp->weight.red, (int)scrp->weight.green,
+ (int)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);
+ "depth (%d)\n",
+ (int)scrp->weight.red, (int)scrp->weight.green,
+ (int)scrp->weight.blue, scrp->depth);
return FALSE;
}
if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->weight.red) {
@@ -1194,123 +1297,36 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
}
}
-/* 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 */
+#undef PREFIX_SIZE
+#define PREFIX_SIZE 14
+
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;
- }
+ char *tmpFormat;
- 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
- }
+ /* Prefix the scrnIndex name to the format string. */
+ if (scrnIndex >= 0 && scrnIndex < xf86NumScreens &&
+ xf86Screens[scrnIndex]->name) {
+ tmpFormat = xalloc(strlen(format) +
+ strlen(xf86Screens[scrnIndex]->name) +
+ PREFIX_SIZE + 1);
+ if (!tmpFormat)
+ return;
+
+ snprintf(tmpFormat, PREFIX_SIZE + 1, "%s(%d): ",
+ xf86Screens[scrnIndex]->name, scrnIndex);
+
+ strcat(tmpFormat, format);
+ LogVMessageVerb(type, verb, tmpFormat, args);
+ xfree(tmpFormat);
+ } else
+ LogVMessageVerb(type, verb, format, args);
}
+#undef PREFIX_SIZE
/* Print driver messages, with verbose level specified directly */
void
@@ -1365,7 +1381,7 @@ xf86ErrorFVerb(int verb, const char *format, ...)
va_start(ap, format);
if (xf86Verbose >= verb || xf86LogVerbose >= verb)
- VWrite(verb, format, ap);
+ LogVWrite(verb, format, ap);
va_end(ap);
}
@@ -1377,15 +1393,10 @@ xf86ErrorF(const char *format, ...)
va_start(ap, format);
if (xf86Verbose >= 1 || xf86LogVerbose >= 1)
- VWrite(1, format, ap);
+ LogVWrite(1, format, ap);
va_end(ap);
}
-void
-OsVendorVErrorF(const char *f, va_list args)
-{
- VWrite(-1, f, args);
-}
void
xf86LogInit()
@@ -1398,59 +1409,28 @@ xf86LogInit()
/* Get the log file name */
if (xf86LogFileFrom == X_DEFAULT) {
/* Append the display number and ".log" */
- lf = malloc(strlen(xf86LogFile) + strlen(display) +
+ lf = malloc(strlen(xf86LogFile) + strlen("%s") +
strlen(LOGSUFFIX) + 1);
if (!lf)
FatalError("Cannot allocate space for the log file name\n");
- sprintf(lf, "%s%s" LOGSUFFIX, xf86LogFile, display);
+ sprintf(lf, "%s%%s" LOGSUFFIX, xf86LogFile);
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);
+
+ xf86LogFile = LogInit(xf86LogFile, LOGOLDSUFFIX);
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;
- }
+ xf86SetVerbosity(xf86Verbose);
+ xf86SetLogVerbosity(xf86LogVerbose);
#undef LOGSUFFIX
+#undef LOGOLDSUFFIX
}
void
xf86CloseLog()
{
- if (logfile) {
- fclose(logfile);
- logfile = NULL;
- }
+ LogClose();
}
@@ -1826,7 +1806,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (dev || devBus)
xf86MsgVerb(X_WARNING, 0,
"%s: More than one matching Device section "
- "found: %s\n", devList[j]->identifier);
+ "found: %s\n", driverName, devList[j]->identifier);
else
dev = devList[j];
}
@@ -2233,7 +2213,6 @@ xf86GetVerbosity()
return max(xf86Verbose, xf86LogVerbose);
}
-
Pix24Flags
xf86GetPix24()
{
diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h
index 5cd66d882..32e3c8e1d 100644
--- a/hw/xfree86/common/xf86InPriv.h
+++ b/hw/xfree86/common/xf86InPriv.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.4 1999/05/17 13:17:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.5 2003/08/24 17:36:52 dawes Exp $ */
+
+/*
+ * 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _xf86InPriv_h
#define _xf86InPriv_h
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 7c65ce888..ce8817096 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1,16 +1,49 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.198 2003/02/26 09:21:38 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.211 2003/11/01 00:47:01 dawes 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.
*/
+/*
+ * Copyright (c) 1992-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include <stdlib.h>
+#undef HAS_UTSNAME
+#if !defined(WIN32) && !defined(__UNIXOS2__)
+#define HAS_UTSNAME 1
+#include <sys/utsname.h>
+#endif
+
#define NEED_EVENTS
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
#include "X.h"
#include "Xmd.h"
#include "Xproto.h"
@@ -134,7 +167,8 @@ xf86CreateRootWindow(WindowPtr pWin)
/* Can't find hook we are hung on */
xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */,
"xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n",
- xf86CreateRootWindow, pScreen->CreateWindow );
+ (void *)xf86CreateRootWindow,
+ (void *)pScreen->CreateWindow );
}
/* Unhook this function ... */
@@ -183,7 +217,8 @@ xf86CreateRootWindow(WindowPtr pWin)
xf86RegisteredPropertiesTable[pScreen->myNum] = NULL;
} else {
xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with "
- "non-root window %p (parent %p)\n", pWin, pWin->parent);
+ "non-root window %p (parent %p)\n",
+ (void *)pWin, (void *)pWin->parent);
ret = FALSE;
}
}
@@ -202,6 +237,46 @@ xf86CreateRootWindow(WindowPtr pWin)
* collecting the pixmap formats.
*/
+static void
+PostConfigInit(void)
+{
+ /*
+ * Install signal handler for unexpected signals
+ */
+ xf86Info.caughtSignal=FALSE;
+ if (!xf86Info.notrapSignals) {
+ signal(SIGSEGV,xf86SigHandler);
+ signal(SIGILL,xf86SigHandler);
+#ifdef SIGEMT
+ signal(SIGEMT,xf86SigHandler);
+#endif
+ signal(SIGFPE,xf86SigHandler);
+#ifdef SIGBUS
+ signal(SIGBUS,xf86SigHandler);
+#endif
+#ifdef SIGSYS
+ signal(SIGSYS,xf86SigHandler);
+#endif
+#ifdef SIGXCPU
+ signal(SIGXCPU,xf86SigHandler);
+#endif
+#ifdef SIGXFSZ
+ signal(SIGXFSZ,xf86SigHandler);
+#endif
+#ifdef MEMDEBUG
+ signal(SIGUSR2,xf86SigMemDebug);
+#endif
+ }
+
+ xf86OSPMClose = xf86OSPMOpen();
+
+ /* Run an external VT Init program if specified in the config file */
+ xf86RunVtInit();
+
+ /* Do this after XF86Config is read (it's normally in OsInit()) */
+ OsInitColors();
+}
+
void
InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
{
@@ -215,6 +290,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
Pix24Flags screenpix24, pix24;
MessageType pix24From = X_DEFAULT;
Bool pix24Fail = FALSE;
+ Bool autoconfig = FALSE;
#ifdef __UNIXOS2__
os2ServerVideoAccess(); /* See if we have access to the screen before doing anything */
@@ -257,51 +333,20 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
/* Read and parse the config file */
if (!xf86DoProbe && !xf86DoConfigure) {
- if (!xf86HandleConfigFile()) {
- xf86Msg(X_ERROR, "Error from xf86HandleConfigFile()\n");
+ switch (xf86HandleConfigFile(FALSE)) {
+ case CONFIG_OK:
+ break;
+ case CONFIG_PARSE_ERROR:
+ xf86Msg(X_ERROR, "Error parsing the config file\n");
return;
+ case CONFIG_NOFILE:
+ autoconfig = TRUE;
+ break;
}
}
- /*
- * Install signal handler for unexpected signals
- */
- xf86Info.caughtSignal=FALSE;
- if (!xf86Info.notrapSignals) {
- signal(SIGSEGV,xf86SigHandler);
- signal(SIGILL,xf86SigHandler);
-#ifdef SIGEMT
- signal(SIGEMT,xf86SigHandler);
-#endif
- signal(SIGFPE,xf86SigHandler);
-#ifdef SIGBUS
- signal(SIGBUS,xf86SigHandler);
-#endif
-#ifdef SIGSYS
- signal(SIGSYS,xf86SigHandler);
-#endif
-#ifdef SIGXCPU
- signal(SIGXCPU,xf86SigHandler);
-#endif
-#ifdef SIGXFSZ
- signal(SIGXFSZ,xf86SigHandler);
-#endif
-#ifdef MEMDEBUG
- signal(SIGUSR2,xf86SigMemDebug);
-#endif
- }
-
- xf86OpenConsole();
- xf86OSPMClose = xf86OSPMOpen();
-
- /* Run an external VT Init program if specified in the config file */
- xf86RunVtInit();
-
- /* Do this after XF86Config is read (it's normally in OsInit()) */
- OsInitColors();
-
- /* Enable full I/O access */
- xf86EnableIO();
+ if (!autoconfig)
+ PostConfigInit();
#ifdef XFree86LOADER
/* Initialise the loader */
@@ -349,6 +394,11 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
#endif
+ xf86OpenConsole();
+
+ /* Enable full I/O access */
+ xf86EnableIO();
+
/* Do a general bus probe. This will be a PCI probe for x86 platforms */
xf86BusProbe();
@@ -358,6 +408,14 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
if (xf86DoConfigure)
DoConfigure();
+ if (autoconfig) {
+ if (!xf86AutoConfig()) {
+ xf86Msg(X_ERROR, "Auto configuration failed\n");
+ return;
+ }
+ PostConfigInit();
+ }
+
/* Initialise the resource broker */
xf86ResourceBrokerInit();
@@ -597,7 +655,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
/* XXX Should this be before or after loading dependent modules? */
if (xf86ProbeOnly)
{
- OsCleanup();
+ OsCleanup(TRUE);
AbortDDX();
fflush(stderr);
exit(0);
@@ -743,7 +801,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
if (xf86OSPMClose)
xf86OSPMClose();
if ((xf86OSPMClose = xf86OSPMOpen()) != NULL)
- xf86MsgVerb(3,X_INFO,"APM registered successfully\n");
+ xf86MsgVerb(X_INFO, 3, "APM registered successfully\n");
/* Make sure full I/O access is enabled */
xf86EnableIO();
@@ -825,6 +883,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
*/
xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
xf86Screens[i]->SetDGAMode = xf86SetDGAMode;
+ xf86Screens[i]->DPMSSet = NULL;
+ xf86Screens[i]->LoadPalette = NULL;
+ xf86Screens[i]->SetOverscan = NULL;
scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv);
if (scr_index == i) {
/*
@@ -1198,6 +1259,26 @@ OsVendorFatalError()
ErrorF("\n");
}
+int
+xf86SetVerbosity(int verb)
+{
+ int save = xf86Verbose;
+
+ xf86Verbose = verb;
+ LogSetParameter(XLOG_VERBOSITY, verb);
+ return save;
+}
+
+int
+xf86SetLogVerbosity(int verb)
+{
+ int save = xf86LogVerbose;
+
+ xf86LogVerbose = verb;
+ LogSetParameter(XLOG_FILE_VERBOSITY, verb);
+ return save;
+}
+
/*
* ddxProcessArgument --
* Process device-dependent command line args. Returns 0 if argument is
@@ -1217,19 +1298,6 @@ ddxProcessArgument(int argc, char **argv, int i)
* yet. Use malloc/free instead.
*/
-#ifdef DDXOSVERRORF
- static Bool beenHere = FALSE;
-
- if (!beenHere) {
- /*
- * This initialises our hook into VErrorF() for catching log messages
- * that are generated before OsInit() is called.
- */
- OsVendorVErrorFProc = OsVendorVErrorF;
- beenHere = TRUE;
- }
-#endif
-
/* First the options that are only allowed for root */
if (getuid() == 0)
{
@@ -1346,11 +1414,11 @@ ddxProcessArgument(int argc, char **argv, int i)
val = strtol(argv[i], &end, 0);
if (*end == '\0')
{
- xf86Verbose = val;
+ xf86SetVerbosity(val);
return 2;
}
}
- xf86Verbose++;
+ xf86SetVerbosity(++xf86Verbose);
return 1;
}
if (!strcmp(argv[i],"-logverbose"))
@@ -1362,16 +1430,16 @@ ddxProcessArgument(int argc, char **argv, int i)
val = strtol(argv[i], &end, 0);
if (*end == '\0')
{
- xf86LogVerbose = val;
+ xf86SetLogVerbosity(val);
return 2;
}
}
- xf86LogVerbose++;
+ xf86SetLogVerbosity(++xf86LogVerbose);
return 1;
}
if (!strcmp(argv[i],"-quiet"))
{
- xf86Verbose = 0;
+ xf86SetVerbosity(0);
return 1;
}
if (!strcmp(argv[i],"-showconfig") || !strcmp(argv[i],"-version"))
@@ -1659,7 +1727,17 @@ xf86PrintBanner()
ErrorF("X Protocol Version %d, Revision %d, %s\n",
X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE );
ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR);
-#ifdef BUILD_DATE
+#ifdef HAS_UTSNAME
+ {
+ struct utsname name;
+
+ if (uname(&name) == 0) {
+ ErrorF("Current Operating System: %s %s %s %s %s\n",
+ name.sysname, name.nodename, name.release, name.version, name.machine);
+ }
+ }
+#endif
+#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
{
struct tm t;
char buf[100];
@@ -1673,6 +1751,20 @@ xf86PrintBanner()
ErrorF("Build Date: %s\n", buf);
}
#endif
+#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
+ {
+ struct tm t;
+ char buf[100];
+
+ bzero(&t, sizeof(t));
+ bzero(buf, sizeof(buf));
+ t.tm_mday = CLOG_DATE % 100;
+ t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
+ t.tm_year = CLOG_DATE / 10000 - 1900;
+ if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
+ ErrorF("Changelog Date: %s\n", buf);
+ }
+#endif
#if defined(BUILDERSTRING)
ErrorF("%s \n",BUILDERSTRING);
#endif
@@ -1686,17 +1778,7 @@ xf86PrintBanner()
static void
xf86PrintMarkers()
{
- /* Show what the marker symbols mean */
- ErrorF("Markers: " X_PROBE_STRING " probed, "
- X_CONFIG_STRING " from config file, "
- X_DEFAULT_STRING " default setting,\n"
- " " X_CMDLINE_STRING " from command line, "
- X_NOTICE_STRING " notice, "
- X_INFO_STRING " informational,\n"
- " " X_WARNING_STRING " warning, "
- X_ERROR_STRING " error, "
- X_NOT_IMPLEMENTED_STRING " not implemented, "
- X_UNKNOWN_STRING " unknown.\n");
+ LogPrintMarkers();
}
static void
diff --git a/hw/xfree86/common/xf86Io.c b/hw/xfree86/common/xf86Io.c
index 06819bccf..bd44bdeb5 100644
--- a/hw/xfree86/common/xf86Io.c
+++ b/hw/xfree86/common/xf86Io.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.53 2003/01/15 03:29:05 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.56 2003/11/03 05:11:02 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -21,6 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1992-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: xf86Io.c /main/27 1996/10/19 17:58:55 kaleb $ */
#define NEED_EVENTS
@@ -88,7 +115,7 @@ xf86KbdLeds ()
{
int leds, real_leds = 0;
-#if defined (__sparc__)
+#if defined (__sparc__) && defined(__linux__)
static int kbdSun = -1;
if (kbdSun == -1) {
if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun")) ||
@@ -122,7 +149,7 @@ xf86KbdLeds ()
#endif
#endif
xf86SetKbdLeds(real_leds);
- return;
+ (void)leds;
}
/*
@@ -264,6 +291,7 @@ Bool init;
#endif /* INHERIT_LOCK_STATE */
xf86SetKbdLeds(leds);
#endif /* LED_CAP */
+ (void)leds;
if (xf86Info.kbdDelay <= 375) rad = 0x00;
else if (xf86Info.kbdDelay <= 625) rad = 0x20;
diff --git a/hw/xfree86/common/xf86Kbd.c b/hw/xfree86/common/xf86Kbd.c
index c1ad79778..3c7ed7a69 100644
--- a/hw/xfree86/common/xf86Kbd.c
+++ b/hw/xfree86/common/xf86Kbd.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.24 2002/05/31 18:45:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.26 2003/08/24 17:36:53 dawes Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@@ -21,8 +21,39 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1992-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: xf86Kbd.c /main/10 1996/02/21 17:38:32 kaleb $ */
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
+
#include "X.h"
#include "Xmd.h"
#include "input.h"
diff --git a/hw/xfree86/common/xf86KbdBSD.c b/hw/xfree86/common/xf86KbdBSD.c
index a606b14fb..2621e2a81 100644
--- a/hw/xfree86/common/xf86KbdBSD.c
+++ b/hw/xfree86/common/xf86KbdBSD.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.20 2002/05/22 21:38:27 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.22 2003/10/07 22:00:52 herrb Exp $ */
/*
* Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk)
* which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
@@ -22,6 +22,33 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright (c) 1994-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: xf86KbdBSD.c /main/6 1996/10/23 13:12:27 kaleb $ */
#include "X.h"
@@ -1057,6 +1084,8 @@ static CARD8 wsAdbMap[] = {
/* 223 */ KEY_NOTUSED,
};
+#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char))
+
static CARD8 wsSunMap[] = {
/* 0x00 */ KEY_NOTUSED,
/* 0x01 */ KEY_NOTUSED, /* stop */
@@ -1190,9 +1219,6 @@ static CARD8 wsSunMap[] = {
#define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(unsigned char))
-
-#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char))
-
/*
* Translate raw wskbd keyboard event values to XFree86 standard keycodes
* (based on the AT keyboard scan codes using the tables above
@@ -1210,7 +1236,7 @@ WSKbdToKeycode(int keycode)
return KEY_UNKNOWN;
else
return wsUsbMap[keycode];
-#ifdef WSKBD_TYPE_ADB
+#ifdef WSKBD_TYPE_ADB
case WSKBD_TYPE_ADB:
if (keycode < 0 || keycode >= WS_ADB_MAP_SIZE)
return KEY_UNKNOWN;
@@ -1219,6 +1245,9 @@ WSKbdToKeycode(int keycode)
#endif
#ifdef WSKBD_TYPE_SUN
case WSKBD_TYPE_SUN:
+#ifdef WSKBD_TYPE_SUN5
+ case WSKBD_TYPE_SUN5:
+#endif
if (keycode < 0 || keycode >= WS_SUN_MAP_SIZE)
return KEY_UNKNOWN;
else
diff --git a/hw/xfree86/common/xf86KbdLnx.c b/hw/xfree86/common/xf86KbdLnx.c
index 1f97c0b15..b023acfbd 100644
--- a/hw/xfree86/common/xf86KbdLnx.c
+++ b/hw/xfree86/common/xf86KbdLnx.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.16 2001/03/05 20:18:20 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.17 2003/08/24 17:36:53 dawes Exp $ */
/*
* Linux version of keymapping setup. The kernel (since 0.99.14) has support
* for fully remapping the keyboard, but there are some differences between
@@ -28,6 +28,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1994-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: xf86KbdLnx.c /main/7 1996/10/19 17:59:00 kaleb $ */
#include "X.h"
diff --git a/hw/xfree86/common/xf86Keymap.h b/hw/xfree86/common/xf86Keymap.h
index 45f4dd104..82ea52eef 100644
--- a/hw/xfree86/common/xf86Keymap.h
+++ b/hw/xfree86/common/xf86Keymap.h
@@ -1,4 +1,32 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.19 2002/05/31 18:45:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.20 2003/08/24 17:36:53 dawes Exp $ */
+
+/*
+ * Copyright (c) 1994-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/*
*
* For Scancodes see notes in atKeynames.h !!!!
diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c
index f04a0b8d8..a36ca52f2 100644
--- a/hw/xfree86/common/xf86MiscExt.c
+++ b/hw/xfree86/common/xf86MiscExt.c
@@ -1,13 +1,40 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.16 2003/11/03 05:11:02 tsi Exp $ */
/*
- * Copyright (c) 1999 by The XFree86 Project, Inc.
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
-/* $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.
*/
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
+
#include "X.h"
#include "os.h"
#include "xf86.h"
@@ -62,31 +89,17 @@ typedef struct {
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 {
+static struct mouse_map {
int mtype;
MouseProtocolID proto;
-};
-
-static int
-MapMseProto(int proto, MseProtoMapDirection mapping)
+} m_map[] =
{
- int i;
-
- static struct mouse_map m_map[] =
- {
{ MTYPE_MICROSOFT, PROT_MS },
{ MTYPE_MOUSESYS, PROT_MSC },
{ MTYPE_MMSERIES, PROT_MM },
@@ -109,17 +122,30 @@ MapMseProto(int proto, MseProtoMapDirection mapping)
{ MTYPE_AUTOMOUSE, PROT_AUTO },
{ MTYPE_SYSMOUSE, PROT_SYSMOUSE },
{ MTYPE_UNKNOWN, PROT_UNKNOWN }
- };
+};
+
+static int
+MapMseProtoToMisc(MouseProtocolID proto)
+{
+ int i;
- 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;
+ if (proto == m_map[i].proto)
+ return m_map[i].mtype;
+
return MTYPE_UNKNOWN;
- } else {
+}
+
+static MouseProtocolID
+MapMseMiscToProto(int proto)
+{
+ int i;
+
for (i = 0; m_map[i].mtype != MTYPE_UNKNOWN; i++)
- if (proto == m_map[i].mtype) return m_map[i].proto;
+ if (proto == m_map[i].mtype)
+ return m_map[i].proto;
+
return PROT_UNKNOWN;
- }
}
Bool
@@ -140,7 +166,7 @@ MiscExtGetMouseSettings(pointer *mouse, char **devname)
*devname = xf86FindOptionValue(pInfo->options, "Device");
pMse = pInfo->private;
- mseptr->type = MapMseProto(pMse->protocolID, TO_MISC);
+ mseptr->type = MapMseProtoToMisc(pMse->protocolID);
mseptr->baudrate = pMse->baudRate;
mseptr->samplerate = pMse->sampleRate;
mseptr->resolution = pMse->resolution;
@@ -279,7 +305,8 @@ MiscExtSetKbdValue(pointer keyboard, MiscExtKbdValType valtype, int value)
}
static void
-MiscExtClientStateCallback(pointer callbacks, pointer data, pointer args)
+MiscExtClientStateCallback(CallbackListPtr *callbacks,
+ pointer data, pointer args)
{
NewClientInfoRec *clientinfo = (NewClientInfoRec*)args;
@@ -287,8 +314,7 @@ MiscExtClientStateCallback(pointer callbacks, pointer data, pointer args)
clientinfo->client->clientState == ClientStateGone) {
xf86Info.grabInfo.override = NULL;
xf86Info.grabInfo.disabled = 0;
- DeleteCallback(&ClientStateCallback,
- (CallbackProcPtr)MiscExtClientStateCallback, NULL);
+ DeleteCallback(&ClientStateCallback, MiscExtClientStateCallback, NULL);
}
}
@@ -307,13 +333,13 @@ MiscExtSetGrabKeysState(ClientPtr client, int state)
if (state == 0 && xf86Info.grabInfo.disabled == 0) {
xf86Info.grabInfo.disabled = 1;
AddCallback(&ClientStateCallback,
- (CallbackProcPtr)MiscExtClientStateCallback, NULL);
+ MiscExtClientStateCallback, NULL);
xf86Info.grabInfo.override = client;
}
else if (state == 1 && xf86Info.grabInfo.disabled == 1) {
xf86Info.grabInfo.disabled = 0;
DeleteCallback(&ClientStateCallback,
- (CallbackProcPtr)MiscExtClientStateCallback, NULL);
+ MiscExtClientStateCallback, NULL);
xf86Info.grabInfo.override = NULL;
}
else
@@ -426,6 +452,7 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
Bool protoChanged = FALSE;
int oldflags;
Bool reopen = FALSE;
+ MouseProtocolID newProtocol;
mseParamsPtr mse = structure;
InputInfoPtr pInfo;
MouseDevPtr pMse;
@@ -508,7 +535,8 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
pMse = pInfo->private;
oldflags = pMse->mouseFlags;
- protoChanged = pMse->protocolID != MapMseProto(mse->type, FROM_MISC);
+ newProtocol = MapMseMiscToProto(mse->type);
+ protoChanged = pMse->protocolID != newProtocol;
if (protoChanged
|| pMse->baudRate != mse->baudrate
|| pMse->sampleRate != mse->samplerate
@@ -522,7 +550,7 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
if (reopen)
(pMse->device->deviceProc)(pMse->device, DEVICE_CLOSE);
- pMse->protocolID = MapMseProto(mse->type, FROM_MISC);
+ pMse->protocolID = newProtocol;
pMse->baudRate = mse->baudrate;
pMse->sampleRate = mse->samplerate;
pMse->resolution = mse->resolution;
@@ -608,5 +636,18 @@ MiscExtGetFilePaths(const char **configfile, const char **modulepath,
return TRUE;
}
+int
+MiscExtPassMessage(int scrnIndex, const char *msgtype, const char *msgval,
+ char **retstr)
+{
+ ScrnInfoPtr pScr = xf86Screens[scrnIndex];
+
+ DEBUG_P("MiscExtPassMessage");
+
+ if (*pScr->HandleMessage == NULL)
+ return BadImplementation;
+ return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr);
+}
+
#endif /* XF86MISC */
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index ba73921e4..fd2ff4a22 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1,10 +1,36 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.63.2.1 2003/04/08 20:51:27 tsi Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.69 2003/10/08 14:58:28 dawes Exp $ */
/*
- * Copyright (c) 1997,1998 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/*
* Authors: Dirk Hohndel <hohndel@XFree86.Org>
* David Dawes <dawes@XFree86.Org>
+ * Marc La France <tsi@XFree86.Org>
+ * ... and others
*
* This file includes helper functions for mode related things.
*/
@@ -13,6 +39,7 @@
#include "os.h"
#include "servermd.h"
#include "mibank.h"
+#include "globals.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86DDC.h"
@@ -318,6 +345,25 @@ xf86HandleBuiltinMode(ScrnInfoPtr scrp,
return MODE_OK;
}
+static double
+ModeVRefresh(DisplayModePtr mode)
+{
+ double refresh = 0.0;
+
+ if (mode->VRefresh > 0.0)
+ refresh = mode->VRefresh;
+ else if (mode->HTotal > 0 && mode->VTotal > 0) {
+ refresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal;
+ if (mode->Flags & V_INTERLACE)
+ refresh *= 2.0;
+ if (mode->Flags & V_DBLSCAN)
+ refresh /= 2.0;
+ if (mode->VScan > 1)
+ refresh /= mode->VScan;
+ }
+ return refresh;
+}
+
/*
* xf86LookupMode
*
@@ -442,17 +488,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
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;
- }
+ refresh = ModeVRefresh(p);
if (p->Flags & V_INTERLACE)
refresh /= INTERLACE_REFRESH_WEIGHT;
if (refresh > bestRefresh) {
@@ -491,17 +527,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
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;
- }
+ refresh = ModeVRefresh(p);
if (p->Flags & V_INTERLACE)
refresh /= INTERLACE_REFRESH_WEIGHT;
if (refresh > bestRefresh) {
@@ -847,7 +873,7 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
int i, needDiv2;
/* Sanity checks */
- if (!scrp || !mode /*|| !clockRanges*/) {
+ if (!scrp || !mode || !clockRanges) {
ErrorF("xf86InitialCheckModeForDriver: "
"called with invalid parameters\n");
return MODE_ERROR;
@@ -1186,13 +1212,17 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
int linePitch = -1, virtX = 0, virtY = 0;
int newLinePitch, newVirtX, newVirtY;
int modeSize; /* in pixels */
- Bool validateAllDefaultModes;
+ Bool validateAllDefaultModes = FALSE;
Bool userModes = FALSE;
int saveType;
PixmapFormatRec *BankFormat;
ClockRangePtr cp;
ClockRangesPtr storeClockRanges;
struct monitor_ranges *mon_range = NULL;
+ double targetRefresh = 0.0;
+ int numTimings = 0;
+ range hsync[MAX_HSYNC];
+ range vrefresh[MAX_VREFRESH];
#ifdef DEBUG
ErrorF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
@@ -1222,58 +1252,164 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
return -1;
}
- /* Probe monitor so that we can enforce/warn about its limits */
+ /*
+ * Probe monitor so that we can enforce/warn about its limits.
+ * If one or more DS_RANGES descriptions are present, use the parameters
+ * that they provide. Otherwise, deduce limits based on the modes that
+ * are shown as supported via standard and detailed timings.
+ *
+ * XXX The full potential of the DDC/EDID data still isn't being tapped.
+ */
if (scrp->monitor->DDC) {
MonPtr monitor = scrp->monitor;
xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
- struct detailed_monitor_section* detMon;
- int i;
+ int i, j;
+ float hmin = 1e6, hmax = 0.0, vmin = 1e6, vmax = 0.0;
+ float h;
+ struct std_timings *t;
+ struct detailed_timings *dt;
+
+ numTimings = 0;
+ for (i = 0; i < DET_TIMINGS; i++) {
+ switch (DDC->det_mon[i].type) {
+ case DS_RANGES:
+ mon_range = &DDC->det_mon[i].section.ranges;
+ hsync[numTimings].lo = mon_range->min_h;
+ hsync[numTimings].hi = mon_range->max_h;
+ vrefresh[numTimings].lo = mon_range->min_v;
+ vrefresh[numTimings].hi = mon_range->max_v;
+ numTimings++;
+ break;
- for (i = 0; i < 4; i++) {
- detMon = &DDC->det_mon[i];
- if(detMon->type == DS_RANGES) {
- mon_range = &detMon->section.ranges;
+ case DS_STD_TIMINGS:
+ t = DDC->det_mon[i].section.std_t;
+ for (j = 0; j < 5; j++) {
+ if (t[j].hsize > 256) { /* sanity check */
+ if (t[j].refresh < vmin)
+ vmin = t[i].refresh;
+ if (t[j].refresh > vmax)
+ vmax = t[i].refresh;
+ /*
+ * For typical modes this is a reasonable estimate
+ * of the horizontal sync rate.
+ */
+ h = t[j].refresh * 1.07 * t[j].vsize / 1000.0;
+ if (h < hmin)
+ hmin = h;
+ if (h > hmax)
+ hmax = h;
+ }
+ }
+ break;
+
+ case DT:
+ dt = &DDC->det_mon[i].section.d_timings;
+ if (dt->clock > 15000000) { /* sanity check */
+ float v;
+ h = (float)dt->clock / (dt->h_active + dt->h_blanking);
+ v = h / (dt->v_active + dt->v_blanking);
+ h /= 1000.0;
+ if (dt->interlaced)
+ v /= 2.0;
+
+ if (v < vmin)
+ vmin = v;
+ if (v > vmax)
+ vmax = v;
+ if (h < hmin)
+ hmin = h;
+ if (h > hmax)
+ hmax = h;
+ }
+ break;
}
+
+ if (numTimings > MAX_HSYNC)
+ break;
}
- if (mon_range) {
+
+ if (numTimings == 0) {
+ t = DDC->timings2;
+ for (i = 0; i < STD_TIMINGS; i++) {
+ if (t[i].hsize > 256) { /* sanity check */
+ if (t[i].refresh < vmin)
+ vmin = t[i].refresh;
+ if (t[i].refresh > vmax)
+ vmax = t[i].refresh;
+ /*
+ * For typical modes this is a reasonable estimate
+ * of the horizontal sync rate.
+ */
+ h = t[i].refresh * 1.07 * t[i].vsize / 1000.0;
+ if (h < hmin)
+ hmin = h;
+ if (h > hmax)
+ hmax = h;
+ }
+ }
+
+ if (hmax > 0.0) {
+ hsync[numTimings].lo = hmin;
+ hsync[numTimings].hi = hmax;
+ vrefresh[numTimings].lo = vmin;
+ vrefresh[numTimings].hi = vmax;
+ numTimings++;
+ }
+ }
+
+ if (numTimings > 0) {
#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 );
+ for (i = 0; i < numTimings; i++) {
+ ErrorF("DDC - Hsync %.1f-%.1f kHz - Vrefresh %.1f-%.1f Hz\n",
+ hsync[i].lo, hsync[i].hi,
+ vrefresh[i].lo, vrefresh[i].hi);
+ }
#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 <
+ Bool good = FALSE;
+ for (j = 0; j < numTimings; j++) {
+ if ((1.0 - DDC_SYNC_TOLERANCE) * hsync[j].lo <=
+ monitor->hsync[i].lo &&
+ (1.0 + DDC_SYNC_TOLERANCE) * hsync[j].hi >=
monitor->hsync[i].hi) {
+ good = TRUE;
+ break;
+ }
+ }
+ if (!good) {
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);
+ "hsync ranges.\n",
+ monitor->hsync[i].lo, monitor->hsync[i].hi);
}
}
}
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 <
+ for (i = 0; i < monitor->nVrefresh; i++) {
+ Bool good = FALSE;
+ for (j = 0; j < numTimings; j++) {
+ if ((1.0 - DDC_SYNC_TOLERANCE) * vrefresh[j].lo <=
+ monitor->vrefresh[0].lo &&
+ (1.0 + DDC_SYNC_TOLERANCE) * vrefresh[j].hi >=
monitor->vrefresh[0].hi) {
+ good = TRUE;
+ break;
+ }
+ }
+ if (!good) {
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);
+ "vrefresh ranges.\n",
+ monitor->vrefresh[i].lo, monitor->vrefresh[i].hi);
}
}
}
- } /* if (mon_range) */
+ }
}
/*
@@ -1283,58 +1419,61 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
if (strategy & LOOKUP_OPTIONAL_TOLERANCES) {
strategy &= ~LOOKUP_OPTIONAL_TOLERANCES;
} else {
+ const char *type = "";
+
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;
+ if (numTimings > 0) {
+ scrp->monitor->nHsync = numTimings;
+ for (i = 0; i < numTimings; i++) {
+ scrp->monitor->hsync[i].lo = hsync[i].lo;
+ scrp->monitor->hsync[i].hi = hsync[i].hi;
+ }
} else {
scrp->monitor->hsync[0].lo = 28;
scrp->monitor->hsync[0].hi = 33;
+ scrp->monitor->nHsync = 1;
}
- 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++)
+ type = "default ";
+ }
+ 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,
+ "%s: Using %shsync value of %.2f kHz\n",
+ scrp->monitor->id, type,
scrp->monitor->hsync[i].lo);
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "%s: Using hsync range of %.2f-%.2f kHz\n",
- scrp->monitor->id,
+ "%s: Using %shsync range of %.2f-%.2f kHz\n",
+ scrp->monitor->id, type,
scrp->monitor->hsync[i].lo,
scrp->monitor->hsync[i].hi);
}
+
+ type = "";
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;
+ if (numTimings > 0) {
+ scrp->monitor->nVrefresh = numTimings;
+ for (i = 0; i < numTimings; i++) {
+ scrp->monitor->vrefresh[i].lo = vrefresh[i].lo;
+ scrp->monitor->vrefresh[i].hi = vrefresh[i].hi;
+ }
} else {
scrp->monitor->vrefresh[0].lo = 43;
scrp->monitor->vrefresh[0].hi = 72;
+ scrp->monitor->nVrefresh = 1;
}
- 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++)
+ type = "default ";
+ }
+ 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,
+ "%s: Using %svrefresh value of %.2f Hz\n",
+ scrp->monitor->id, type,
scrp->monitor->vrefresh[i].lo);
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
- "%s: Using vrefresh range of %.2f-%.2f Hz\n",
- scrp->monitor->id,
+ "%s: Using %svrefresh range of %.2f-%.2f Hz\n",
+ scrp->monitor->id, type,
scrp->monitor->vrefresh[i].lo,
scrp->monitor->vrefresh[i].hi);
}
@@ -1498,6 +1637,26 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
}
/*
+ * Go through the mode pool and see if any modes match the target
+ * refresh rate, (if specified). If no modes match, abandon the target.
+ */
+ targetRefresh = xf86SetRealOption(scrp->options,
+ "TargetRefresh", 0.0);
+ if (targetRefresh > 0.0) {
+ for (p = scrp->modePool; p != NULL; p = p->next) {
+ if (ModeVRefresh(p) > targetRefresh * (1.0 - SYNC_TOLERANCE))
+ break;
+ }
+ if (!p)
+ targetRefresh = 0.0;
+ }
+
+ if (targetRefresh > 0.0) {
+ xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
+ "Target refresh rate is %.1f Hz\n", targetRefresh);
+ }
+
+ /*
* Allocate one entry in scrp->modes for each named mode.
*/
while (scrp->modes)
@@ -1520,7 +1679,15 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
}
/* Lookup each mode */
- validateAllDefaultModes = TRUE;
+#ifdef RANDR
+ if (!xf86Info.disableRandR
+#ifdef PANORAMIX
+ && noPanoramiXExtension
+#endif
+ )
+ validateAllDefaultModes = TRUE;
+#endif
+
for (p = scrp->modes; ; p = p->next) {
Bool repeat;
@@ -1561,6 +1728,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
((double)q->HTotal / (double)q->HDisplay) < 1.15)
continue;
+ /*
+ * If there is a target refresh rate, skip modes that
+ * don't match up.
+ */
+ if (ModeVRefresh(q) <
+ (1.0 - SYNC_TOLERANCE) * targetRefresh)
+ continue;
+
if (modeSize < (q->HDisplay * q->VDisplay)) {
r = q;
modeSize = q->HDisplay * q->VDisplay;
@@ -1833,8 +2008,16 @@ xf86PruneDriverModes(ScrnInfoPtr scrp)
} while (p != NULL && p != first);
/* modePool is no longer needed, turf it */
- while (scrp->modePool)
+ while (scrp->modePool) {
+ /*
+ * 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.
+ * Clear that pointer first, otherwise xf86DeleteMode might get
+ * confused
+ */
+ scrp->modePool->prev = NULL;
xf86DeleteMode(&scrp->modePool, scrp->modePool);
+ }
}
@@ -1946,22 +2129,16 @@ xf86PrintModes(ScrnInfoPtr scrp)
hsync = (float)p->Clock / (float)p->HTotal;
else
hsync = 0.0;
- if (p->VTotal > 0)
- refresh = hsync * 1000.0 / p->VTotal;
+ refresh = ModeVRefresh(p);
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)
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 21b9aa590..bd18e895f 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.35 2002/12/22 02:03:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.37 2003/08/24 17:36:54 dawes Exp $ */
/*
- * Copyright (c) 1997-2001 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -62,7 +85,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 2)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 6)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 7)
#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)
diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h
index dc5c2ca67..718732353 100644
--- a/hw/xfree86/common/xf86Opt.h
+++ b/hw/xfree86/common/xf86Opt.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.12 2001/05/04 19:05:30 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.15 2003/10/08 14:30:38 dawes Exp $ */
+
+/*
+ * Copyright (c) 1998-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/* Option handling things that ModuleSetup procs can use */
@@ -46,7 +73,11 @@ 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 );
+int xf86CheckIntOption(pointer optlist, const char *name, int deflt);
+double xf86CheckRealOption(pointer optlist, const char *name, double deflt);
+char *xf86CheckStrOption(pointer optlist, const char *name, char *deflt);
+int xf86CheckBoolOption(pointer list, const char *name, int deflt );
+pointer xf86AddNewOption(pointer head, const char *name, const char *val );
pointer xf86NewOption(char *name, char *value );
pointer xf86NextOption(pointer list );
pointer xf86OptionListCreate(const char **options, int count, int used);
@@ -76,7 +107,8 @@ 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);
+pointer xf86ReplaceIntOption(pointer optlist, const char *name, const int val);
+pointer xf86ReplaceRealOption(pointer optlist, const char *name, const double val);
+pointer xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val);
+pointer xf86ReplaceStrOption(pointer optlist, const char *name, const char* val);
#endif
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 6ca1590e4..0ba09b507 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -1,10 +1,33 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.25 2002/09/10 17:39:28 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.29 2003/10/18 12:34:19 dawes Exp $ */
/*
- * Copyright (c) 1998 by The XFree86 Project, Inc.
+ * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
*
- * Author: David Dawes <dawes@xfree86.org>
+ * 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/*
+ * Author: David Dawes <dawes@xfree86.org>
*
* This file includes public option handling functions.
*/
@@ -17,7 +40,8 @@
#include "xf86Xinput.h"
#include "xf86Optrec.h"
-static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p);
+static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
+ Bool markUsed);
/*
* xf86CollectOptions collects the options from each of the config file
@@ -140,42 +164,41 @@ xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
/* 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)
+static int
+LookupIntOption(pointer optlist, const char *name, int deflt, Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_INTEGER;
- if (ParseOptionValue(-1, optlist, &o))
+ if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.num;
return deflt;
}
-double
-xf86SetRealOption(pointer optlist, const char *name, double deflt)
+static double
+LookupRealOption(pointer optlist, const char *name, double deflt,
+ Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_REAL;
- if (ParseOptionValue(-1, optlist, &o))
+ if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.realnum;
return deflt;
}
-char *
-xf86SetStrOption(pointer optlist, const char *name, char *deflt)
+static char *
+LookupStrOption(pointer optlist, const char *name, char *deflt, Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_STRING;
- if (ParseOptionValue(-1, optlist, &o))
+ if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.str;
if (deflt)
return xstrdup(deflt);
@@ -184,24 +207,84 @@ xf86SetStrOption(pointer optlist, const char *name, char *deflt)
}
-int
-xf86SetBoolOption(pointer optlist, const char *name, int deflt)
+static int
+LookupBoolOption(pointer optlist, const char *name, int deflt, Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_BOOLEAN;
- if (ParseOptionValue(-1, optlist, &o))
+ if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.bool;
return deflt;
}
+/* These xf86Set* functions are intended for use by non-screen specific code */
+
+int
+xf86SetIntOption(pointer optlist, const char *name, int deflt)
+{
+ return LookupIntOption(optlist, name, deflt, TRUE);
+}
+
+
+double
+xf86SetRealOption(pointer optlist, const char *name, double deflt)
+{
+ return LookupRealOption(optlist, name, deflt, TRUE);
+}
+
+
+char *
+xf86SetStrOption(pointer optlist, const char *name, char *deflt)
+{
+ return LookupStrOption(optlist, name, deflt, TRUE);
+}
+
+
+int
+xf86SetBoolOption(pointer optlist, const char *name, int deflt)
+{
+ return LookupBoolOption(optlist, name, deflt, TRUE);
+}
+
+/*
+ * These are like the Set*Option functions, but they don't mark the options
+ * as used.
+ */
+int
+xf86CheckIntOption(pointer optlist, const char *name, int deflt)
+{
+ return LookupIntOption(optlist, name, deflt, FALSE);
+}
+
+
+double
+xf86CheckRealOption(pointer optlist, const char *name, double deflt)
+{
+ return LookupRealOption(optlist, name, deflt, FALSE);
+}
+
+
+char *
+xf86CheckStrOption(pointer optlist, const char *name, char *deflt)
+{
+ return LookupStrOption(optlist, name, deflt, FALSE);
+}
+
+
+int
+xf86CheckBoolOption(pointer optlist, const char *name, int deflt)
+{
+ return LookupBoolOption(optlist, name, deflt, FALSE);
+}
+
/*
* addNewOption() has the required property of replacing the option value
- * it the option is alread present.
+ * if the option is already present.
*/
pointer
-xf86ReplaceIntOption(pointer optlist, char *name, int val)
+xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
{
char *tmp = xnfalloc(16);
sprintf(tmp,"%i",val);
@@ -209,20 +292,29 @@ xf86ReplaceIntOption(pointer optlist, char *name, int val)
}
pointer
-xf86ReplaceBoolOption(pointer optlist, char *name, Bool val)
+xf86ReplaceRealOption(pointer optlist, const char *name, const double val)
+{
+ char *tmp = xnfalloc(32);
+ snprintf(tmp,32,"%f",val);
+ return xf86AddNewOption(optlist,name,tmp);
+}
+
+pointer
+xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val)
{
- return xf86AddNewOption(optlist,name,(Bool)val?"True":"False");
+ return xf86AddNewOption(optlist,name,val?"True":"False");
}
pointer
-xf86ReplaceStrOption(pointer optlist, char *name, char* val)
+xf86ReplaceStrOption(pointer optlist, const char *name, const char* val)
{
return xf86AddNewOption(optlist,name,val);
}
pointer
-xf86AddNewOption(pointer head, char *name, char *val)
+xf86AddNewOption(pointer head, const char *name, const char *val)
{
+ /* XXX These should actually be allocated in the parser library. */
char *tmp = strdup(val);
char *tmp_name = strdup(name);
@@ -387,14 +479,17 @@ GetBoolValue(OptionInfoPtr p, const char *s)
}
static Bool
-ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
+ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
+ Bool markUsed)
{
char *s, *end;
- Bool wasUsed;
+ Bool wasUsed = FALSE;
if ((s = xf86findOptionValue(options, p->name)) != NULL) {
- wasUsed = xf86CheckIfOptionUsedByName(options, p->name);
- xf86MarkOptionUsedByName(options, p->name);
+ if (markUsed) {
+ wasUsed = xf86CheckIfOptionUsedByName(options, p->name);
+ xf86MarkOptionUsedByName(options, p->name);
+ }
switch (p->type) {
case OPTV_INTEGER:
if (*s == '\0') {
@@ -501,7 +596,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
p->found = FALSE;
break;
}
- if (p->found) {
+ if (p->found && markUsed) {
int verb = 2;
if (wasUsed)
verb = 4;
@@ -535,7 +630,8 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
newn = n;
}
if ((s = xf86findOptionValue(options, newn)) != NULL) {
- xf86MarkOptionUsedByName(options, newn);
+ if (markUsed)
+ xf86MarkOptionUsedByName(options, newn);
if (GetBoolValue(&opt, s)) {
p->value.bool = !opt.value.bool;
p->found = TRUE;
@@ -547,7 +643,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
} else {
p->found = FALSE;
}
- if (p->found) {
+ if (p->found && markUsed) {
xf86DrvMsgVerb(scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
if (*s != 0) {
xf86ErrorFVerb(2, " \"%s\"", s);
@@ -568,7 +664,7 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
OptionInfoPtr p;
for (p = optinfo; p->name != NULL; p++) {
- ParseOptionValue(scrnIndex, options, p);
+ ParseOptionValue(scrnIndex, options, p, TRUE);
}
}
@@ -576,20 +672,27 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
OptionInfoPtr
xf86TokenToOptinfo(const OptionInfoRec *table, int token)
{
- const OptionInfoRec *p;
+ const OptionInfoRec *p, *match = NULL, *set = NULL;
if (!table) {
ErrorF("xf86TokenToOptinfo: table is NULL\n");
return NULL;
}
- for (p = table; p->token >= 0 && p->token != token; p++)
- ;
+ for (p = table; p->token >= 0; p++) {
+ if (p->token == token) {
+ match = p;
+ if (p->found)
+ set = p;
+ }
+ }
- if (p->token < 0)
- return NULL;
+ if (set)
+ return (OptionInfoPtr)set;
+ else if (match)
+ return (OptionInfoPtr)match;
else
- return (OptionInfoPtr)p;
+ return NULL;
}
diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c
index 03f5bdec1..eb56fb614 100644
--- a/hw/xfree86/common/xf86PM.c
+++ b/hw/xfree86/common/xf86PM.c
@@ -1,5 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.8 2002/09/29 23:54:34 keithp Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.9 2003/08/24 17:36:54 dawes Exp $ */
+/*
+ * Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "X.h"
#include "xf86.h"
diff --git a/hw/xfree86/common/xf86PciInfo.h b/hw/xfree86/common/xf86PciInfo.h
index 14f86cf89..19cc009dd 100644
--- a/hw/xfree86/common/xf86PciInfo.h
+++ b/hw/xfree86/common/xf86PciInfo.h
@@ -1,7 +1,33 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.144 2003/02/07 20:41:11 martin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.156 2003/10/30 15:26:33 tsi Exp $ */
+
/*
- * Copyright 1995-2002 by The XFree86 Project, Inc.
+ * Copyright (c) 1995-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/*
* 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:
@@ -57,12 +83,10 @@
#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
@@ -89,14 +113,31 @@
#define PCI_CHIP_QV1280 0x3033
/* ATI */
+#define PCI_CHIP_RS100_4136 0x4136
+#define PCI_CHIP_RS200_4137 0x4137
#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_R350_AH 0x4148
+#define PCI_CHIP_R350_AI 0x4149
+#define PCI_CHIP_R350_AJ 0x414A
+#define PCI_CHIP_R350_AK 0x414B
+#define PCI_CHIP_RV350_AP 0x4150
+#define PCI_CHIP_RV350_AQ 0x4151
+#define PCI_CHIP_RV360_AR 0x4152
+#define PCI_CHIP_RV350_AS 0x4153
+#define PCI_CHIP_RV350_AT 0x4154
+#define PCI_CHIP_RV350_AV 0x4156
#define PCI_CHIP_MACH32 0x4158
+#define PCI_CHIP_RS250_4237 0x4237
#define PCI_CHIP_R200_BB 0x4242
+#define PCI_CHIP_R200_BC 0x4243
+#define PCI_CHIP_RS100_4336 0x4336
+#define PCI_CHIP_RS200_4337 0x4337
#define PCI_CHIP_MACH64CT 0x4354
#define PCI_CHIP_MACH64CX 0x4358
+#define PCI_CHIP_RS250_4437 0x4437
#define PCI_CHIP_MACH64ET 0x4554
#define PCI_CHIP_MACH64GB 0x4742
#define PCI_CHIP_MACH64GD 0x4744
@@ -140,12 +181,23 @@
#define PCI_CHIP_RV250_Le 0x4C65
#define PCI_CHIP_RV250_Lf 0x4C66
#define PCI_CHIP_RV250_Lg 0x4C67
+#define PCI_CHIP_RV250_Ln 0x4C6E
#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_R350_NH 0x4E48
+#define PCI_CHIP_R350_NI 0x4E49
+#define PCI_CHIP_R360_NJ 0x4E4A
+#define PCI_CHIP_R350_NK 0x4E4B
+#define PCI_CHIP_RV350_NP 0x4E50
+#define PCI_CHIP_RV350_NQ 0x4E51
+#define PCI_CHIP_RV350_NR 0x4E52
+#define PCI_CHIP_RV350_NS 0x4E53
+#define PCI_CHIP_RV350_NT 0x4E54
+#define PCI_CHIP_RV350_NV 0x4E56
#define PCI_CHIP_RAGE128PA 0x5041
#define PCI_CHIP_RAGE128PB 0x5042
#define PCI_CHIP_RAGE128PC 0x5043
@@ -186,11 +238,6 @@
#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
@@ -213,6 +260,16 @@
#define PCI_CHIP_MACH64VT 0x5654
#define PCI_CHIP_MACH64VU 0x5655
#define PCI_CHIP_MACH64VV 0x5656
+#define PCI_CHIP_RS300_5834 0x5834
+#define PCI_CHIP_RS300_5835 0x5835
+#define PCI_CHIP_RS300_5836 0x5836
+#define PCI_CHIP_RS300_5837 0x5837
+#define PCI_CHIP_RV280_5960 0x5960
+#define PCI_CHIP_RV280_5961 0x5961
+#define PCI_CHIP_RV280_5962 0x5962
+#define PCI_CHIP_RV280_5964 0x5964
+#define PCI_CHIP_RV280_5C61 0x5C61
+#define PCI_CHIP_RV280_5C63 0x5C63
/* Avance Logic */
#define PCI_CHIP_ALG2064 0x2064
@@ -259,6 +316,7 @@
#define PCI_CHIP_AMD761 0x700E
/* Trident */
+#define PCI_CHIP_2100 0x2100
#define PCI_CHIP_8400 0x8400
#define PCI_CHIP_8420 0x8420
#define PCI_CHIP_8500 0x8500
@@ -343,20 +401,21 @@
#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_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
+#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 */
+#define PCI_CHIP_ZX1_AGP8 0x12B4 /* a.k.a. QuickSilver */
/* SGS */
#define PCI_CHIP_STG2000 0x0008
@@ -389,9 +448,6 @@
#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
@@ -442,10 +498,6 @@
#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
@@ -538,7 +590,6 @@
/* 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
@@ -550,7 +601,6 @@
#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
@@ -565,6 +615,7 @@
#define PCI_CHIP_SMI710 0x0710
#define PCI_CHIP_SMI712 0x0712
#define PCI_CHIP_SMI720 0x0720
+#define PCI_CHIP_SMI731 0x0730
/* VMware */
#define PCI_CHIP_VMWARE0405 0x0405
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 308e7a72c..a46bfc39b 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.80 2002/12/12 18:29:10 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.82 2003/09/09 03:20:36 dawes Exp $ */
/*
- * Copyright (c) 1997 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -167,10 +190,11 @@ void xf86GrabServerCallback(CallbackListPtr *, pointer, pointer);
/* xf86Helper.c */
void xf86LogInit(void);
void xf86CloseLog(void);
-void OsVendorVErrorF(const char *f, va_list args);
/* xf86Init.c */
Bool xf86LoadModules(char **list, pointer *optlist);
+int xf86SetVerbosity(int verb);
+int xf86SetLogVerbosity(int verb);
/* xf86Io.c */
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index ff704b912..8b0a0f4ce 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.37 2003/02/20 04:05:14 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.40 2003/10/17 20:02:12 alanh Exp $ */
/*
- * Copyright (c) 1997,1998 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -159,7 +182,6 @@ typedef struct {
#ifdef DPMSExtension
/* Private info for DPMS */
typedef struct {
- DPMSSetProcPtr Set;
CloseScreenProcPtr CloseScreen;
Bool Enabled;
int Flags;
@@ -199,36 +221,4 @@ typedef struct {
#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
index c2dbcc170..546c909ff 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.4 2003/02/13 10:49:38 eich Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.8 2003/11/10 16:42:13 tsi Exp $
*
* Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -48,9 +48,9 @@ static int
xf86RandRModeRefresh (DisplayModePtr mode)
{
if (mode->VRefresh)
- return (int) mode->VRefresh;
+ return (int) (mode->VRefresh + 0.5);
else
- return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal);
+ return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5);
}
static Bool
@@ -60,7 +60,6 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
DisplayModePtr mode;
- Bool reportVirtual = TRUE;
int refresh0 = 60;
*rotations = RR_Rotate_0;
@@ -75,9 +74,6 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
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)
@@ -85,13 +81,14 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
if (mode->next == scrp->modes)
break;
}
- if (reportVirtual)
+ if (scrp->currentMode->HDisplay != randrp->virtualX ||
+ scrp->currentMode->VDisplay != randrp->virtualY)
{
mode = scrp->modes;
pSize = RRRegisterSize (pScreen,
randrp->virtualX, randrp->virtualY,
- pScreen->mmWidth * randrp->virtualX / mode->HDisplay,
- pScreen->mmHeight * randrp->virtualY / mode->VDisplay);
+ pScreen->mmWidth * randrp->virtualX / scrp->currentMode->HDisplay,
+ pScreen->mmHeight * randrp->virtualY / scrp->currentMode->VDisplay);
if (!pSize)
return FALSE;
RRRegisterRate (pScreen, pSize, refresh0);
@@ -202,17 +199,21 @@ xf86RandRSetConfig (ScreenPtr pScreen,
static Bool
xf86RandRCreateScreenResources (ScreenPtr pScreen)
{
- ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+#if 0
+ ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
DisplayModePtr mode;
+#endif
pScreen->CreateScreenResources = randrp->CreateScreenResources;
if (!(*pScreen->CreateScreenResources) (pScreen))
return FALSE;
+#if 0
mode = scrp->currentMode;
if (mode)
xf86RandRSetMode (pScreen, mode, TRUE);
+#endif
return TRUE;
}
diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h
index 6ed3015ec..ce2c62bb3 100644
--- a/hw/xfree86/common/xf86Resources.h
+++ b/hw/xfree86/common/xf86Resources.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.14 2002/07/24 01:47:24 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.15 2003/08/24 17:36:55 dawes Exp $ */
+
+/*
+ * Copyright (c) 1999-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _XF86_RESOURCES_H
diff --git a/hw/xfree86/common/xf86Version.h b/hw/xfree86/common/xf86Version.h
index e548b0437..07253bace 100644
--- a/hw/xfree86/common/xf86Version.h
+++ b/hw/xfree86/common/xf86Version.h
@@ -1,11 +1,38 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.543.2.1 2003/05/10 01:10:10 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.563 2003/11/21 06:01:44 dawes Exp $ */
+
+/*
+ * Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef XF86_VERSION_CURRENT
#define XF86_VERSION_MAJOR 4
#define XF86_VERSION_MINOR 3
-#define XF86_VERSION_PATCH 0
-#define XF86_VERSION_SNAP 1
+#define XF86_VERSION_PATCH 99
+#define XF86_VERSION_SNAP 16
/* This has five arguments for compatibilty reasons */
#define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \
diff --git a/hw/xfree86/common/xf86Versions.c b/hw/xfree86/common/xf86Versions.c
new file mode 100644
index 000000000..7b20ef9ab
--- /dev/null
+++ b/hw/xfree86/common/xf86Versions.c
@@ -0,0 +1,77 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Versions.c,v 1.2 2003/08/24 20:01:19 dawes Exp $ */
+/*
+ * Copyright (c) 2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+#include "xf86.h"
+#include "xf86OSmouse.h"
+#include "xf86OSKbd.h"
+
+static CARD32 registeredVersions[NUM_BUILTIN_IFS];
+
+CARD32
+xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flags)
+{
+ if (iface < 0 || iface >= NUM_BUILTIN_IFS) {
+ xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: Unexpected interface"
+ "query: %d\n", iface);
+ return 0;
+ }
+
+ if (registeredVersions[iface])
+ return registeredVersions[iface];
+
+ /* Most built-in interfaces are handled this way. */
+ switch (iface) {
+ case BUILTIN_IF_OSMOUSE:
+ return OS_MOUSE_VERSION_CURRENT;
+ case BUILTIN_IF_OSKBD:
+ return OS_KBD_VERSION_CURRENT;
+ default:
+ xf86Msg(X_ERROR, "xf86GetBuiltinInterfaceVersion: internal error: "
+ "interface %d not handled\n", iface);
+ return 0;
+ }
+}
+
+Bool
+xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface, CARD32 version,
+ int flags)
+{
+ if (iface < 0 || iface >= NUM_BUILTIN_IFS) {
+ xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: "
+ "unexpected interface number: %d\n", iface);
+ return FALSE;
+ }
+ if (version == 0) {
+ xf86Msg(X_ERROR, "xf86RegisterBuiltinInterfaceVersion: "
+ "versions must be greater than zero\n");
+ return FALSE;
+ }
+ registeredVersions[iface] = version;
+ return TRUE;
+}
+
diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
index f766f899e..467270e10 100644
--- a/hw/xfree86/common/xf86VidMode.c
+++ b/hw/xfree86/common/xf86VidMode.c
@@ -1,7 +1,30 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.17 2003/08/24 17:36:55 dawes Exp $ */
/*
- * Copyright (c) 1999 by The XFree86 Project, Inc.
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
-/* $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.
@@ -330,6 +353,8 @@ Bool
VidModeSwitchMode(int scrnIndex, pointer mode)
{
ScrnInfoPtr pScrn;
+ DisplayModePtr pTmpMode;
+ Bool retval;
DEBUG_P("VidModeSwitchMode");
@@ -337,9 +362,15 @@ VidModeSwitchMode(int scrnIndex, pointer mode)
return FALSE;
pScrn = xf86Screens[scrnIndex];
+ /* save in case we fail */
+ pTmpMode = pScrn->currentMode;
/* Force a mode switch */
pScrn->currentMode = NULL;
- return xf86SwitchMode(pScrn->pScreen, mode);
+ retval = xf86SwitchMode(pScrn->pScreen, mode);
+ /* we failed: restore it */
+ if (retval == FALSE)
+ pScrn->currentMode = pTmpMode;
+ return retval;
}
Bool
@@ -440,10 +471,13 @@ VidModeAddModeline(int scrnIndex, pointer mode)
pScrn = xf86Screens[scrnIndex];
+ ((DisplayModePtr)mode)->name = strdup(""); /* freed by deletemode */
+ ((DisplayModePtr)mode)->status = MODE_OK;
((DisplayModePtr)mode)->next = pScrn->modes->next;
((DisplayModePtr)mode)->prev = pScrn->modes;
pScrn->modes->next = (DisplayModePtr)mode;
- ((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode;
+ if( ((DisplayModePtr)mode)->next != NULL )
+ ((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode;
return TRUE;
}
@@ -547,6 +581,7 @@ VidModeCreateMode(void)
mode = xalloc(sizeof(DisplayModeRec));
if (mode != NULL) {
mode->name = "";
+ mode->VScan = 1; /* divides refresh rate. default = 1 */
mode->Private = NULL;
mode->next = mode;
mode->prev = mode;
diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c
index ddd3055ab..e1755de1e 100644
--- a/hw/xfree86/common/xf86XKB.c
+++ b/hw/xfree86/common/xf86XKB.c
@@ -24,7 +24,34 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.11 2002/10/11 01:40:31 dawes Exp $ */
+/*
+ * Copyright (c) 1994-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.12 2003/08/24 17:36:55 dawes Exp $ */
#include <stdio.h>
#define NEED_EVENTS 1
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 53fa1b3ff..eb871a40d 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1,4 +1,4 @@
-/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.70 2003/11/03 05:11:02 tsi Exp $ */
/*
* Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
*
@@ -21,8 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.68 2002/10/11 01:40:31 dawes Exp $ */
+/*
+ * Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */
#include "Xfuncproto.h"
#include "Xmd.h"
@@ -854,7 +879,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
int valuator[6];
int oldaxis[6];
int *axisvals;
- AxisInfoPtr axes;
int dx = 0, dy = 0;
float mult;
int x, y;
@@ -883,7 +907,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
}
axisvals = val->axisVal;
- axes = val->axes;
va_start(var, num_valuators);
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 1e9694402..9a0393447 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -22,7 +22,34 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.35 2002/10/11 01:40:31 dawes Exp $ */
+/*
+ * Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.36 2003/08/24 17:36:55 dawes Exp $ */
#ifndef _xf86Xinput_h
#define _xf86Xinput_h
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index 531a83c08..f7cb065a4 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.23 2001/11/16 16:47:55 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.25 2003/10/17 20:02:12 alanh Exp $ */
+/*
+ * Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
#include <math.h>
@@ -52,8 +78,6 @@ typedef struct {
DestroyColormapProcPtr DestroyColormap;
InstallColormapProcPtr InstallColormap;
StoreColorsProcPtr StoreColors;
- LoadPaletteFuncPtr LoadPalette;
- SetOverscanFuncPtr SetOverscan;
Bool (*EnterVT)(int, int);
Bool (*SwitchMode)(int, DisplayModePtr, int);
int (*SetDGAMode)(int, int, DGADevicePtr);
@@ -103,8 +127,8 @@ Bool xf86HandleColormaps(
ScreenPtr pScreen,
int maxColors,
int sigRGBbits,
- LoadPaletteFuncPtr loadPalette,
- SetOverscanFuncPtr setOverscan,
+ xf86LoadPaletteProc *loadPalette,
+ xf86SetOverscanProc *setOverscan,
unsigned int flags
){
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -155,8 +179,8 @@ Bool xf86HandleColormaps(
pScreen->StoreColors = CMapStoreColors;
pScreenPriv->pScrn = pScrn;
- pScreenPriv->LoadPalette = loadPalette;
- pScreenPriv->SetOverscan = setOverscan;
+ pScrn->LoadPalette = loadPalette;
+ pScrn->SetOverscan = setOverscan;
pScreenPriv->maxColors = maxColors;
pScreenPriv->sigRGBbits = sigRGBbits;
pScreenPriv->gammaElements = elements;
@@ -483,6 +507,7 @@ CMapReinstallMap(ColormapPtr pmap)
(CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
CMapColormapPtr cmapPriv =
(CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
+ ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
int i = cmapPriv->numColors;
int *indices = pScreenPriv->PreAllocIndices;
@@ -492,13 +517,13 @@ CMapReinstallMap(ColormapPtr pmap)
if(cmapPriv->recalculate)
CMapRefreshColors(pmap, cmapPriv->numColors, indices);
else {
- (*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, cmapPriv->numColors,
+ (*pScrn->LoadPalette)(pScrn, cmapPriv->numColors,
indices, cmapPriv->colors, pmap->pVisual);
- if (pScreenPriv->SetOverscan) {
+ if (pScrn->SetOverscan) {
#ifdef DEBUGOVERSCAN
ErrorF("SetOverscan() called from CMapReinstallMap\n");
#endif
- pScreenPriv->SetOverscan(pScreenPriv->pScrn, cmapPriv->overscan);
+ pScrn->SetOverscan(pScrn, cmapPriv->overscan);
}
}
@@ -514,6 +539,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
CMapColormapPtr pColPriv =
(CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
VisualPtr pVisual = pmap->pVisual;
+ ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
int numColors, i;
LOCO *gamma, *colors;
EntryPtr entry;
@@ -616,10 +642,10 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
if(LOAD_PALETTE(pmap, pmap->pScreen->myNum))
- (*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, defs, indices,
+ (*pScrn->LoadPalette)(pScreenPriv->pScrn, defs, indices,
colors, pmap->pVisual);
- if (pScreenPriv->SetOverscan)
+ if (pScrn->SetOverscan)
CMapSetOverscan(pmap, defs, indices);
}
@@ -646,6 +672,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
(CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
CMapColormapPtr pColPriv =
(CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
+ ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
VisualPtr pVisual = pmap->pVisual;
int i;
LOCO *colors;
@@ -771,7 +798,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
#ifdef DEBUGOVERSCAN
ErrorF("SetOverscan() called from CmapSetOverscan\n");
#endif
- pScreenPriv->SetOverscan(pScreenPriv->pScrn, overscan);
+ pScrn->SetOverscan(pScreenPriv->pScrn, overscan);
}
}
}
diff --git a/hw/xfree86/common/xf86cmap.h b/hw/xfree86/common/xf86cmap.h
index b871d6762..4291b971a 100644
--- a/hw/xfree86/common/xf86cmap.h
+++ b/hw/xfree86/common/xf86cmap.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.7 2001/05/06 00:49:12 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.9 2003/10/17 20:02:12 alanh Exp $ */
+
+/*
+ * Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _XF86CMAP_H
#define _XF86CMAP_H
@@ -10,25 +37,12 @@
#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,
+ xf86LoadPaletteProc *loadPalette,
+ xf86SetOverscanProc *setOverscan,
unsigned int flags
);
diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
index 8fcf9b817..8a807624f 100644
--- a/hw/xfree86/common/xf86fbBus.c
+++ b/hw/xfree86/common/xf86fbBus.c
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.2 2001/10/28 03:33:19 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.3 2003/08/24 17:36:55 dawes Exp $ */
/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
+ * Copyright (c) 2000-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index 7f4cffaae..b7c4afa1c 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.24 2001/12/05 19:23:52 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.28 2003/11/03 05:11:03 tsi Exp $ */
+
+/*
+ * Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "misc.h"
#include "xf86.h"
@@ -8,6 +35,10 @@
#include "regionstr.h"
#include "xf86fbman.h"
+/*
+#define DEBUG
+*/
+
static int xf86FBMangerIndex = -1;
static unsigned long xf86ManagerGeneration = 0;
@@ -118,19 +149,19 @@ xf86FreeOffscreenArea(FBAreaPtr area)
void
-xf86FreeOffscreenLinear(FBLinearPtr area)
+xf86FreeOffscreenLinear(FBLinearPtr linear)
{
FBManagerFuncsPtr funcs;
- if(!area) return;
+ if(!linear) return;
if(xf86FBMangerIndex < 0)
return;
if(!(funcs =
- (FBManagerFuncsPtr)area->pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ (FBManagerFuncsPtr)linear->pScreen->devPrivates[xf86FBMangerIndex].ptr))
return;
- (*funcs->FreeOffscreenLinear)(area);
+ (*funcs->FreeOffscreenLinear)(linear);
return;
}
@@ -244,18 +275,19 @@ typedef struct _FBLink {
} FBLink, *FBLinkPtr;
typedef struct _FBLinearLink {
- FBLinear linear;
- FBAreaPtr area;
+ FBLinear linear;
+ int free; /* need to add free here as FBLinear is publicly accessible */
+ FBAreaPtr area; /* only used if allocation came from XY area */
struct _FBLinearLink *next;
} FBLinearLink, *FBLinearLinkPtr;
typedef struct {
- ScreenPtr pScreen;
- RegionPtr InitialBoxes;
- RegionPtr FreeBoxes;
- FBLinkPtr UsedAreas;
- int NumUsedAreas;
+ ScreenPtr pScreen;
+ RegionPtr InitialBoxes;
+ RegionPtr FreeBoxes;
+ FBLinkPtr UsedAreas;
+ int NumUsedAreas;
FBLinearLinkPtr LinearAreas;
CloseScreenProcPtr CloseScreen;
int NumCallbacks;
@@ -772,6 +804,97 @@ LinearRemoveCBWrapper(FBAreaPtr area)
xfree(pLink);
}
+#ifdef DEBUG
+static void
+Dump(FBLinearLinkPtr pLink)
+{
+ if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n");
+
+ while (pLink) {
+ ErrorF(" Offset:%08x, Size:%08x, %s,%s\n",
+ pLink->linear.offset,
+ pLink->linear.size,
+ pLink->free ? "Free" : "Used",
+ pLink->area ? "Area" : "Linear");
+
+ pLink = pLink->next;
+ }
+}
+#endif
+
+static FBLinearPtr
+AllocateLinear(
+ FBManagerPtr offman,
+ int size,
+ int granularity,
+ pointer privData
+){
+ ScreenPtr pScreen = offman->pScreen;
+ FBLinearLinkPtr linear = NULL;
+ FBLinearLinkPtr newlink = NULL;
+ int offset, end;
+
+ if(size <= 0) return NULL;
+
+ if (!offman->LinearAreas) return NULL;
+
+ linear = offman->LinearAreas;
+ while (linear) {
+ /* Make sure we get a free area that's not an XY fallback case */
+ if (!linear->area && linear->free) {
+ offset = (linear->linear.offset + granularity) & ~granularity;
+ end = offset+size;
+ if (end <= (linear->linear.offset + linear->linear.size))
+ break;
+ }
+ linear = linear->next;
+ }
+ if (!linear)
+ return NULL;
+
+ /* break left */
+ if (offset > linear->linear.offset) {
+ newlink = xalloc(sizeof(FBLinearLink));
+ if (!newlink)
+ return NULL;
+ newlink->area = NULL;
+ newlink->linear.offset = offset;
+ newlink->linear.size = linear->linear.size - (offset - linear->linear.offset);
+ newlink->free = 1;
+ newlink->next = linear->next;
+ linear->linear.size -= newlink->linear.size;
+ linear->next = newlink;
+ linear = newlink;
+ }
+
+ /* break right */
+ if (size < linear->linear.size) {
+ newlink = xalloc(sizeof(FBLinearLink));
+ if (!newlink)
+ return NULL;
+ newlink->area = NULL;
+ newlink->linear.offset = offset + size;
+ newlink->linear.size = linear->linear.size - size;
+ newlink->free = 1;
+ newlink->next = linear->next;
+ linear->linear.size = size;
+ linear->next = newlink;
+ }
+
+ /* p = middle block */
+ linear->linear.granularity = granularity;
+ linear->free = 0;
+ linear->linear.pScreen = pScreen;
+ linear->linear.MoveLinearCallback = NULL;
+ linear->linear.RemoveLinearCallback = NULL;
+ linear->linear.devPrivate.ptr = NULL;
+
+#ifdef DEBUG
+ Dump(offman->LinearAreas);
+#endif
+
+ return &(linear->linear);
+}
static FBLinearPtr
localAllocateOffscreenLinear(
@@ -791,28 +914,21 @@ localAllocateOffscreenLinear(
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
- if(!(link = xalloc(sizeof(FBLinearLink))))
- return NULL;
+ /* Try to allocate from linear memory first...... */
+#ifdef DEBUG
+ ErrorF("ALLOCATING LINEAR\n");
+#endif
+ if ((linear = AllocateLinear(offman, length, gran, privData)))
+ return linear;
-#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 */
- }
+#ifdef DEBUG
+ ErrorF("NOPE, ALLOCATING AREA\n");
#endif
+ if(!(link = xalloc(sizeof(FBLinearLink))))
+ return NULL;
+
+ /* No linear available, so try and pinch some from the XY areas */
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
pitch = extents->x2 - extents->x1;
@@ -836,6 +952,7 @@ localAllocateOffscreenLinear(
privData)))
{
link->area = area;
+ link->free = 0;
link->next = offman->LinearAreas;
offman->LinearAreas = link;
linear = &(link->linear);
@@ -849,6 +966,10 @@ localAllocateOffscreenLinear(
} else
xfree(link);
+#ifdef DEBUG
+ Dump(offman->LinearAreas);
+#endif
+
return linear;
}
@@ -861,7 +982,7 @@ localFreeOffscreenLinear(FBLinearPtr linear)
ScreenPtr pScreen = linear->pScreen;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
-
+
pLink = offman->LinearAreas;
if(!pLink) return;
@@ -872,16 +993,42 @@ localFreeOffscreenLinear(FBLinearPtr linear)
}
if(pLink->area) { /* really an XY area */
- localFreeOffscreenArea(pLink->area);
- } else {
- /* free the linear area */
+#ifdef DEBUG
+ ErrorF("FREEING AREA\n");
+#endif
+ localFreeOffscreenArea(pLink->area);
+ if(pLinkPrev)
+ pLinkPrev->next = pLink->next;
+ else offman->LinearAreas = pLink->next;
+ xfree(pLink);
+#ifdef DEBUG
+ Dump(offman->LinearAreas);
+#endif
+ return;
}
- if(pLinkPrev)
- pLinkPrev->next = pLink->next;
- else offman->LinearAreas = pLink->next;
+ pLink->free = 1;
- xfree(pLink);
+ if (pLink->next && pLink->next->free) {
+ FBLinearLinkPtr p = pLink->next;
+ pLink->linear.size += p->linear.size;
+ pLink->next = p->next;
+ free(p);
+ }
+
+ if(pLinkPrev) {
+ if (pLinkPrev->next && pLinkPrev->next->free && !pLinkPrev->area) {
+ FBLinearLinkPtr p = pLinkPrev->next;
+ pLinkPrev->linear.size += p->linear.size;
+ pLinkPrev->next = p->next;
+ free(p);
+ }
+ }
+
+#ifdef DEBUG
+ ErrorF("FREEING LINEAR\n");
+ Dump(offman->LinearAreas);
+#endif
}
@@ -889,7 +1036,7 @@ static Bool
localResizeOffscreenLinear(FBLinearPtr resize, int length)
{
FBManagerPtr offman;
- FBLinearLinkPtr pLink, pLinkPrev = NULL;
+ FBLinearLinkPtr pLink;
ScreenPtr pScreen = resize->pScreen;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
@@ -898,7 +1045,6 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length)
if(!pLink) return FALSE;
while(&(pLink->linear) != resize) {
- pLinkPrev = pLink;
pLink = pLink->next;
if(!pLink) return FALSE;
}
@@ -928,7 +1074,7 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length)
return TRUE;
}
} else {
- /* resize the linear area */
+ /* TODO!!!! resize the linear area */
}
return FALSE;
@@ -943,22 +1089,45 @@ localQueryLargestOffscreenLinear(
int priority
)
{
- int w, h;
+ FBManagerPtr offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+ FBLinearLinkPtr pLink;
+ FBLinearLinkPtr pLinkRet;
*size = 0;
+
+ if (!offman->LinearAreas) return FALSE;
- /* for now, we only look at XY space */
- if(localQueryLargestOffscreenArea(pScreen, &w, &h, gran,
- FAVOR_WIDTH_THEN_AREA, priority))
- {
- FBManagerPtr offman;
- BoxPtr extents;
+ pLink = offman->LinearAreas;
+ pLinkRet = pLink;
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
- extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
- if((extents->x2 - extents->x1) == w)
- *size = w * h;
- return TRUE;
+ if (!pLink->area) {
+ while (pLink) {
+ if (pLink->free) {
+ if (pLink->linear.size > pLinkRet->linear.size)
+ pLinkRet = pLink;
+ }
+ pLink = pLink->next;
+ }
+
+ if (pLinkRet->free) {
+ *size = pLinkRet->linear.size;
+ return TRUE;
+ }
+ } else {
+ int w, h;
+
+ 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;
@@ -1189,6 +1358,44 @@ xf86InitFBManagerRegion(
return TRUE;
}
+Bool
+xf86InitFBManagerLinear(
+ ScreenPtr pScreen,
+ int offset,
+ int size
+){
+ FBManagerPtr offman;
+ FBLinearLinkPtr link;
+ FBLinearPtr linear;
+
+ if (size <= 0)
+ return FALSE;
+
+ /* we expect people to have called the Area setup first for pixmap cache */
+ if (!pScreen->devPrivates[xf86FBScreenIndex].ptr)
+ return FALSE;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ offman->LinearAreas = xalloc(sizeof(FBLinearLink));
+ if (!offman->LinearAreas)
+ return FALSE;
+
+ link = offman->LinearAreas;
+ link->area = NULL;
+ link->next = NULL;
+ link->free = 1;
+ linear = &(link->linear);
+ linear->pScreen = pScreen;
+ linear->size = size;
+ linear->offset = offset;
+ linear->granularity = 0;
+ linear->MoveLinearCallback = NULL;
+ linear->RemoveLinearCallback = NULL;
+ linear->devPrivate.ptr = NULL;
+
+ return TRUE;
+}
/* This is an implementation specific function and should
diff --git a/hw/xfree86/common/xf86fbman.h b/hw/xfree86/common/xf86fbman.h
index 673c7bc33..adb26a1f1 100644
--- a/hw/xfree86/common/xf86fbman.h
+++ b/hw/xfree86/common/xf86fbman.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.12 2001/08/28 16:55:09 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.14 2003/10/09 12:40:54 alanh Exp $ */
+
+/*
+ * Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _XF86FBMAN_H
#define _XF86FBMAN_H
@@ -108,6 +135,13 @@ xf86InitFBManager(
BoxPtr FullBox
);
+Bool
+xf86InitFBManagerLinear(
+ ScreenPtr pScreen,
+ int offset,
+ int size
+);
+
Bool
xf86FBManagerRunning(
ScreenPtr pScreen
diff --git a/hw/xfree86/common/xf86isaBus.c b/hw/xfree86/common/xf86isaBus.c
index cfe6ed000..1b9890d5e 100644
--- a/hw/xfree86/common/xf86isaBus.c
+++ b/hw/xfree86/common/xf86isaBus.c
@@ -1,9 +1,32 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.5 2000/12/06 15:35:11 eich Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.6 2003/08/24 17:36:55 dawes Exp $ */
/*
- * Copyright (c) 1997-1999 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2000 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
+
/*
* This file contains the interfaces to the bus-specific code
*/
diff --git a/hw/xfree86/common/xf86noBus.c b/hw/xfree86/common/xf86noBus.c
index a9efcdbc4..2d79ab476 100644
--- a/hw/xfree86/common/xf86noBus.c
+++ b/hw/xfree86/common/xf86noBus.c
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.1 2002/09/18 08:54:55 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.2 2003/08/24 17:36:55 dawes Exp $ */
/*
- * Copyright (c) 2000 by The XFree86 Project, Inc.
+ * Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index c40fc1016..641d1c919 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1,6 +1,29 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.68.2.1 2003/05/06 17:00:43 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.77 2003/11/03 05:11:03 tsi Exp $ */
/*
- * Copyright (c) 1997-2002 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -270,8 +293,8 @@ FindPCIVideoInfo(void)
}
/*
- * 64-bit base addresses are checked for and avoided.
- * XXX Should deal with them on platforms that support them.
+ * 64-bit base addresses are checked for and avoided on 32-bit
+ * platforms.
*/
if (pcrp->pci_base0) {
if (pcrp->pci_base0 & PCI_MAP_IO) {
@@ -454,7 +477,7 @@ FindPCIVideoInfo(void)
memdone = TRUE;
} else
xf86ErrorF(", ");
- xf86ErrorF("0x%08x/%d", info->memBase[i], info->size[i]);
+ xf86ErrorF("0x%08lx/%d", info->memBase[i], info->size[i]);
}
}
for (i = 0; i < 6; i++) {
@@ -465,12 +488,12 @@ FindPCIVideoInfo(void)
iodone = TRUE;
} else
xf86ErrorF(", ");
- xf86ErrorF("0x%04x/%d", info->ioBase[i], info->size[i]);
+ xf86ErrorF("0x%04lx/%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(", BIOS @ 0x%08lx/%d", info->biosBase, info->biosSize);
xf86ErrorF("\n");
}
}
@@ -567,7 +590,7 @@ pciIoAccessEnable(void* arg)
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);
+ pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
static void
@@ -577,7 +600,7 @@ pciIoAccessDisable(void* arg)
ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl &= ~SETBITS;
- (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+ pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
#undef SETBITS
@@ -589,7 +612,7 @@ pciIo_MemAccessEnable(void* arg)
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);
+ pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
static void
@@ -599,7 +622,7 @@ pciIo_MemAccessDisable(void* arg)
ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl &= ~SETBITS;
- (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+ pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
#undef SETBITS
@@ -611,7 +634,7 @@ pciMemAccessEnable(void* arg)
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);
+ pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
static void
@@ -621,38 +644,48 @@ pciMemAccessDisable(void* arg)
ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl &= ~SETBITS;
- (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+ pciWriteLong(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)
+#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN)
static void
pciBusAccessEnable(BusAccPtr ptr)
{
+ PCITAG tag = ptr->busdep.pci.acc;
+ CARD16 ctrl;
+
#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);
+ ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
+ if ((ctrl & MASKBITS) != PCI_PCI_BRIDGE_VGA_EN) {
+ ctrl = (ctrl | PCI_PCI_BRIDGE_VGA_EN) &
+ ~(PCI_PCI_BRIDGE_MASTER_ABORT_EN | PCI_PCI_BRIDGE_SECONDARY_RESET);
+ pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
+ }
}
/* move to OS layer */
static void
pciBusAccessDisable(BusAccPtr ptr)
{
+ PCITAG tag = ptr->busdep.pci.acc;
+ CARD16 ctrl;
+
#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);
+ ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
+ if (ctrl & MASKBITS) {
+ ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET);
+ pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
+ }
}
-#undef SETBITS
-#undef SHIFT_BITS
+#undef MASKBITS
/* move to OS layer */
static void
@@ -740,23 +773,34 @@ restorePciState(PCITAG tag, pciSavePtr ptr)
static void
savePciBusState(BusAccPtr ptr)
{
+ PCITAG tag = ptr->busdep.pci.acc;
+
ptr->busdep.pci.save.control =
- pciReadWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG) &
+ pciReadWord(tag, 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);
+ pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG,
+ ptr->busdep.pci.save.control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
}
/* move to OS layer */
+#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN)
static void
restorePciBusState(BusAccPtr ptr)
{
- pciWriteWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG,
- ptr->busdep.pci.save.control);
+ PCITAG tag = ptr->busdep.pci.acc;
+ CARD16 ctrl;
+
+ /* Only restore the bits we've changed (and don't cause resets) */
+ ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
+ if ((ctrl ^ ptr->busdep.pci.save.control) & MASKBITS) {
+ ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET);
+ ctrl |= ptr->busdep.pci.save.control & MASKBITS;
+ pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
+ }
}
+#undef MASKBITS
/* move to OS layer */
static void
@@ -828,12 +872,17 @@ correctPciSize(memType base, memType oldsize, memType newsize,
#if defined(LONG64) || defined(WORD64)
||
(B2M(pcrp->tag,PCIGETMEMORY64(basep[i])) == base)
+#else
+ ||
+ (!basep[i+1]
+ && (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base))
#endif
))) {
pcrp->basesize[i] = new_bits;
break; /* to next device */
}
}
+ if (PCI_MAP_IS64BITMEM(basep[i])) i++;
}
}
@@ -883,7 +932,7 @@ removeOverlapsWithBridges(int busIndex, resPtr target)
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",
+ "PCI %s resource overlap reduced 0x%08lx from 0x%08lx to 0x%08lx\n",
((target->res_type & ResPhysMask) == ResMem) ? "Memory" : "I/O",
range.rBegin, range.rEnd, target->block_end);
}
@@ -988,28 +1037,38 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
(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]),
+ if (PCI_MAP_IS_IO(basep[i])) {
+ if (pcrp->pci_command & PCI_CMD_IO_ENABLE)
+ res = activeRes;
+ else
+ res = inactiveRes;
+ 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 {
+ } else if (!PCI_MAP_IS64BITMEM(basep[i])) {
+ if (pcrp->pci_command & PCI_CMD_MEM_ENABLE)
+ res = activeRes;
+ else
+ res = inactiveRes;
+ 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)
+ P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i - 1]),
+ pcrp->basesize[i - 1], ResExcMemBlock | resMisc)
#else
+ if (basep[i])
continue;
+ P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i - 1]),
+ pcrp->basesize[i - 1], ResExcMemBlock | resMisc)
#endif
+ if (pcrp->pci_command & PCI_CMD_MEM_ENABLE)
+ res = activeRes;
+ else
+ res = inactiveRes;
}
if (range.rBegin) { /* catch cases where PCI base is unset */
tmp = xf86AddResToList(NULL, &range, -1);
@@ -1018,15 +1077,16 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
}
}
}
+
/* Ignore disabled non-video ROMs */
- if ((res == activeRes) &&
+ if ((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 | resMisc);
if (range.rBegin) {
tmp = xf86AddResToList(NULL, &range, -1);
- removeOverlapsWithBridges(pcrp->busnum,tmp);
- *res = xf86JoinResLists(tmp,*res);
+ removeOverlapsWithBridges(pcrp->busnum, tmp);
+ *activeRes = xf86JoinResLists(tmp, *activeRes);
}
}
}
@@ -1063,8 +1123,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
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",
+ "PCI %s resource overlap reduced 0x%08lx"
+ " from 0x%08lx to 0x%08lx\n",
((pRes->res_type & ResPhysMask) == ResMem) ?
"Memory" : "I/O",
range.rBegin, range.rEnd, pRes->block_end);
@@ -1092,8 +1152,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
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",
+ "PCI %s resource overlap reduced 0x%08lx"
+ " from 0x%08lx to 0x%08lx\n",
((pRes->res_type & ResPhysMask) == ResMem) ?
"Memory" : "I/O",
range.rBegin, range.rEnd, pRes->block_end);
@@ -1760,8 +1820,8 @@ xf86GetPciBridgeInfo(void)
break;
}
- if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses)
- (*pBusInfo->funcs->pciGetBridgeBusses)(secondary,
+ if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses)
+ (*pBusInfo->funcs->pciGetBridgeBuses)(secondary,
&primary,
&secondary,
&subordinate);
@@ -1899,8 +1959,8 @@ xf86GetPciBridgeInfo(void)
break;
}
- if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses)
- (*pBusInfo->funcs->pciGetBridgeBusses)(secondary,
+ if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses)
+ (*pBusInfo->funcs->pciGetBridgeBuses)(secondary,
&primary,
&secondary,
&subordinate);
@@ -2087,8 +2147,8 @@ xf86GetPciBridgeInfo(void)
if (pBusInfo) {
PciBus->primary = PciBus->secondary = secondary;
- if (pBusInfo->funcs->pciGetBridgeBusses)
- (*pBusInfo->funcs->pciGetBridgeBusses)
+ if (pBusInfo->funcs->pciGetBridgeBuses)
+ (*pBusInfo->funcs->pciGetBridgeBuses)
(secondary,
&PciBus->primary,
&PciBus->secondary,
@@ -2275,7 +2335,6 @@ ValidatePci(void)
pciConfigPtr pcrp, *pcrpp;
CARD32 *basep;
resPtr Sys;
- resPtr Fix;
resRange range;
int n = 0, m, i;
@@ -2286,6 +2345,7 @@ ValidatePci(void)
* the ones which have been assigned to a screen.
*/
Sys = xf86DupResList(osRes);
+ /* Only validate graphics devices in use */
for (i=0; i<xf86NumScreens; i++) {
for (m = 0; m < xf86Screens[i]->numEntities; m++)
if ((pvp = xf86GetPciInfoForEntity(xf86Screens[i]->entityList[m])))
@@ -2328,6 +2388,7 @@ ValidatePci(void)
}
for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
+ /* These were handled above */
if (PCIINFOCLASSES(pcrp->pci_base_class, pcrp->pci_sub_class))
continue;
@@ -2350,13 +2411,16 @@ ValidatePci(void)
pcrp->basesize[i], ResExcMemBlock)
} else {
i++;
-#if defined(LONG64) || defined(WORD64)
if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE))
continue;
+#if defined(LONG64) || defined(WORD64)
P_M_RANGE(range, pcrp->tag, PCIGETMEMORY64(basep[i-1]),
pcrp->basesize[i-1], ResExcMemBlock)
#else
- continue;
+ if (basep[i])
+ continue;
+ P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i-1]),
+ pcrp->basesize[i-1], ResExcMemBlock)
#endif
}
Sys = xf86AddResToList(Sys, &range, -1);
@@ -2458,7 +2522,6 @@ ValidatePci(void)
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;
@@ -2596,8 +2659,6 @@ initPciState(void)
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;
@@ -2674,8 +2735,6 @@ initPciBusState(void)
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:
diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h
index fbe3fbe62..fbb733ae7 100644
--- a/hw/xfree86/common/xf86pciBus.h
+++ b/hw/xfree86/common/xf86pciBus.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.8 2002/09/16 16:55:33 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.10 2003/08/24 17:36:56 dawes Exp $ */
+
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _XF86_PCI_BUS_H
#define _XF86_PCI_BUS_H
@@ -11,12 +38,8 @@ typedef struct {
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;
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 2b6deed33..367cb19a9 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.90 2002/11/25 14:04:56 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.97 2003/10/30 17:36:56 tsi Exp $ */
/*
- * Copyright (c) 1997-2000 by The XFree86 Project, Inc.
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/*
@@ -16,6 +39,7 @@
#include "input.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
+#include "colormapst.h"
#include "xf86Module.h"
#include "xf86Opt.h"
#include "xf86Pci.h"
@@ -452,24 +476,10 @@ typedef struct _confdrirec {
/* 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
+#define NUM_RESERVED_FUNCS 12
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,
@@ -747,12 +757,16 @@ 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 ModeStatus 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);
+typedef int xf86HandleMessageProc (int, const char*, const char*, char**);
+typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int);
+typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
+typedef void xf86SetOverscanProc (ScrnInfoPtr, int);
/*
* ScrnInfoRec
@@ -903,6 +917,10 @@ typedef struct _ScrnInfoRec {
xf86ChangeGammaProc *ChangeGamma;
xf86PointerMovedProc *PointerMoved;
xf86PMEventProc *PMEvent;
+ xf86HandleMessageProc *HandleMessage;
+ xf86DPMSSetProc *DPMSSet;
+ xf86LoadPaletteProc *LoadPalette;
+ xf86SetOverscanProc *SetOverscan;
/*
* This can be used when the minor ABI version is incremented.
@@ -1023,7 +1041,32 @@ typedef enum {
ACTION_CLOSECLIENT, /* Kill client holding grab */
ACTION_SWITCHSCREEN = 100, /* VT switch */
ACTION_SWITCHSCREEN_NEXT,
- ACTION_SWITCHSCREEN_PREV
+ ACTION_SWITCHSCREEN_PREV,
+ ACTION_MESSAGE = 9999 /* Generic message passing */
} ActionEvent;
+/* xf86Versions.c */
+/*
+ * Never change existing values, and always assign values explicitly.
+ * NUM_BUILTIN_IFS must always be the last entry.
+ */
+typedef enum {
+ BUILTIN_IF_OSMOUSE = 0,
+ BUILTIN_IF_OSKBD = 1,
+ NUM_BUILTIN_IFS
+} BuiltinInterface;
+
+/*
+ * These are intentionally the same as the module version macros.
+ * It is possible to register a module as providing a specific interface,
+ * in which case the module's version is used. This feature isn't
+ * really ready for use yet though.
+ */
+
+#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \
+ ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
+#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
+#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
+#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers) ((vers) & 0xFFFF)
+
#endif /* _XF86STR_H */
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index c6a09121b..90289057b 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1,12 +1,34 @@
-/*
-
- 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 $ */
+/*
+ * XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
+ */
+/*
+ * Copyright (c) 1998-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.37 2003/11/10 18:22:15 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -31,7 +53,7 @@
#include "xvmodproc.h"
#endif
-#include "xf86xv.h"
+#include "xf86xvpriv.h"
/* XvScreenRec fields */
@@ -44,29 +66,29 @@ static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
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,
INT16, INT16, CARD16, CARD16);
static int xf86XVPutStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
static int xf86XVGetVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
static int xf86XVGetStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ 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,
+ CARD16, CARD16,CARD16, CARD16,
unsigned int*, unsigned int*);
static int xf86XVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16,
XvImagePtr, unsigned char*, Bool,
CARD16, CARD16);
-static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
+static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
CARD16*, CARD16*, int*, int*);
@@ -107,7 +129,7 @@ int (*XvScreenInitProc)(ScreenPtr) = XvScreenInit;
((XvScreenPtr)((pScreen)->devPrivates[XF86XvScreenIndex].ptr))
#define GET_XF86XV_SCREEN(pScreen) \
- ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr))
+ ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr))
#define GET_XF86XV_WINDOW(pWin) \
((XF86XVWindowPtr)((pWin)->devPrivates[XF86XVWindowIndex].ptr))
@@ -121,12 +143,12 @@ xf86XVRegisterGenericAdaptorDriver(
){
xf86XVInitGenericAdaptorPtr *newdrivers;
- newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
+ newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
(1 + NumGenDrivers));
if (!newdrivers)
return 0;
GenDrivers = newdrivers;
-
+
GenDrivers[NumGenDrivers++] = InitFunc;
return 1;
@@ -134,7 +156,7 @@ xf86XVRegisterGenericAdaptorDriver(
int
xf86XVListGenericAdaptors(
- ScrnInfoPtr pScrn,
+ ScrnInfoPtr pScrn,
XF86VideoAdaptorPtr **adaptors
){
int i,j,n,num;
@@ -142,8 +164,13 @@ xf86XVListGenericAdaptors(
num = 0;
*adaptors = NULL;
- for (i = 0; i < NumGenDrivers; i++) {
- n = GenDrivers[i](pScrn,&DrivAdap);
+ /*
+ * The v4l driver registers itself first, but can use surfaces registered
+ * by other drivers. So, call the v4l driver last.
+ */
+ for (i = NumGenDrivers; --i >= 0; ) {
+ DrivAdap = NULL;
+ n = (*GenDrivers[i])(pScrn, &DrivAdap);
if (0 == n)
continue;
new = xrealloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num+n));
@@ -156,6 +183,38 @@ xf86XVListGenericAdaptors(
return num;
}
+
+/**************** Offscreen surface stuff *******************/
+
+typedef struct {
+ XF86OffscreenImagePtr images;
+ int num;
+} OffscreenImageRec;
+
+static OffscreenImageRec OffscreenImages[MAXSCREENS];
+
+Bool
+xf86XVRegisterOffscreenImages(
+ ScreenPtr pScreen,
+ XF86OffscreenImagePtr images,
+ int num
+){
+ OffscreenImages[pScreen->myNum].num = num;
+ OffscreenImages[pScreen->myNum].images = images;
+
+ return TRUE;
+}
+
+XF86OffscreenImagePtr
+xf86XVQueryOffscreenImages(
+ ScreenPtr pScreen,
+ int *num
+){
+ *num = OffscreenImages[pScreen->myNum].num;
+ return OffscreenImages[pScreen->myNum].images;
+}
+
+
XF86VideoAdaptorPtr
xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn)
{
@@ -171,7 +230,7 @@ xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr)
Bool
xf86XVScreenInit(
- ScreenPtr pScreen,
+ ScreenPtr pScreen,
XF86VideoAdaptorPtr *adaptors,
int num
){
@@ -181,7 +240,7 @@ xf86XVScreenInit(
if(num <= 0 ||
!XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc)
- return FALSE;
+ return FALSE;
if(XF86XVGeneration != serverGeneration) {
if((XF86XVWindowIndex = AllocateWindowPrivateIndex()) < 0)
@@ -190,7 +249,7 @@ xf86XVScreenInit(
}
if(!AllocateWindowPrivate(pScreen,XF86XVWindowIndex,0))
- return FALSE;
+ return FALSE;
if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
@@ -245,31 +304,28 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
{
int i;
- if(pAdaptor->name)
- xfree(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);
- }
+ for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++)
+ xfree(pEncode->name);
xfree(pAdaptor->pEncodings);
}
- if(pAdaptor->pFormats)
- xfree(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;
+ pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
if(pPriv) {
- if(pPriv->clientClip)
+ if(pPriv->clientClip)
REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
- if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
+ if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
xfree(pPriv);
}
@@ -280,23 +336,18 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
if(pAdaptor->nAttributes) {
XvAttributePtr pAttribute = pAdaptor->pAttributes;
- for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) {
- if(pAttribute->name) xfree(pAttribute->name);
- }
-
+ for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++)
+ xfree(pAttribute->name);
xfree(pAdaptor->pAttributes);
}
- if(pAdaptor->nImages)
- xfree(pAdaptor->pImages);
-
- if(pAdaptor->devPriv.ptr)
- xfree(pAdaptor->devPriv.ptr);
+ xfree(pAdaptor->pImages);
+ xfree(pAdaptor->devPriv.ptr);
}
static Bool
xf86XVInitAdaptors(
- ScreenPtr pScreen,
+ ScreenPtr pScreen,
XF86VideoAdaptorPtr *infoPtr,
int number
) {
@@ -325,7 +376,7 @@ xf86XVInitAdaptors(
pxvs->nAdaptors = 0;
pxvs->pAdaptors = NULL;
- if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
+ if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
return FALSE;
for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) {
@@ -339,7 +390,7 @@ xf86XVInitAdaptors(
if(!adaptorPtr->nEncodings || !adaptorPtr->pEncodings)
continue;
- pa->type = adaptorPtr->type;
+ pa->type = adaptorPtr->type;
if(!adaptorPtr->PutVideo && !adaptorPtr->GetVideo)
pa->type &= ~XvVideoMask;
@@ -350,19 +401,19 @@ xf86XVInitAdaptors(
if(!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes)
pa->type &= ~XvImageMask;
- if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
+ if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
!adaptorPtr->PutStill)
pa->type &= ~XvInputMask;
if(!adaptorPtr->GetVideo && !adaptorPtr->GetStill)
pa->type &= ~XvOutputMask;
-
- if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
+
+ if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
continue;
- if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
+ if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
continue;
- pa->pScreen = pScreen;
+ pa->pScreen = pScreen;
pa->ddAllocatePort = xf86XVAllocatePort;
pa->ddFreePort = xf86XVFreePort;
pa->ddPutVideo = xf86XVPutVideo;
@@ -376,33 +427,33 @@ xf86XVInitAdaptors(
pa->ddQueryBestSize = xf86XVQueryBestSize;
pa->ddQueryImageAttributes = xf86XVQueryImageAttributes;
if((pa->name = xalloc(strlen(adaptorPtr->name) + 1)))
- strcpy(pa->name, adaptorPtr->name);
+ 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++)
- {
+ 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);
+ 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;
- }
+ pa->pEncodings = pEncode;
+ }
if(adaptorPtr->nImages &&
- (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
+ (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
- for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages;
- i < adaptorPtr->nImages; i++, pi++, imagePtr++)
- {
+ 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;
@@ -425,7 +476,7 @@ xf86XVInitAdaptors(
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;
}
@@ -433,65 +484,65 @@ xf86XVInitAdaptors(
if(adaptorPtr->nAttributes &&
(pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec))))
{
- for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0;
- i < adaptorPtr->nAttributes; pat++, i++, attributePtr++)
- {
+ 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);
+ strcpy(pat->name, attributePtr->name);
}
pa->nAttributes = adaptorPtr->nAttributes;
- pa->pAttributes = pAttribute;
- }
+ pa->pAttributes = pAttribute;
+ }
totFormat = adaptorPtr->nFormats;
if(!(pFormat = xcalloc(totFormat, sizeof(XvFormatRec)))) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
- for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
- i < adaptorPtr->nFormats; i++, formatPtr++)
+ for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
+ i < adaptorPtr->nFormats; i++, formatPtr++)
{
numVisuals = pScreen->numVisuals;
- pVisual = pScreen->visuals;
+ pVisual = pScreen->visuals;
- while(numVisuals--) {
- if((pVisual->class == formatPtr->class) &&
- (pVisual->nplanes == formatPtr->depth)) {
+ while(numVisuals--) {
+ if((pVisual->class == formatPtr->class) &&
+ (pVisual->nplanes == formatPtr->depth)) {
if(numFormat >= totFormat) {
- void *moreSpace;
+ void *moreSpace;
totFormat *= 2;
- moreSpace = xrealloc(pFormat,
+ moreSpace = xrealloc(pFormat,
totFormat * sizeof(XvFormatRec));
if(!moreSpace) break;
pFormat = moreSpace;
pf = pFormat + numFormat;
}
- pf->visual = pVisual->vid;
+ pf->visual = pVisual->vid;
pf->depth = formatPtr->depth;
pf++;
numFormat++;
- }
- pVisual++;
- }
+ }
+ pVisual++;
+ }
}
pa->nFormats = numFormat;
- pa->pFormats = pFormat;
+ pa->pFormats = pFormat;
if(!numFormat) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
if(!(adaptorPriv = xcalloc(1, sizeof(XvAdaptorRecPrivate)))) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
adaptorPriv->flags = adaptorPtr->flags;
@@ -510,47 +561,47 @@ xf86XVInitAdaptors(
pa->devPriv.ptr = (pointer)adaptorPriv;
if(!(pPort = xcalloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
- for(pp = pPort, i = 0, numPort = 0;
+ for(pp = pPort, i = 0, numPort = 0;
i < adaptorPtr->nPorts; i++) {
- if(!(pp->id = FakeClientID(0)))
+ if(!(pp->id = FakeClientID(0)))
continue;
- if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate))))
+ 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;
+ 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++;
+ portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr;
+
+ pp++;
+ numPort++;
}
pa->nPorts = numPort;
pa->pPorts = pPort;
if(!numPort) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
pa->base_id = pPort->id;
-
+
pa++;
numAdaptor++;
}
@@ -576,23 +627,25 @@ xf86XVInitAdaptors(
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).
+ 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
+static void
xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
{
RegionPtr pregWin, pCompositeClip;
WindowPtr pWin;
- Bool freeCompClip = FALSE;
+ ScreenPtr pScreen;
+ Bool freeCompClip = FALSE;
if(portPriv->pCompositeClip)
return;
pWin = (WindowPtr)portPriv->pDraw;
+ pScreen = pWin->drawable.pScreen;
/* get window clip list */
if(portPriv->subWindowMode == IncludeInferiors) {
@@ -607,19 +660,19 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
return;
}
- pCompositeClip = REGION_CREATE(pWin->pScreen, NullBox, 1);
- REGION_COPY(pWin->pScreen, pCompositeClip, portPriv->clientClip);
- REGION_TRANSLATE(pWin->pScreen, pCompositeClip,
+ pCompositeClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pCompositeClip, portPriv->clientClip);
+ REGION_TRANSLATE(pScreen, pCompositeClip,
portPriv->pDraw->x + portPriv->clipOrg.x,
portPriv->pDraw->y + portPriv->clipOrg.y);
- REGION_INTERSECT(pWin->pScreen, pCompositeClip, pregWin, pCompositeClip);
+ REGION_INTERSECT(pScreen, pCompositeClip, pregWin, pCompositeClip);
portPriv->pCompositeClip = pCompositeClip;
portPriv->FreeCompositeClip = TRUE;
if(freeCompClip) {
- REGION_DESTROY(pWin->pScreen, pregWin);
- }
+ REGION_DESTROY(pScreen, pregWin);
+ }
}
/* Save the current clientClip and update the CompositeClip whenever
@@ -627,23 +680,25 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
static void
xf86XVCopyClip(
- XvPortRecPrivatePtr portPriv,
+ XvPortRecPrivatePtr portPriv,
GCPtr pGC
){
+ ScreenPtr pScreen = pGC->pScreen;
+
/* 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);
+ portPriv->clientClip = REGION_CREATE(pScreen, NullBox, 1);
/* Note: this is in window coordinates */
- REGION_COPY(pGC->pScreen, portPriv->clientClip, pGC->clientClip);
+ REGION_COPY(pScreen, portPriv->clientClip, pGC->clientClip);
} else if(portPriv->clientClip) { /* free the old clientClip */
- REGION_DESTROY(pGC->pScreen, portPriv->clientClip);
+ REGION_DESTROY(pScreen, portPriv->clientClip);
portPriv->clientClip = NULL;
}
/* get rid of the old clip list */
if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
- REGION_DESTROY(pWin->pScreen, portPriv->pCompositeClip);
+ REGION_DESTROY(pScreen, portPriv->pCompositeClip);
}
portPriv->clipOrg = pGC->clipOrg;
@@ -670,12 +725,12 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
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);
-
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
+
/* that's all if it's totally obscured */
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
clippedAway = TRUE;
@@ -686,11 +741,11 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
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,
+ 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)
@@ -734,27 +789,27 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
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);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &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.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.x2 = portPriv->pScrn->frameX1;
VPBox.y2 = portPriv->pScrn->frameY1;
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
-
+
/* that's all if it's totally obscured */
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
clippedAway = TRUE;
@@ -765,8 +820,8 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
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))
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
goto CLIP_VIDEO_BAILOUT;
@@ -777,11 +832,11 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn,
- portPriv->vid_x, portPriv->vid_y,
+ 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,
+ portPriv->vid_w, portPriv->vid_h,
+ portPriv->drw_w, portPriv->drw_h,
&ClipRegion, portPriv->DevPriv.ptr);
if(ret == Success) portPriv->isOn = XV_ON;
@@ -823,27 +878,27 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
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);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &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.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.x2 = portPriv->pScrn->frameX1;
VPBox.y2 = portPriv->pScrn->frameY1;
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
-
+
/* that's all if it's totally obscured */
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
clippedAway = TRUE;
@@ -854,8 +909,8 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
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))
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
goto CLIP_VIDEO_BAILOUT;
@@ -866,7 +921,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
+ ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
WinBox.x1, WinBox.y1,
&ClipRegion, portPriv->DevPriv.ptr);
@@ -910,7 +965,7 @@ xf86XVReputAllVideo(WindowPtr pWin, pointer data)
static int
xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
{
- XF86XVWindowPtr winPriv, PrivRoot;
+ XF86XVWindowPtr winPriv, PrivRoot;
winPriv = PrivRoot = GET_XF86XV_WINDOW(pWin);
@@ -927,7 +982,7 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
winPriv->PortRec = portPriv;
winPriv->next = PrivRoot;
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
- }
+ }
return Success;
}
@@ -941,15 +996,15 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
while(winPriv) {
if(winPriv->PortRec == portPriv) {
- if(prevPriv)
+ if(prevPriv)
prevPriv->next = winPriv->next;
- else
- pWin->devPrivates[XF86XVWindowIndex].ptr =
+ else
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
(pointer)winPriv->next;
xfree(winPriv);
break;
}
- prevPriv = winPriv;
+ prevPriv = winPriv;
winPriv = winPriv->next;
}
portPriv->pDraw = NULL;
@@ -1008,7 +1063,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
/* filter out XClearWindow/Area */
if (!pWin->valdata) return;
-
+
pPrev = NULL;
while(WinPriv) {
@@ -1019,10 +1074,10 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
switch(pPriv->type) {
case XvInputMask:
xf86XVReputVideo(pPriv);
- break;
+ break;
case XvOutputMask:
- xf86XVRegetVideo(pPriv);
- break;
+ xf86XVRegetVideo(pPriv);
+ break;
default: /* overlaid still/image*/
if (pPriv->AdaptorRec->ReputImage)
xf86XVReputImage(pPriv);
@@ -1036,8 +1091,8 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
}
pPriv->pDraw = NULL;
- if(!pPrev)
- pWin->devPrivates[XF86XVWindowIndex].ptr =
+ if(!pPrev)
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
(pointer)(WinPriv->next);
else
pPrev->next = WinPriv->next;
@@ -1054,7 +1109,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
}
-static void
+static void
xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -1073,7 +1128,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
pPriv->pCompositeClip = NULL;
- /* Stop everything except images, but stop them too if the
+ /* Stop everything except images, but stop them too if the
window isn't visible. But we only remove the images. */
if(pPriv->type || !visible) {
@@ -1086,8 +1141,8 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
if(!pPriv->type) { /* overlaid still/image */
pPriv->pDraw = NULL;
- if(!pPrev)
- pWin->devPrivates[XF86XVWindowIndex].ptr =
+ if(!pPrev)
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
(pointer)(WinPriv->next);
else
pPrev->next = WinPriv->next;
@@ -1122,6 +1177,9 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
XvAdaptorPtr pa;
int c;
+ /* Clear offscreen images */
+ (void)memset(&OffscreenImages[pScreen->myNum], 0, sizeof(OffscreenImages[0]));
+
if(!ScreenPriv) return TRUE;
if(ScreenPriv->videoGC) {
@@ -1133,20 +1191,16 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
pScreen->WindowExposures = ScreenPriv->WindowExposures;
pScreen->ClipNotify = ScreenPriv->ClipNotify;
- pScrn->EnterVT = ScreenPriv->EnterVT;
- pScrn->LeaveVT = ScreenPriv->LeaveVT;
+ pScrn->EnterVT = ScreenPriv->EnterVT;
+ pScrn->LeaveVT = ScreenPriv->LeaveVT;
pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
- for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
+ for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
xf86XVFreeAdaptor(pa);
}
- if(pxvs->pAdaptors)
- xfree(pxvs->pAdaptors);
-
+ xfree(pxvs->pAdaptors);
xfree(ScreenPriv);
-
-
return TRUE;
}
@@ -1168,7 +1222,7 @@ xf86XVQueryAdaptors(
/**** ScrnInfoRec fields ****/
-static Bool
+static Bool
xf86XVEnterVT(int index, int flags)
{
ScreenPtr pScreen = screenInfo.screens[index];
@@ -1177,12 +1231,12 @@ xf86XVEnterVT(int index, int flags)
ret = (*ScreenPriv->EnterVT)(index, flags);
- if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0);
-
+ if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0);
+
return ret;
}
-static void
+static void
xf86XVLeaveVT(int index, int flags)
{
ScreenPtr pScreen = screenInfo.screens[index];
@@ -1229,14 +1283,14 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
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++) {
+
+ for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) {
XvPortPtr pPort = pa->pPorts;
XvPortRecPrivatePtr pPriv;
@@ -1254,7 +1308,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
if ((pPriv->AdaptorRec->ReputImage) &&
((pWin->visibility == VisibilityUnobscured) ||
- (pWin->visibility == VisibilityPartiallyObscured)))
+ (pWin->visibility == VisibilityPartiallyObscured)))
{
xf86XVReputImage(pPriv);
} else {
@@ -1297,8 +1351,8 @@ xf86XVPutVideo(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1310,7 +1364,7 @@ xf86XVPutVideo(
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);
@@ -1333,7 +1387,7 @@ xf86XVPutVideo(
/* To indicate to the DI layer that we were successful */
pPort->pDraw = pDraw;
-
+
if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
return(xf86XVReputVideo(portPriv));
@@ -1345,8 +1399,8 @@ xf86XVPutStill(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1369,22 +1423,22 @@ xf86XVPutStill(
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);
+ REGION_NULL(pScreen, &ClipRegion);
+ 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.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.x2 = portPriv->pScrn->frameX1;
VPBox.y2 = portPriv->pScrn->frameY1;
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
@@ -1400,11 +1454,11 @@ xf86XVPutStill(
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->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
- goto PUT_STILL_BAILOUT;
+ goto PUT_STILL_BAILOUT;
}
}
@@ -1412,7 +1466,7 @@ xf86XVPutStill(
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
+ 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);
@@ -1433,9 +1487,9 @@ xf86XVPutStill(
PUT_STILL_BAILOUT:
if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
}
REGION_UNINIT(pScreen, &WinRegion);
@@ -1450,8 +1504,8 @@ xf86XVGetVideo(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1463,7 +1517,7 @@ xf86XVGetVideo(
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);
@@ -1486,7 +1540,7 @@ xf86XVGetVideo(
/* To indicate to the DI layer that we were successful */
pPort->pDraw = pDraw;
-
+
if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
return(xf86XVRegetVideo(portPriv));
@@ -1498,8 +1552,8 @@ xf86XVGetStill(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1522,10 +1576,10 @@ xf86XVGetStill(
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);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
if(portPriv->pDraw) {
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
@@ -1548,9 +1602,9 @@ xf86XVGetStill(
GET_STILL_BAILOUT:
if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
}
REGION_UNINIT(pScreen, &WinRegion);
@@ -1559,7 +1613,7 @@ GET_STILL_BAILOUT:
return ret;
}
-
+
static int
xf86XVStopVideo(
@@ -1571,7 +1625,7 @@ xf86XVStopVideo(
if(pDraw->type != DRAWABLE_WINDOW)
return BadAlloc;
-
+
xf86XVRemovePortFromWindow((WindowPtr)pDraw, portPriv);
if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
@@ -1595,8 +1649,8 @@ xf86XVSetPortAttribute(
INT32 value
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn,
+
+ return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn,
attribute, value, portPriv->DevPriv.ptr));
}
@@ -1609,8 +1663,8 @@ xf86XVGetPortAttribute(
INT32 *p_value
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn,
+
+ return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn,
attribute, p_value, portPriv->DevPriv.ptr));
}
@@ -1626,8 +1680,8 @@ xf86XVQueryBestSize(
unsigned int *p_w, unsigned int *p_h
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn,
+
+ (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn,
(Bool)motion, vid_w, vid_h, drw_w, drw_h,
p_w, p_h, portPriv->DevPriv.ptr);
@@ -1635,14 +1689,14 @@ xf86XVQueryBestSize(
}
-static int
+static int
xf86XVPutImage(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
+ ClientPtr client,
+ DrawablePtr pDraw,
+ XvPortPtr pPort,
GCPtr pGC,
- INT16 src_x, INT16 src_y,
- CARD16 src_w, CARD16 src_h,
+ 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,
@@ -1669,22 +1723,22 @@ xf86XVPutImage(
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);
+ REGION_NULL(pScreen, &ClipRegion);
+ 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.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1 + 1;
+ 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_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
@@ -1700,11 +1754,11 @@ xf86XVPutImage(
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->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
- goto PUT_IMAGE_BAILOUT;
+ goto PUT_IMAGE_BAILOUT;
}
}
@@ -1712,7 +1766,7 @@ xf86XVPutImage(
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
+ 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);
@@ -1733,9 +1787,9 @@ xf86XVPutImage(
PUT_IMAGE_BAILOUT:
if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
}
REGION_UNINIT(pScreen, &WinRegion);
@@ -1745,19 +1799,19 @@ PUT_IMAGE_BAILOUT:
}
-static int
+static int
xf86XVQueryImageAttributes(
- ClientPtr client,
+ ClientPtr client,
XvPortPtr pPort,
- XvImagePtr format,
- CARD16 *width,
- CARD16 *height,
+ XvImagePtr format,
+ CARD16 *width,
+ CARD16 *height,
int *pitches,
int *offsets
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
- return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn,
+ return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn,
format->id, width, height, pitches, offsets);
}
@@ -1778,7 +1832,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
pval[0] = key;
pval[1] = IncludeInferiors;
ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode,
- pval, &status);
+ pval, &status);
if(!ScreenPriv->videoGC) return;
ValidateGC(root, ScreenPriv->videoGC);
} else if (key != ScreenPriv->videoGC->fgPixel){
@@ -1795,20 +1849,20 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
rects[i].width = pbox->x2 - pbox->x1;
rects[i].height = pbox->y2 - pbox->y1;
}
-
+
(*ScreenPriv->videoGC->ops->PolyFillRect)(
- root, ScreenPriv->videoGC, nbox, rects);
+ root, ScreenPriv->videoGC, nbox, rects);
DEALLOCATE_LOCAL(rects);
}
-/* xf86XVClipVideoHelper -
+/* 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.
+ 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]
@@ -1824,112 +1878,169 @@ xf86XVClipVideoHelper(
INT32 width,
INT32 height
){
- INT32 vscale, hscale, delta;
+ double xsw, xdw, ysw, ydw;
+ INT32 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);
+ xsw = (*xb - *xa) << 16;
+ xdw = dst->x2 - dst->x1;
+ ysw = (*yb - *ya) << 16;
+ ydw = 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;
+ if (diff > 0) {
+ dst->x1 = extents->x1;
+ *xa += (diff * xsw) / xdw;
}
diff = dst->x2 - extents->x2;
- if(diff > 0) {
- dst->x2 = extents->x2;
- *xb -= diff * hscale;
+ if (diff > 0) {
+ dst->x2 = extents->x2;
+ *xb -= (diff * xsw) / xdw;
}
diff = extents->y1 - dst->y1;
- if(diff > 0) {
- dst->y1 = extents->y1;
- *ya += diff * vscale;
+ if (diff > 0) {
+ dst->y1 = extents->y1;
+ *ya += (diff * ysw) / ydw;
}
diff = dst->y2 - extents->y2;
- if(diff > 0) {
- dst->y2 = extents->y2;
- *yb -= diff * vscale;
+ if (diff > 0) {
+ dst->y2 = extents->y2;
+ *yb -= (diff * ysw) / ydw;
}
- if(*xa < 0) {
- diff = (- *xa + hscale - 1)/ hscale;
- dst->x1 += diff;
- *xa += diff * hscale;
+ if (*xa < 0) {
+ diff = (((-*xa) * xdw) + xsw - 1) / xsw;
+ dst->x1 += diff;
+ *xa += (diff * xsw) / xdw;
}
delta = *xb - (width << 16);
- if(delta > 0) {
- diff = (delta + hscale - 1)/ hscale;
- dst->x2 -= diff;
- *xb -= diff * hscale;
+ if (delta > 0) {
+ diff = ((delta * xdw) + xsw - 1) / xsw;
+ dst->x2 -= diff;
+ *xb -= (diff * xsw) / xdw;
}
- if(*xa >= *xb) return FALSE;
+ if (*xa >= *xb) return FALSE;
- if(*ya < 0) {
- diff = (- *ya + vscale - 1)/ vscale;
- dst->y1 += diff;
- *ya += diff * vscale;
+ if (*ya < 0) {
+ diff = (((-*ya) * ydw) + ysw - 1) / ysw;
+ dst->y1 += diff;
+ *ya += (diff * ysw) / ydw;
}
delta = *yb - (height << 16);
- if(delta > 0) {
- diff = (delta + vscale - 1)/ vscale;
- dst->y2 -= diff;
- *yb -= diff * vscale;
+ if (delta > 0) {
+ diff = ((delta * ydw) + ysw - 1) / ysw;
+ dst->y2 -= diff;
+ *yb -= (diff * ysw) / ydw;
}
- if(*ya >= *yb) return FALSE;
+ if (*ya >= *yb) return FALSE;
- if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
- (dst->y1 != extents->y1) || (dst->y2 != extents->y2))
+ 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);
+ RegionRec clipReg;
+ REGION_INIT(DummyScreen, &clipReg, dst, 1);
+ REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
+ REGION_UNINIT(DummyScreen, &clipReg);
}
return TRUE;
}
+void
+xf86XVCopyYUV12ToPacked(
+ const void *srcy,
+ const void *srcv,
+ const void *srcu,
+ void *dst,
+ int srcPitchy,
+ int srcPitchuv,
+ int dstPitch,
+ int h,
+ int w
+){
+ CARD32 *Dst;
+ const CARD8 *Y, *U, *V;
+ int i, j;
-/**************** Offscreen surface stuff *******************/
-
-typedef struct {
- XF86OffscreenImagePtr images;
- int num;
-} OffscreenImageRec;
+ w >>= 1;
+
+ for (j = 0; j < h; j++) {
+ Dst = dst;
+ Y = srcy; V = srcv; U = srcu;
+ i = w;
+ while (i >= 4) {
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24);
+ Dst[1] = Y[2] | (Y[3] << 16) | (U[1] << 8) | (V[1] << 24);
+ Dst[2] = Y[4] | (Y[5] << 16) | (U[2] << 8) | (V[2] << 24);
+ Dst[3] = Y[6] | (Y[7] << 16) | (U[3] << 8) | (V[3] << 24);
+#else
+ /* This assumes a little-endian framebuffer */
+ Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0];
+ Dst[1] = (Y[2] << 24) | (Y[3] << 8) | (U[1] << 16) | Y[1];
+ Dst[2] = (Y[4] << 24) | (Y[5] << 8) | (U[2] << 16) | Y[2];
+ Dst[3] = (Y[6] << 24) | (Y[7] << 8) | (U[3] << 16) | Y[3];
+#endif
+ Dst += 4; Y += 8; V += 4; U += 4;
+ i -= 4;
+ }
-static OffscreenImageRec OffscreenImages[MAXSCREENS];
-static Bool offscreenInited = FALSE;
+ while (i--) {
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24);
+#else
+ /* This assumes a little-endian framebuffer */
+ Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0];
+#endif
+ Dst++; Y += 2; V++; U++;
+ }
-Bool
-xf86XVRegisterOffscreenImages(
- ScreenPtr pScreen,
- XF86OffscreenImagePtr images,
- int num
-){
- if(!offscreenInited) {
- bzero(OffscreenImages, sizeof(OffscreenImages[MAXSCREENS]));
- offscreenInited = TRUE;
+ dst = (CARD8 *)dst + dstPitch;
+ srcy = (const CARD8 *)srcy + srcPitchy;
+ if (j & 1) {
+ srcu = (const CARD8 *)srcu + srcPitchuv;
+ srcv = (const CARD8 *)srcv + srcPitchuv;
+ }
}
-
- OffscreenImages[pScreen->myNum].num = num;
- OffscreenImages[pScreen->myNum].images = images;
-
- return TRUE;
}
-XF86OffscreenImagePtr
-xf86XVQueryOffscreenImages(
- ScreenPtr pScreen,
- int *num
+void
+xf86XVCopyPacked(
+ const void *src,
+ void *dst,
+ int srcPitch,
+ int dstPitch,
+ int h,
+ int w
){
- if(!offscreenInited) {
- *num = 0;
- return NULL;
- }
-
- *num = OffscreenImages[pScreen->myNum].num;
- return OffscreenImages[pScreen->myNum].images;
+ const CARD32 *Src;
+ CARD32 *Dst;
+ int i;
+
+ w >>= 1;
+ while (--h >= 0) {
+ do {
+ Dst = dst; Src = src;
+ i = w;
+ while (i >= 4) {
+ Dst[0] = Src[0];
+ Dst[1] = Src[1];
+ Dst[2] = Src[2];
+ Dst[3] = Src[3];
+ Dst += 4; Src += 4; i -= 4;
+ }
+ if (!i) break;
+ Dst[0] = Src[0];
+ if (i == 1) break;
+ Dst[1] = Src[1];
+ if (i == 2) break;
+ Dst[2] = Src[2];
+ } while (0);
+
+ src = (const CARD8 *)src + srcPitch;
+ dst = (CARD8 *)dst + dstPitch;
+ }
}
diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h
index 9fd6b4edf..316d6c9e5 100644
--- a/hw/xfree86/common/xf86xv.h
+++ b/hw/xfree86/common/xf86xv.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.23 2002/11/09 01:18:33 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.25 2003/08/24 17:36:56 dawes Exp $ */
+
+/*
+ * Copyright (c) 1998-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _XF86XV_H_
#define _XF86XV_H_
@@ -218,55 +245,27 @@ xf86XVClipVideoHelper(
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;
+void
+xf86XVCopyYUV12ToPacked(
+ const void *srcy,
+ const void *srcv,
+ const void *srcu,
+ void *dst,
+ int srcPitchy,
+ int srcPitchuv,
+ int dstPitch,
+ int h,
+ int w
+);
-typedef struct _XF86XVWindowRec{
- XvPortRecPrivatePtr PortRec;
- struct _XF86XVWindowRec *next;
-} XF86XVWindowRec, *XF86XVWindowPtr;
+void
+xf86XVCopyPacked(
+ const void *src,
+ void *dst,
+ int srcPitch,
+ int dstPitch,
+ int h,
+ int w
+);
#endif /* _XF86XV_H_ */
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
index 4559359ec..832861ea4 100644
--- a/hw/xfree86/common/xf86xvmc.c
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.3 2001/04/01 14:00:08 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.6 2003/10/08 22:31:59 mvojkovi Exp $ */
+
+/*
+ * Copyright (c) 2001-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "misc.h"
#include "xf86.h"
@@ -14,6 +41,7 @@
#include "xvmodproc.h"
#endif
+#include "xf86xvpriv.h"
#include "xf86xvmc.h"
#ifdef XFree86LOADER
@@ -199,3 +227,13 @@ Bool xf86XvMCScreenInit(
return TRUE;
}
+
+XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void)
+{
+ return xcalloc(1, sizeof(XF86MCAdaptorRec));
+}
+
+void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor)
+{
+ xfree(adaptor);
+}
diff --git a/hw/xfree86/common/xf86xvmc.h b/hw/xfree86/common/xf86xvmc.h
index 074edbebe..0b073aac8 100644
--- a/hw/xfree86/common/xf86xvmc.h
+++ b/hw/xfree86/common/xf86xvmc.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.5 2001/11/14 21:54:39 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.7 2003/10/08 22:31:59 mvojkovi Exp $ */
+
+/*
+ * 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _XF86XVMC_H
#define _XF86XVMC_H
@@ -131,4 +158,7 @@ Bool xf86XvMCScreenInit(
XF86MCAdaptorPtr *adaptors
);
+XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void);
+void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor);
+
#endif /* _XF86XVMC_H */
diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h
new file mode 100644
index 000000000..0d1efdafb
--- /dev/null
+++ b/hw/xfree86/common/xf86xvpriv.h
@@ -0,0 +1,86 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvpriv.h,v 1.2 2003/08/24 17:36:56 dawes Exp $ */
+
+/*
+ * Copyright (c) 2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+#ifndef _XF86XVPRIV_H_
+#define _XF86XVPRIV_H_
+
+#include "xf86xv.h"
+
+/*** 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 /* _XF86XVPRIV_H_ */
diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c
index 4132c7abf..facc27842 100644
--- a/hw/xfree86/common/xisb.c
+++ b/hw/xfree86/common/xisb.c
@@ -24,7 +24,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.6 2003/03/25 04:18:21 dawes Exp $ */
/*
X Input Serial Buffer routines for use in any XInput driver that accesses
@@ -36,6 +36,10 @@
* Standard Headers
****************************************************************************/
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
+
#include <misc.h>
#include <xf86.h>
#include <xf86Version.h>
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
index d779834c2..666dfc632 100644
--- a/hw/xfree86/ddc/ddcProperty.c
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -3,7 +3,7 @@
*
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.10 2003/11/03 05:11:04 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -100,10 +100,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
EDID1Atom, XA_INTEGER, 8,
128, (unsigned char *)EDID1rawdata
);
-#ifdef DEBUG
+ if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
-#endif
-
}
if (makeEDID2prop) {
@@ -127,9 +125,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
EDID2Atom, XA_INTEGER, 8,
256, (unsigned char *)EDID2rawdata
);
-#ifdef DEBUG
+ if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
-#endif
}
if (DDC->vdif) {
@@ -151,9 +148,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
strlen(VDIF_DUMMY_STRING),
VDIF_DUMMY_STRING
);
-#ifdef DEBUG
+ if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
-#endif
}
return TRUE;
diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
index 3451e52f6..064533800 100644
--- a/hw/xfree86/ddc/print_edid.c
+++ b/hw/xfree86/ddc/print_edid.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.15 2001/05/22 17:01:23 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.16 2003/09/24 02:43:17 dawes Exp $ */
/* print_edid.c: print out all information retrieved from display device
*
@@ -41,7 +41,7 @@ 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);
+ (char *)&c->name, c->prod_id, c->serial);
xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week);
}
diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c
index c65d1a0c9..fbb540e1d 100644
--- a/hw/xfree86/ddc/print_vdif.c
+++ b/hw/xfree86/ddc/print_vdif.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.3 2003/02/17 16:08:27 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
#include "vdif.h"
#include "misc.h"
diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h
index 38026e56a..8d358613e 100644
--- a/hw/xfree86/ddc/vdif.h
+++ b/hw/xfree86/ddc/vdif.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.3 2000/04/14 12:16:04 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
#ifndef _VDIF_H
#define _VDIF_H
@@ -24,7 +24,8 @@
#include "Xmd.h"
-#pragma pack(1)
+#undef CARD32
+#define CARD32 unsigned int /* ... on all supported platforms */
typedef struct _VDIF { /* Monitor Description: */
CARD8 VDIFId[4]; /* alway "VDIF" */
@@ -169,6 +170,6 @@ typedef struct _vdif {
char * strings;
} xf86vdif, *xf86vdifPtr;
-#pragma pack()
+#undef CARD32
#endif
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 736fb741b..496f3573f 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.23 2003/02/17 16:08:27 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.27 2003/10/30 17:48:19 tsi Exp $ */
/* xf86DDC.c
*
@@ -19,6 +19,7 @@ const char *i2cSymbols[] = {
"xf86CreateI2CDevRec",
"xf86I2CDevInit",
"xf86I2CWriteRead",
+ "xf86I2CFindDev",
"xf86DestroyI2CDevRec",
NULL
};
@@ -332,19 +333,22 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
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 (!(dev = xf86I2CFindDev(pBus, 0x00A0))) {
+ 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(scrnIndex, X_PROBED, "No DDC2 device\n");
+ return NULL;
+ }
}
if (start < 0x100) {
w_bytes = 1;
@@ -358,10 +362,9 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
* (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);
+ if (!DDC_checksum(R_Buffer,len))
return R_Buffer;
- }
+
#ifdef DEBUG
else ErrorF("Checksum error in EDID block\n");
#endif
@@ -375,5 +378,3 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
xfree(R_Buffer);
return NULL;
}
-
-
diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h
index 2b0118f15..a0108053c 100644
--- a/hw/xfree86/dixmods/extmod/dgaproc.h
+++ b/hw/xfree86/dixmods/extmod/dgaproc.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.21 2000/06/30 19:06:54 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.22 2003/07/16 01:38:29 dawes Exp $ */
#ifndef __DGAPROC_H
#define __DGAPROC_H
@@ -53,9 +53,6 @@ typedef struct {
int reserved2;
} XDGAModeRec, *XDGAModePtr;
-
-void XFree86DGAExtensionInit(void);
-
/* DDX interface */
int
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index d97b88fa4..dc76cbf21 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.16 2002/03/06 21:12:33 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.17 2003/07/16 01:38:33 dawes Exp $ */
/*
*
@@ -31,113 +31,9 @@
#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
+#include "modinit.h"
-#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
+static MODULESETUPPROTO(extmodSetup);
/*
* Array describing extensions to be initialized
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
new file mode 100644
index 000000000..cc717c31b
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -0,0 +1,144 @@
+/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.h,v 1.2 2003/09/13 21:33:04 dawes Exp $ */
+
+#ifndef INITARGS
+#define INITARGS void
+#endif
+
+#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
+
+#if 1
+extern void XTestExtension1Init(INITARGS);
+#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
+
+#ifdef SHM
+extern void ShmExtensionInit(INITARGS);
+#include "shmstr.h"
+extern void ShmSetPixmapFormat(
+ ScreenPtr pScreen,
+ int format);
+extern void ShmRegisterFuncs(
+ ScreenPtr pScreen,
+ ShmFuncsPtr funcs);
+#endif
+
+#if 1
+extern void SecurityExtensionInit(INITARGS);
+#endif
+
+#if 1
+extern void XagExtensionInit(INITARGS);
+#endif
+
+#if 1
+extern void XpExtensionInit(INITARGS);
+#endif
+
+#if 1
+extern void PanoramiXExtensionInit(int argc, char *argv[]);
+#endif
+
+#if 1
+extern void XkbExtensionInit(INITARGS);
+#endif
diff --git a/hw/xfree86/dixmods/extmod/xf86dga.c b/hw/xfree86/dixmods/extmod/xf86dga.c
index 9593c4a40..973f54e23 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.21 2000/06/30 19:06:54 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.22 2003/07/16 01:38:30 dawes Exp $ */
/*
@@ -24,6 +24,8 @@ Copyright (c) 1995, 1996, 1999 XFree86 Inc
#include "swaprep.h"
#include "dgaproc.h"
+#include "xf86dgaext.h"
+
static DISPATCH_PROC(ProcXF86DGADirectVideo);
static DISPATCH_PROC(ProcXF86DGAGetVidPage);
@@ -270,8 +272,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client)
}
int
-ProcXF86DGADispatch (client)
- register ClientPtr client;
+ProcXF86DGADispatch(register ClientPtr client)
{
REQUEST(xReq);
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
index c0d51b809..2556743bb 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -3,7 +3,7 @@
Written by Mark Vojkovich
*/
-/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.17 2001/10/28 03:32:51 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.18 2003/07/16 01:38:30 dawes Exp $ */
#define NEED_REPLIES
@@ -24,6 +24,7 @@
#include "xf86dgastr.h"
#include "swaprep.h"
#include "dgaproc.h"
+#include "xf86dgaext.h"
#ifdef EXTMODULE
#include "xf86_ansic.h"
@@ -31,6 +32,7 @@
#include <string.h>
#endif
+#include "modinit.h"
static DISPATCH_PROC(ProcXDGADispatch);
static DISPATCH_PROC(SProcXDGADispatch);
@@ -51,10 +53,6 @@ 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);
@@ -78,7 +76,7 @@ typedef struct {
#define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr)
void
-XFree86DGAExtensionInit(void)
+XFree86DGAExtensionInit(INITARGS)
{
ExtensionEntry* extEntry;
@@ -766,7 +764,7 @@ ProcXDGADispatch (ClientPtr client)
#ifdef EXTMODULE
void
-XFree86DGARegister()
+XFree86DGARegister(INITARGS)
{
XDGAEventBase = &DGAEventBase;
}
diff --git a/hw/xfree86/dixmods/extmod/xf86dgaext.h b/hw/xfree86/dixmods/extmod/xf86dgaext.h
new file mode 100644
index 000000000..831108399
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/xf86dgaext.h
@@ -0,0 +1,8 @@
+/* $XFree86: xc/programs/Xserver/Xext/xf86dgaext.h,v 1.1 2003/07/16 01:38:30 dawes Exp $ */
+
+#ifndef _XF86DGAEXT_H_
+#define _XF86DGAEXT_H_
+
+extern DISPATCH_PROC(ProcXF86DGADispatch);
+
+#endif /* _XF86DGAEXT_H_ */
diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c
index bc8e94b45..620761742 100644
--- a/hw/xfree86/dixmods/extmod/xf86misc.c
+++ b/hw/xfree86/dixmods/extmod/xf86misc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.37 2002/11/20 04:04:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.41 2003/11/17 22:20:27 dawes Exp $ */
/*
* Copyright (c) 1995, 1996 The XFree86 Project, Inc
@@ -54,9 +54,7 @@ typedef struct {
#define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr)
static void XF86MiscResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry* /* extEntry */
-#endif
);
static void
@@ -84,6 +82,7 @@ static DISPATCH_PROC(ProcXF86MiscSetMouseSettings);
static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState);
static DISPATCH_PROC(ProcXF86MiscSetClientVersion);
static DISPATCH_PROC(ProcXF86MiscGetFilePaths);
+static DISPATCH_PROC(ProcXF86MiscPassMessage);
#ifdef _XF86MISC_SAVER_COMPAT_
static DISPATCH_PROC(ProcXF86MiscGetSaver);
static DISPATCH_PROC(ProcXF86MiscSetSaver);
@@ -97,12 +96,15 @@ static DISPATCH_PROC(SProcXF86MiscSetMouseSettings);
static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState);
static DISPATCH_PROC(SProcXF86MiscSetClientVersion);
static DISPATCH_PROC(SProcXF86MiscGetFilePaths);
+static DISPATCH_PROC(SProcXF86MiscPassMessage);
#ifdef _XF86MISC_SAVER_COMPAT_
static DISPATCH_PROC(SProcXF86MiscGetSaver);
static DISPATCH_PROC(SProcXF86MiscSetSaver);
#endif
+#if 0
static unsigned char XF86MiscReqCode = 0;
+#endif
#ifdef DEBUG
# define DEBUG_P(x) ErrorF(x"\n");
@@ -148,7 +150,9 @@ XFree86MiscExtensionInit(void)
SProcXF86MiscDispatch,
XF86MiscResetProc,
StandardMinorOpcode))) {
+#if 0
XF86MiscReqCode = (unsigned char)extEntry->base;
+#endif
miscErrorBase = extEntry->errorBase;
}
}
@@ -354,14 +358,13 @@ ProcXF86MiscSetMouseSettings(client)
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);
+ (int)stuff->mousetype, (int)stuff->baudrate,
+ (int)stuff->samplerate, stuff->chordmiddle);
+ ErrorF(" em3but: %d em3tim: %d res: %d flags: %ld\n",
+ stuff->emulate3buttons, (int)stuff->emulate3timeout,
+ (int)stuff->resolution, (unsigned long)stuff->flags);
}
-
if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0)
return BadAlloc;
@@ -427,8 +430,8 @@ ProcXF86MiscSetKbdSettings(client)
if (xf86GetVerbosity() > 1)
ErrorF("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n",
- stuff->kbdtype, stuff->rate,
- stuff->delay, stuff->servnumlock);
+ (int)stuff->kbdtype, (int)stuff->rate,
+ (int)stuff->delay, stuff->servnumlock);
if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
return BadAlloc;
@@ -555,6 +558,59 @@ ProcXF86MiscGetFilePaths(client)
}
static int
+ProcXF86MiscPassMessage(client)
+ register ClientPtr client;
+{
+ xXF86MiscPassMessageReply rep;
+ char *msgtype, *msgval, *retstr;
+ int retval, size;
+ register int n;
+
+ REQUEST(xXF86MiscPassMessageReq);
+
+ DEBUG_P("XF86MiscPassMessage");
+
+ REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq);
+ size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2;
+ size+= (stuff->typelen + 3) >> 2;
+ size+= (stuff->vallen + 3) >> 2;
+ if (client->req_len < size)
+ return BadLength;
+ if (stuff->typelen) {
+ if (!(msgtype = xalloc(stuff->typelen)))
+ return BadAlloc;
+ strncpy(msgtype,(char*)(&stuff[1]),stuff->typelen);
+ } else return BadValue;
+ if (stuff->vallen) {
+ if (!(msgval = xalloc(stuff->vallen)))
+ return BadAlloc;
+ strncpy(msgval,(char*)(&stuff[1] + ((stuff->typelen + 3) & ~3)),
+ stuff->vallen);
+ } else return BadValue;
+
+ if ((retval= MiscExtPassMessage(stuff->screen,msgtype,msgval,&retstr)) != 0)
+ return retval;
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.mesglen = (retstr? strlen(retstr): 0);
+ rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) +
+ ((rep.mesglen + 3) & ~3)) >> 2;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.mesglen, n);
+ }
+ WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep);
+
+ if (rep.mesglen)
+ WriteToClient(client, rep.mesglen, (char *)retstr);
+
+ return (client->noClientException);
+}
+
+static int
ProcXF86MiscDispatch (client)
register ClientPtr client;
{
@@ -577,6 +633,8 @@ ProcXF86MiscDispatch (client)
return ProcXF86MiscSetClientVersion(client);
case X_XF86MiscGetFilePaths:
return ProcXF86MiscGetFilePaths(client);
+ case X_XF86MiscPassMessage:
+ return ProcXF86MiscPassMessage(client);
default:
if (!xf86GetModInDevEnabled())
return miscErrorBase + XF86MiscModInDevDisabled;
@@ -724,6 +782,17 @@ SProcXF86MiscGetFilePaths(client)
}
static int
+SProcXF86MiscPassMessage(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscPassMessageReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscPassMessageReq);
+ return ProcXF86MiscPassMessage(client);
+}
+
+static int
SProcXF86MiscDispatch (client)
register ClientPtr client;
{
@@ -746,6 +815,8 @@ SProcXF86MiscDispatch (client)
return SProcXF86MiscSetClientVersion(client);
case X_XF86MiscGetFilePaths:
return SProcXF86MiscGetFilePaths(client);
+ case X_XF86MiscPassMessage:
+ return SProcXF86MiscPassMessage(client);
default:
if (!xf86GetModInDevEnabled())
return miscErrorBase + XF86MiscModInDevDisabled;
diff --git a/hw/xfree86/dixmods/extmod/xf86miscproc.h b/hw/xfree86/dixmods/extmod/xf86miscproc.h
index 63db938d1..208260947 100644
--- a/hw/xfree86/dixmods/extmod/xf86miscproc.h
+++ b/hw/xfree86/dixmods/extmod/xf86miscproc.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.5 2002/11/20 04:04:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.6 2003/04/03 16:15:47 dawes Exp $ */
/* Prototypes for Pointer/Keyboard functions that the DDX must provide */
@@ -59,6 +59,8 @@ 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);
+int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval,
+ char **retstr);
#endif
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index f9882f2f1..a20d5659e 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.54 2002/12/22 00:46:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.59 2003/11/17 22:20:27 dawes Exp $ */
/*
@@ -64,9 +64,7 @@ typedef struct {
#define VMPRIV(c) ((c)->devPrivates[VidModeClientPrivateIndex].ptr)
static void XF86VidModeResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry* /* extEntry */
-#endif
);
static DISPATCH_PROC(ProcXF86VidModeDispatch);
@@ -112,7 +110,9 @@ static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
+#if 0
static unsigned char XF86VidModeReqCode = 0;
+#endif
/* The XF86VIDMODE_EVENTS code is far from complete */
@@ -217,7 +217,9 @@ XFree86VidModeExtensionInit(void)
SProcXF86VidModeDispatch,
XF86VidModeResetProc,
StandardMinorOpcode))) {
+#if 0
XF86VidModeReqCode = (unsigned char)extEntry->base;
+#endif
VidModeErrorBase = extEntry->errorBase;
#ifdef XF86VIDMODE_EVENTS
XF86VidModeEventBase = extEntry->eventBase;
@@ -467,14 +469,14 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
if (xf86GetVerbosity() > 1) {
- ErrorF("GetModeLine - scrn: %d clock: %d\n",
- stuff->screen, rep.dotclock);
+ ErrorF("GetModeLine - scrn: %d clock: %ld\n",
+ stuff->screen, (unsigned long)rep.dotclock);
ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
rep.hdisplay, rep.hsyncstart,
rep.hsyncend, rep.htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
rep.vdisplay, rep.vsyncstart, rep.vsyncend,
- rep.vtotal, rep.flags);
+ rep.vtotal, (unsigned long)rep.flags);
}
/*
@@ -675,22 +677,23 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
stuff->after_flags = oldstuff->after_flags;
}
if (xf86GetVerbosity() > 1) {
- ErrorF("AddModeLine - scrn: %d clock: %d\n",
- stuff->screen, stuff->dotclock);
+ ErrorF("AddModeLine - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, stuff->flags);
- ErrorF(" after - scrn: %d clock: %d\n",
- stuff->screen, stuff->after_dotclock);
+ stuff->vtotal, (unsigned long)stuff->flags);
+ ErrorF(" after - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->after_dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->after_hdisplay, stuff->after_hsyncstart,
stuff->after_hsyncend, stuff->after_htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->after_vdisplay, stuff->after_vsyncstart,
- stuff->after_vsyncend, stuff->after_vtotal, stuff->after_flags);
+ stuff->after_vsyncend, stuff->after_vtotal,
+ (unsigned long)stuff->after_flags);
}
if (ver < 2) {
@@ -742,6 +745,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
if (mode == NULL)
return BadValue;
+ VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock);
VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
@@ -821,14 +825,14 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
if (xf86GetVerbosity() > 1) {
- ErrorF("DeleteModeLine - scrn: %d clock: %d\n",
- stuff->screen, stuff->dotclock, stuff->dotclock);
+ ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, stuff->flags);
+ stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {
@@ -840,8 +844,11 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
}
if (len != stuff->privsize) {
if (xf86GetVerbosity() > 1) {
- ErrorF("req_len = %d, sizeof(Req) = %d, privsize = %d, len = %d, length = %d\n",
- client->req_len, sizeof(xXF86VidModeDeleteModeLineReq)>>2, stuff->privsize, len, stuff->length);
+ ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
+ "len = %d, length = %d\n",
+ (unsigned long)client->req_len,
+ (int)sizeof(xXF86VidModeDeleteModeLineReq)>>2,
+ (unsigned long)stuff->privsize, len, stuff->length);
}
return BadLength;
}
@@ -935,11 +942,11 @@ ProcXF86VidModeModModeLine(ClientPtr client)
}
if (xf86GetVerbosity() > 1) {
ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->screen, stuff->hdisplay, stuff->hsyncstart,
+ (int)stuff->screen, stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, stuff->flags);
+ stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {
@@ -989,18 +996,23 @@ ProcXF86VidModeModModeLine(ClientPtr client)
break;
case MODE_HSYNC:
case MODE_H_ILLEGAL:
+ xfree(modetmp);
return VidModeErrorBase + XF86VidModeBadHTimings;
case MODE_VSYNC:
case MODE_V_ILLEGAL:
+ xfree(modetmp);
return VidModeErrorBase + XF86VidModeBadVTimings;
default:
+ xfree(modetmp);
return VidModeErrorBase + XF86VidModeModeUnsuitable;
}
/* Check that the driver is happy with the mode */
if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) {
+ xfree(modetmp);
return VidModeErrorBase + XF86VidModeModeUnsuitable;
}
+ xfree(modetmp);
VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
@@ -1029,7 +1041,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
(xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
xXF86VidModeValidateModeLineReq newstuff;
xXF86VidModeValidateModeLineReply rep;
- pointer mode, modetmp;
+ pointer mode, modetmp = NULL;
int len, status, dotClock;
int ver;
@@ -1055,14 +1067,14 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
if (xf86GetVerbosity() > 1) {
- ErrorF("ValidateModeLine - scrn: %d clock: %d\n",
- stuff->screen, stuff->dotclock);
+ ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, stuff->flags);
+ stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {
@@ -1119,6 +1131,9 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
status = VidModeCheckModeForDriver(stuff->screen, modetmp);
status_reply:
+ if(modetmp)
+ xfree(modetmp);
+
rep.type = X_Reply;
rep.length = (SIZEOF(xXF86VidModeValidateModeLineReply)
- SIZEOF(xGenericReply)) >> 2;
@@ -1186,14 +1201,14 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
if (xf86GetVerbosity() > 1) {
- ErrorF("SwitchToMode - scrn: %d clock: %d\n",
- stuff->screen, stuff->dotclock);
+ ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, stuff->flags);
+ stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {
diff --git a/hw/xfree86/dixmods/ftmodule.c b/hw/xfree86/dixmods/ftmodule.c
index e44c94984..ceb5485c0 100644
--- a/hw/xfree86/dixmods/ftmodule.c
+++ b/hw/xfree86/dixmods/ftmodule.c
@@ -23,7 +23,7 @@
* 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 $ */
+/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.18 2003/11/02 04:30:57 dawes Exp $ */
#include "misc.h"
@@ -40,11 +40,11 @@ static MODULESETUPPROTO(freetypeSetup);
static XF86ModuleVersionInfo VersRec =
{
"freetype",
- MODULEVENDORSTRING,
+ MODULEVENDORSTRING " & the After X-TT Project",
MODINFOSTRING1,
MODINFOSTRING2,
XF86_VERSION_CURRENT,
- 2, 0, 2,
+ 2, 1, 0,
ABI_CLASS_FONT, /* Font module */
ABI_FONT_VERSION,
MOD_CLASS_FONT,
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
index 513bb7647..f449d55ec 100644
--- a/hw/xfree86/dixmods/glxmodule.c
+++ b/hw/xfree86/dixmods/glxmodule.c
@@ -25,7 +25,7 @@ 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 $ */
+/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.12 2003/09/28 20:15:40 alanh Exp $ */
/*
* Authors:
@@ -104,6 +104,7 @@ static const char *glcoreSymbols[] = {
"__glLightiv_size",
"__glMaterialfv_size",
"__glMaterialiv_size",
+ "__glPointParameterfvARB_size",
"__glReadPixels_size",
"__glTexEnvfv_size",
"__glTexEnviv_size",
@@ -146,6 +147,7 @@ static const char *glcoreSymbols[] = {
"__glXDestroyContext",
"__glXDestroyGLXPixmap",
"__glXDispSwap_Accum",
+ "__glXDispSwap_ActiveStencilFaceEXT",
"__glXDispSwap_ActiveTextureARB",
"__glXDispSwap_AlphaFunc",
"__glXDispSwap_AreTexturesResident",
@@ -357,6 +359,8 @@ static const char *glcoreSymbols[] = {
"__glXDispSwap_PixelTransferf",
"__glXDispSwap_PixelTransferi",
"__glXDispSwap_PixelZoom",
+ "__glXDispSwap_PointParameterfARB",
+ "__glXDispSwap_PointParameterfvARB",
"__glXDispSwap_PointSize",
"__glXDispSwap_PolygonMode",
"__glXDispSwap_PolygonOffset",
@@ -451,7 +455,9 @@ static const char *glcoreSymbols[] = {
"__glXDispSwap_Vertex4iv",
"__glXDispSwap_Vertex4sv",
"__glXDispSwap_Viewport",
+ "__glXDispSwap_WindowPos3fARB",
"__glXDisp_Accum",
+ "__glXDisp_ActiveStencilFaceEXT",
"__glXDisp_ActiveTextureARB",
"__glXDisp_AlphaFunc",
"__glXDisp_AreTexturesResident",
@@ -663,6 +669,8 @@ static const char *glcoreSymbols[] = {
"__glXDisp_PixelTransferf",
"__glXDisp_PixelTransferi",
"__glXDisp_PixelZoom",
+ "__glXDisp_PointParameterfARB",
+ "__glXDisp_PointParameterfvARB",
"__glXDisp_PointSize",
"__glXDisp_PolygonMode",
"__glXDisp_PolygonOffset",
@@ -757,6 +765,7 @@ static const char *glcoreSymbols[] = {
"__glXDisp_Vertex4iv",
"__glXDisp_Vertex4sv",
"__glXDisp_Viewport",
+ "__glXDisp_WindowPos3fARB",
"__glXDrawArraysSize",
"__glXDrawPixelsReqSize",
"__glXDrawableRes",
@@ -886,6 +895,7 @@ static const char *glcoreSymbols[] = {
"__glXWaitX",
"__glXcombine_strings",
"glAccum",
+ "glActiveStencilFaceEXT",
"glActiveTextureARB",
"glAlphaFunc",
"glAreTexturesResident",
@@ -1102,6 +1112,8 @@ static const char *glcoreSymbols[] = {
"glPixelTransferf",
"glPixelTransferi",
"glPixelZoom",
+ "glPointParameterfARB",
+ "glPointParameterfvARB",
"glPointSize",
"glPolygonMode",
"glPolygonOffset",
@@ -1198,6 +1210,7 @@ static const char *glcoreSymbols[] = {
"glVertex4sv",
"glVertexPointer",
"glViewport",
+ "glWindowPos3fARB",
"glxSwapQueryExtensionsStringReply",
"glxSwapQueryServerStringReply",
NULL
diff --git a/hw/xfree86/doc/README.DRI b/hw/xfree86/doc/README.DRI
index 66a5a5ff8..e663f2928 100644
--- a/hw/xfree86/doc/README.DRI
+++ b/hw/xfree86/doc/README.DRI
@@ -1251,7 +1251,7 @@ demo programs is available from http://dri.sourceforge.net/res.phtml
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 $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.29 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.21 2003/02/17 04:04:07 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.22 2003/07/15 02:28:28 dawes Exp $
diff --git a/hw/xfree86/doc/README.fonts b/hw/xfree86/doc/README.fonts
index fb1c1f5fb..7563c1c56 100644
--- a/hw/xfree86/doc/README.fonts
+++ b/hw/xfree86/doc/README.fonts
@@ -2,7 +2,7 @@
Juliusz Chroboczek, <jch@xfree86.org>
- 17 January 2003
+ 17 November 2003
1. Introduction
@@ -16,8 +16,8 @@ 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
+XFree86 includes two font systems: the core X11 fonts system, which is
+present 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
@@ -596,7 +596,7 @@ 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).
+described in more detail in X-TrueType (section 4.2.2, 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
@@ -926,75 +926,111 @@ 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.
+The FreeType (libfreetype-xtt2) 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
+4.2.1 About the FreeType backend
-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.
+The FreeType (libfreetype-xtt2) 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 the X-TT functionalities for CJKV
+support provided by the After X-TT Project (see the After X-TT Project web
+site <URL:http://x-tt.sourceforge.jp/>). The FreeType module 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'), Open-
+Type font files (`*.otf'), TrueType Collections (`*.ttc'), OpenType Collec-
+tions (`*.otc') and Type 1 font files (`*.pfa' and `*.pfb').
-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
+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 a pair of
+colons, or by setting the 'fn' TTCap option. For example,
- -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+ :1:mincho.ttc -misc-pmincho-medium-r-normal--0-0-0-0-p-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.
+refers to face 1 in the `mincho.ttc' TrueType Collection file.
-4.2.2 About the FreeType backend
+The new FreeType backend supports the extended `fonts.dir' syntax introduced
+by X-TrueType with a number of options, collectively known as `TTCap'. A
+`TTCap' entry follows the general syntax
-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').
+ option=value:
-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,
+and should be specified before the filename. The new FreeType almost per-
+fectly supports TTCap options that are compatible with X-TT 1.4. The Auto-
+matic Italic (`ai'), Double Strike (`ds') and Bounding box Width (`bw')
+options are indispensable in CJKV. For example,
- :2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+ mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+ ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+ ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0208.1990-0
+ ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0208.1990-0
+ bw=0.5:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
+ bw=0.5:ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0201.1976-0
+ bw=0.5:ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0201.1976-0
+ bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0
-refers to face 2 in the `mincho.ttc' TrueType Collection file.
+setup the complete combination of jisx0208 and jisx0201 using mincho.ttc
+only. More information on the TTCap syntax is found on the After X-TT
+Project page <URL:http://x-tt.sourceforge.jp/>.
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
+4.2.2 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
+ings, but instead uses its own database of encodings. Since the functionali-
+ties for CJKV support introduced by X-TT have been merged into the new
+FreeType backend, the X-TT backend will be removed from XFree86's tree near
+the future. Therefore, the use of FreeType backend is preferred over the X-
+TT backend. General information on X-TrueType may be found at ."
+
+4.2.3 Delayed glyph rasterisation
+
+When loading a large character set, the old FreeType delayed glyph rasterisa-
+tion until the time at which the glyph was first used. The new FreeType
+(libfreetype-xtt2) has an improved `very lazy' metric calculation method to
+speed up the process when loading TrueType or OpenType fonts. Although the
+X-TT module also has this method, the "vl=y" TTCap option must be set if you
+want to use it. This is the default method for FreeType when it loads multi-
+byte fonts. Even if you use a unicode font which has tens of thousands of
+glyphs, this delay will not be worrisome as long as you use the new FreeType
+backend -- its `very lazy' method is super-fast.
+
+The maximum error of bitmap position using `very lazy' method is 1 pixel, and
+is the same as that of a character-cell spacing. When the X-TT backend is
+used with the `vl=y' option, a chipped bitmap is displayed with certain
+fonts. However, the new FreeType backend has minimal problem with this,
+since it corrects left- and right-side bearings using `italicAngle' in the
+TrueType/OpenType post table, and does automatic correction of bitmap posi-
+tions when rasterisation so that chipped bitmaps are not displayed. Never-
+theless if you don't want to use the `very lazy' method when using multi-
+bytes fonts, set `vl=n' in the TTCap option to disable it:
+
+ vl=n:luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1
+
+Of course, both backends also support an optimisation for character-cell
+fonts (fonts with all glyph metrics equal, or terminal fonts). A font with
+an XLFD specifying a character-cell spacing `c', as in
- :option=value:
-
-and should be specified before the filename.
+ -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
-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:
+or
- :fn=2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+ fs=c:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-p-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/>.
+will not compute the metric for each glyph, but instead trust the font 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.
5. Appendix: background and terminology
@@ -1126,8 +1162,8 @@ 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/>.
+The documentation of X-TrueType is available from the After X-TT Project page
+<URL:http://x-tt.sourceforge.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/>.
@@ -1140,7 +1176,7 @@ 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 $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.22 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.22 2003/01/20 04:10:01 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.26 2003/11/19 01:44:58 dawes Exp $
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG b/hw/xfree86/doc/changelogs/CHANGELOG
index 732330eec..78f7f2e84 100644
--- a/hw/xfree86/doc/changelogs/CHANGELOG
+++ b/hw/xfree86/doc/changelogs/CHANGELOG
@@ -1,46 +1,1696 @@
-XFree86 4.3.0.2 (xx May 2003)
+XFree86 4.3.99.17 (xx November 2003)
+
+XFree86 4.3.99.16 (20 November 2003)
+ 609. Fix 'constype' for modern framebuffers on Solaris (Bugzilla #890,
+ Alan Coopersmith).
+ 608. Fix a thread deadlock problem in libXp (Bugzilla #887, Roland Mainz).
+ 607. Fix event buffer overrun in the wacom driver (Bugzilla #882, David Dawes,
+ reported by Jonathan Hough).
+ 606. Add unmapping code to DGAUnmapPhysical() for most systems that use
+ mmap(). Without this lots of map/unmap calls would result in running
+ out of address space and/or file handles (Bugzilla #880, David Dawes,
+ reported by Eckhard Neber).
+ 605. Restore the Windows keycodes in the 'xfree86' XKB keycodes map,
+ and add the Solaris-compatible tokens as aliases (reported by
+ Panagiotis Papadakos).
+ 604. Fix some problems building against external installations of
+ freetype2 (David Dawes).
+ 603. Add font bounds checking to the X server side of the font server
+ interface (Chisato Yamauchi, David Dawes).
+ 602. Fix ForcePCIMode option to work as advertised in Radeon driver
+ (Bugzilla #850, Kevin Martin).
+ 601. Update the fonts document for the FreeType backend changes
+ (Chisato Yamauchi, Reiko Nakajima, After X-TT Project).
+ 600. Don't allow the lack of "SUPERSCRIPT TWO" to prevent Adobe Standard
+ Cyrillic encoded fonts from being accepted as "koi8" capable
+ (Michail Vidiassov).
+ 599. Xvfb didn't have enough pixmap formats for Render (David Dawes).
+ 598. Fix the processing of xdm/config/Xres.cpp, which is broken with
+ gcc 3.3.2 (reported by Chisato Yamauchi).
+ 597. Fix two problems with Xvfb:
+ - Too much memory was allocated because of a confusion between
+ bytes and pixels.
+ - The XWD header was corrupted at server reset.
+ (David Dawes).
+ 596. Fix several problems xwud has displaying TrueColor dumps (extreme
+ slowness displaying on TrueColor visuals, and incorrectness displaying
+ on DirectColor visuals) (David Dawes).
+ 595. Rank TrueColor above DirectColor in xwud. This avoids colourmap flashing
+ by default when running on a server with both visuals available
+ (David Dawes).
+ 594. Build with Xplugin support by default on Panther (Torrey T. Lyons).
+ 593. On Mac OS X, allow "X -version" to work without connecting to
+ CoreGraphics (Torrey T. Lyons, reported by Benjamin Reed).
+ 592. Don't optimize away window restacks in rootless mode (John Harper).
+ 591. Fix problems preventing mesa-based GLX from working with Xnest, even
+ though it is linked in and advertised (David Dawes).
+ 590. Fix typing in XDarwin Preference panel going to X11 (Torrey T. Lyons).
+ 589. Fix rootless build after REGION_* macro rework (Torrey T. Lyons).
+ 588. Fix broken GLX indirect rendering (David Dawes).
+ 587. Fix the XKB definitions for the "Hiragana_Katakana" key, and fix
+ some incorrect definitions in symbols/jp (Chisato Yamauchi).
+ 586. Change the mkfontdir wrapper script to invoke mkfontscale via its full
+ path name (Chisato Yamauchi).
+ 585. Modify xf86config and xf86cfg to enable loading the "freetype" module
+ (Chisato Yamauchi).
+ 584. Wrap ucs2any with ProgramTargetName in dependencies, as needed for
+ OS/2, and note that OS/2 doesn't have basename(3) (Bugzilla #871,
+ Frank Giessler).
+ 583. Fix atimisc's decoding of the mode on input for large panels
+ (Marc La France).
+ 582. Fix SEGV when ATIPreinit() fails (Marc La France).
+ 581. In rootless XDarwin, don't send ButtonPress events when clicking in
+ non-X11 windows (Torrey T. Lyons, John Harper).
+ 580. AppleWM compatibility fixes:
+ - Disable XDarwin handling cut and paste if AppleWM-aware cut and
+ paste manager is available.
+ - Set _NATIVE_SCREEN_ORIGIN property on root window.
+ (John Harper, Torrey T. Lyons).
+ 579. Change ProjectRoot from /XFree86 to /usr/X11R6 on OS/2 (Bugzilla #865,
+ Frank Giessler).
+ 578. Fix building of new Mesa on OS/2 (Bugzilla #865, Frank Giessler).
+ 577. Change the way how libraries with long file names are handed on
+ OS/2 (Bugzilla #865, Frank Giessler).
+ 576. Force screen blanking when entering DPMS states (Bugzilla #866,
+ David Dawes, reported by Ed Fardos).
+ 575. XDarwin fixes/cleanups:
+ - Handle X11 executables opened from the Finder.
+ - Use xcodebuild instead of pbxbuild on Panther.
+ - Clean up Darwin specific imake #defines.
+ - Fix compiler warnings on Panther.
+ (Torrey T. Lyons).
+ 574. A workaround for platforms (like *BSD) where IPv6 sockets don't accept
+ IPv4 connections: disable IPv6 XDMCP code by default. This allows IPv4
+ XDMCP to work on such platforms (David Dawes).
+ 573. Rework REGION_* macros to eliminate NEED_SCREEN_REGIONS build failures
+ (Marc La France).
+ 572. Fix an old bug in the X server and xfs related to usage of
+ c->savedName (Bugzilla #818, Owen Taylor).
+ 571. Fix FontFileListOneFontWithInfo() so that it handles aliases in the
+ same was as FontFileOpenFont() (Bugzilla #818, Owen Taylor).
+ 570. Respect USE_SSE_ASM for the .S files in the r200 and radeon 3D drivers.
+ This should fix the reported OpenBSD build problem (David Dawes).
+ 569. Some missing FreeBSD AMD64/Sparc64 patches (Bugzilla #786, Eric Anholt).
+ 568. The call to xf86RandRSetMode() from xf86RandRCreateScreenResources()
+ doesn't appear to be necessary. Removing it restores the documented
+ ViewPort behaviour when RandR is enabled (David Dawes).
+ 567. Make the vesa driver blank the screen during initialisation for
+ cosmetic reasons (David Dawes).
+ 566. Make the cirrus driver blank the screen during initialisation for
+ cosmetic reaons (most other drivers do this) (Bugzilla #781,
+ Nicholas Miell).
+ 565. The vesa driver wasn't setting the viewport correctly either at
+ ScreenInit or EnterVT (David Dawes).
+ 564. Fix the viewport initialisation. The ViewPort parameters from the
+ XF86Config file were being ignored, and the default was a 0,0 viewport
+ rather than centred on the virtual screen as documented. When RandR
+ is enabled, it undoes all of this though... (David Dawes).
+ 563. Fix an off-by-one bug in libXcursor that can result in segfaulting
+ applications (David Dawes, reported by Agustin Gianni).
+ 562. Fix RandR initialization problem when default screen resolution is
+ different from the virtual resolution. (Bugzilla #853, Bob Paauwe).
+ 561. Fix an Xv problem with the via driver where updating a portion of the
+ overlay causes excessive CPU usage (Bugzilla #821, Neil Terry).
+ 560. Fix an Xnest hang on OS/2 (Bugzilla #852, Frank Giessler).
+ 559. OS/2 update for the recent move to building most libraries shared,
+ and add some functions to the export lists for freetype and Xt for
+ compatibility with older applications (Bugzilla #852, Frank Giessler).
+ 558. Fix the installation location of the XRes and Xss manpage aliases
+ (Bugzilla #848, ISHIKAWA Mutsumi).
+ 557. Include backwards compatibility API for renamed stream functions in
+ Freetype2 library (Torrey T. Lyons).
+ 556. Fix acecad driver to call xf86DeleteInput() (Bugzilla #855, S. Voltz).
+ 555. Register to handle X11 executables on Panther (John Harper).
+ 554. Fixes for GLX on Mac OS X:
+ - Make libGL not export libGLU symbols.
+ - Fix uninitialized mutex for threaded direct GLX.
+ (John Harper).
+ 553. Fix "Non-aligned pointer being freed" warnings on XDarwin startup
+ (Torrey T. Lyons).
+ 552. Miscellaneous fixes for Panther:
+ - Fix spurious #pragma getting inserted by cpp (Martin Costabel).
+ - Fix startup failure due to bad keymapping file (Torrey T. Lyons).
+ - Fix startup warning about missing semicolons (Torrey T. Lyons).
+ 551. Mesa X86 asm build fix for Solaris (David Dawes).
+ 550. Fix building libOSMesa on Darwin (Torrey T. Lyons).
+ 549. Get backlight working on Apple's GeForce4 powerbooks (Guido Guenther).
+
+XFree86 4.3.99.15 ( 1 November 2003)
+ 548. Update libfreetype-xtt2 to version 1.1:
+ - Improved the very lazy method. To prevent displaying chipped bitmap
+ when having italic angle, the lsb and rsb are adjusted by using
+ italicAngle in post table.
+ - Added automatic correction of bitmap position for preventing
+ displaying chipped bitmap when using charcell or very lazy method.
+ - Set DEFAULT_VERY_LAZY macro. If post table is available, the very
+ lazy method is used as default when handling multi-bytes fonts.
+ - Added additional glyphs(0x2d21-0x2d7c) to jisx0208.1990-0.enc.
+ (Chisato Yamauchi, After X-TT Project).
+ 547. Set the pixel clock limit above which hzoom is enabled for the video
+ overlay for G450 and G550 cards to 234MHz. This fixes a problem with
+ the Xv support having half horizontal resolution (Michel Lespinasse).
+ 546. Add support on Mac OS X for building keymap using Carbon Keyboard
+ Layout API (John Harper).
+ 545. Map holes in kdrive VESA driver (#5436, Juliusz Chroboczek).
+ 544. Add option to Radeon driver to allow minimum dot clock to be
+ overridden (Bugzilla #831, Nils Philippsen).
+ 543. Add shared libraries run-path information to pkg-config datafiles
+ provided for some libraries. (Bugzilla #832, Frederick Bruckman,
+ Matthieu Herrb).
+ 542. Fix buglets detected by SGI compiler in neomagic, sis and tseng drivers
+ (Marc La France).
+ 541. Fix I/O alignment in mga and via drivers (Marc La France).
+ 540. Improve xkbcomp's key types auto-recognition (Ivan Pascal).
+ 539. Add support for multi-threaded direct GLX rendering with AppleDRI
+ (John Harper).
+ 538. Fix a problem in Xlib that was cause by the ANSI prototype cleanups
+ (Bugzilla #839, Owen Taylor).
+ 537. Limit the rate of duplicate audit messages in the X server. (Matthieu
+ Herrb, David Dawes).
+ 536. Fix ChipValidMode() return type (Marc La France).
+ 535. Fix for AGP8x support on HP zx1-based systems (Marc La France).
+ 534. Workaround for mysterious segfault related to mkfontscale's use of
+ memcmp() (Marc La France).
+ 533. Support the new Linear allocator in the trident driver and make the
+ hardware cursor use it. Xv automagically uses it. (Alan Hourihane).
+ 532. Fix acecad input driver build and re-enable it
+ (Bugzilla #816, Alan Hourihane).
+ 531. Fix DRM_CAS on ia64 as used by the DRI (Bugzilla #778, John Dennis).
+ 530. Call OsCleanup() at the end of each server generation, and add an
+ argument to indicate when the server is terminating. This allows
+ misc end-of-generation cleanups to be added to OsCleanup() (David Dawes).
+ 529. Explicitly free the DPMS and ScreenSaver timer resources at the end
+ of each server generation (David Dawes).
+ 528. Cygwin configuration updates and install script updates (Bugzilla #799,
+ 805, Harold L Hunt II, Alexander Gottwald)
+ 527. Build shared libraries for Xt and Xaw on Cygwin. (Bugzilla #804,
+ Ralf Habacker).
+ 526. Xterm patches #180, 181 (Thomas Dickey).
+ 525. Update libfreetype-xtt2 to version 1.0d:
+ - Fixed server crash caused by loading fonts for which encoding file
+ does not exist.
+ - Some fixes for minor bugs when handling errors.
+ - Some minor cleanups.
+ (Chisato Yamauchi, After X-TT Project).
+ 524. Export strl{cat,cpy} functions to the server modules and provide
+ an implementation for the systems that don't have them. (Matthieu
+ Herrb).
+ 523. Fixes and updates for XKB keyboard maps:
+ - Update Serbian layouts (Bugzilla #92, Danilo Segan).
+ - Add 'MS Windows like' US International variant for 'us' keymap (Ivan
+ Pascal).
+ - Change CapsLock default behavior to 'Caps acts as locking Shift,
+ Shift cancels Caps'. Add new type for four-level keys (Ivan Pascal).
+ 522. Fix generic rootless code bug which tests CopyWindow instead of CopyBytes
+ (Kensuke Matsuzaki).
+ 521. Update libfreetype-xtt2 to version 1.0c. This consists of some minor
+ fixes and cleanups (Chisato Yamauchi, After X-TT Project).
+ 520. Add accelerated rootless drawing support and fix bug in rootless
+ FillSpans (Torrey T. Lyons and John Harper).
+ 519. Update SiS driver:
+ - Merge 661/741/760 support
+ - Clean up
+ - Fix Xv problems after swsuspend
+ - Fix LCD-via-CRT1 on various machines
+ 518. Prevent some compilers from optimising out Mesa's X11 error interface
+ (Marc La France).
+ 517. Add rules to generate post-processed and assembler source from C++ files
+ (Marc La France).
+ 516. Change `make World` so that well it interrupts itself to build a utility
+ (makedepend, pswrap, etc), it only builds that utility. Some things were
+ being built too early (Marc La France).
+ 515. When the i830 driver's checks for sufficient memory for tiled mode
+ fail, don't later try to allocate with tiling enabled (David Dawes).
+ 514. Enable I845G_VBE_WORKAROUND in the i830 driver for all platforms, since
+ this reportedly fixes VT switching problems on hardware other than the
+ 845G.
+ 513. Updated README.SiS (Thomas Winischhofer).
+ 512. Add the After X-TT Project's libfreetype-xtt2 1.0b fixes and
+ enhancements to the "freetype" module (Chisato Yamauchi,
+ After X-TT Project). This should make it possible to deprecate the
+ "xtt" module in a future release. Fixes and enhancements include:
+ - Fixed crash caused by using fonts which have OS2 sfnt table.
+ - Corrected metrics calculation error. Although the original code uses
+ size->metrics, the FT_Size_Metrics does not have exact values when
+ handling the outline. So the codes for metrics calculation were
+ drastically rewritten.
+ - Fixed some problems with FreeTypeRasteriseGlyph():
+ + Made "only metrics is required" distinct from "both metrics and
+ rasterised bitmap are required" to improve performance when
+ loading large charset.
+ + Fixed the erroneous usage of freetype2 API. To get valid metrics,
+ FT_Outline_Get_BBox() or FT_Outline_Get_CBox() is used for outline.
+ + Took the strange code for raster copying and rewrote it.
+ - Fixed UNDERLINE_POSITION so that it counts downwards.
+ - Fixed a risky calculational method for info->maxbound and
+ info->minbound when spacing is not charcell. All glyphs' metrics are
+ calculated and valid info->maxbounds and info->minbounds are set
+ without cutting any corners.
+ - Added TTCap option "fn","ai","ds","fs","vl","cr","bw","eb","hi",
+ "fc" and "fm" which are compatible with X-TT 1.4.
+ - Supported character width for vertical layouts.
+ 511. Encoding file updates (After X-TT Project):
+ - Removed jisx0208.1983-0.enc and added 'ALIAS jisx0208.1983-0' to
+ jisx0208.1990-0.enc.
+ - Added Windows ucs2 cmap(3,1) to jisx0208.1990-0.enc and
+ jisx0201.1976-0.enc.
+ - Added files for GB18030-0 and GB18030-1 (James Su).
+ 510. Update X-TrueType (X-TT) to version 1.4.2 (Chisato Yamauchi,
+ After X-TT Project):
+ - Fixed several bugs of make_up_italic_bitmap() function.
+ - Changed the order of priority of mapIDRelations in JISX0208 and
+ JISX0201 code converter. The windows ucs2 is given the highest
+ priority for kochi-substitute Japanese fonts.
+ - Fixed code relation in cc_jisx0208_to_std_ucs2() function
+ (not 0x215d -> 0x00b1 but 0x215d -> 0x2212)
+ - Added minor improvements.
+ 509. Fixes and updates for HTML and PDF versions of spec docs for
+ installation and inclusion in the online docs (David Dawes).
+ 508. Implement SharedLibtoolLibraryTarget, etc for bsdLib/ELF, including
+ creating links for older but compatible revisions of such
+ libraries (David Dawes).
+ 507. Allow a simple form of option name aliasing for options handled
+ via OptionInfoRec (David Dawes).
+ 506. Add optimized code for RENDER with rootless XDarwin (John Harper,
+ Torrey T. Lyons).
+ 505. Declare LoadPalette, SetOverscan and DPMSSet as public functions through
+ the XFree86's ScrnInfoRec, so these functions can be wrapped.
+ (Alan Hourihane).
+ 504. XDarwin improvements:
+ - Add complete server side support for AppleWM with xpr.
+ - Allow Aqua and X11 windows to interleave when AppleWM-aware window
+ manager is present.
+ - Fix hang on server reset.
+ (Torrey T. Lyons, John Harper).
+ 503. Fix double-free at server regeneration in the screensave/DPMS timer
+ code (David Dawes).
+ 502. Build most libraries as shared by default. (Matthieu Herrb,
+ David Dawes).
+ 501. Add missing symbol definition files for libraries (Matthieu Herrb).
+ 500. Add 'inet' keymaps for two Logitec keyboard models (Bugzilla #762,
+ Eric Mountain; Bugzilla #766, Chris Hornbaker) and cleanup Logitec
+ keymaps (Ivan Pascal).
+ 499. Add missing SetScreenSaverTimer() to ProcSetScreenSaver (Ivan Pascal).
+ 498. Fix building on Mac OS X after DRI merge (Torrey T. Lyons).
+
+XFree86 4.3.99.14 (10 October 2003)
+ 497. Add an xf86InitFBManagerLinear() function and implement the Linear
+ allocation routines. These still fallback to XY area allocation if
+ no (or the lack of) linear space is available. It assumes the driver
+ has already called one of the init routines to the FBManager for Areas
+ before this new setup can be used (Alan Hourihane).
+ 496. Added USB keyboard support for Solaris/x86 platform (Bugzilla #352,
+ Daniel Rock).
+ 495. i830/i810 driver:
+ * Added Christian Ziez's code to tweak BIOS image to convince chipset of
+ resized video RAM.
+ * Fixed viewport/video overlay window alignment issues.
+ * Fixed calculation of video overlay memory size.
+ * Fixed video overlay on TV out (Bugzilla #213). (Egbert Eich).
+ 494. Fixed mode setting in trident driver: use mode passed in function
+ argument, not value in currentMode (Bugzilla #197, Egbert Eich).
+ 493. Added delay when writing to Glint PM2 ramdac to avoid lockups
+ (Egbert Eich).
+ 492. Fixed bug in Glint Bresenham line fallback code that caused line be drawn
+ beyond framebuffer boundaries (Bugzilla #624, Egbert Eich).
+ 490. Force sane pallette when entering DGA mode in Matrox driver
+ (Egbert Eich).
+ 489. ATI Rage128: Wait with modifying FP video mode according to BIOS values
+ until final call of ValidMode() to prevent modes from being rejected
+ (Bugzilla #661, Egbert Eich).
+ 488. Some Savage BIOSes turn on clock doubling on non-doubled modes.
+ Added code that catches and fixes this situation (Egbert Eich).
+ 487. Tdfx driver: Fixed order of initialization/deinitialization in
+ ScreenInit()/ CloseScreen().
+ Fixed texture video support, removed artefacts in last line of overlay
+ video support (Bugzilla #299). (Egbert Eich).
+ 486. Add "automatic configuration" support for the XFree86 server, allowing
+ it to be started in a useful way without an XF86Config file.
+ - Add support to the config file parser for processing internally
+ supplied configuration data.
+ - Modify the algorithm for finding core input devices to maximise the
+ likelihood that they will be found.
+ - Add a FindDevice function to the OSMouse interface, allowing
+ an OS-specific function to be called to find the mouse device when
+ none is specified in the configuration. Implementations included for
+ Linux and FreeBSD.
+ - Add a GuessProtocol function to the OSMouse interface, allowing
+ an OS-specific function to be called as a fallback when the mouse
+ protocol can't otherwise be detected. Implementation included for
+ Linux.
+ - Bump the OSMouse interface version to 1.1 with the addition of the
+ above two functions.
+ - An interface for calling an external utility "getconfig" to generate
+ some configuration data. Implementation of getconfig included.
+ - Generate a default internal configuration, autodetecting as much
+ as possible, with reasonable fallbacks.
+ - Recognise "DefaultDepth" and "DefaultFbbpp" options in the Device
+ section.
+ - Add a "TargetRefreshRate" option to help prevent modes with too
+ high a resolution (and poor refresh rate) being used as the default.
+ - Use DDC-probed mode timings to estimate the monitor parameters when
+ the DDC-probed information doesn't include a DS_RANGES property.
+ This should improve the reliability of monitor auto-detection.
+ (David Dawes, X-Oz Technologies).
+ 485. Add functions for checking option values without marking them as "used"
+ (David Dawes).
+ 484. Add missing xf86ReplaceRealOption() function (David Dawes).
+ 483. Added support for Siliconmotion Cougar3DR chip (Bugzilla #754,
+ Chris Edgington).
+ 482. Cygwin:
+ * Added another German keyboard layout.
+ * Added Japanese keyboard layout to the list of defaults as jp.
+ * Added a new default keyboard layout for Portuguese (Brazil, ABNT2).
+ * Print the layout number in hexadecimal.
+ * Display the argument to the -query option in the window title.
+ (Bugzilla #763, Alexander Gottwald)
+ 481. Add processing for WM_WINDOWPOSCHANGED to cause window to repaint when
+ using TweakUI's focus-follows-mouse behavior. (Bugzilla #763,
+ Harold L Hunt II)
+ 480. Added runtime detection of SHM support by checking the return value of
+ shmget to the SHM and xf86BIGFONT extension to support SHM on Cygwin
+ (Bugzilla #764, Harold L Hunt II).
+ 479. Adding O_BINARY flag when opening an xkm file if this flag is defined
+ (Bugzilla #768, Alexander Gottwald).
+ 478. Radeon driver fixes (Hui Yu@ATI)
+ - 9200 DVI fix and TMDS_PLL initialization for all chips
+ - New chips support (9800XT/SE, 9600XT/SE, M11, T2/X2 etc.)
+ - Cleanup unused/secondary chip ids
+ - Autodetect PCI cards
+ - Add BusType to override PCI card autodetect
+ - Add display bandwidth calculation routine to fix flickering/tearing
+ display problem
+ - Workaround for corrupted BIOS image causing incorrect panel size
+ - Fix the LCD table reading loop
+ - Various small changes (including improving DDC reliability and
+ CRTC_MORE_CNTL initialization)
+ 477. Fix XAA Color8x8 cache bug:
+ Pattern was expanded from source instead of destination
+ (Thomas Winischhofer)
+ 476. Fixes and updates for XKB keyboard maps:
+ - Add 'United Kingdom w/deadkeys' gb(intl) keymap (Bugzilla #744,
+ Phil Jones).
+ - Add multi_layout compliant 'us_intl' keymap (Ivan Pascal).
+ - Fix 'macintosh' geometry file (Bugzilla #753, Simon Vallet).
+ 475. APM driver:
+ . improved clock parameter calculation.
+ . Fixed order of initialization of cursor.
+ . Fixed restauration of graphical text mode.
+ . Added YUY2 video format.
+ . Corrected accel framebuffer pitches and max screen height
+ (Bugzilla #528, Egbert Eich).
+ 474. Moved DisableMMIO() out of the unmap() function, added call to
+ EnableMMIO() to EnterVT() to work around lockup problems when
+ switching between two Xserver (Bugzilla #748, Egbert Eich).
+ 473. Fixed problem with text widget in Xaw when widget has a different
+ depth than the default visual (Bugzilla #745, Wolfram Gloger).
+ 472. Fixed Sig11 when calling X -query with no ipv6 support in kernel
+ (Bugzilla #737, Egbert Eich).
+ 471. Added support for Sparc64 and AMD64 on FreeBSD.
+ This patch also disables warnings from system headers, fixes some elf
+ relocations also relevant for other platforms and disables translation of
+ KEY_SysReqest and KEY_Break on sparc64. (Bugzilla #739, Eric Anholt).
+ 470. Switched VIA video driver to fillkey helper function (Bugzilla #525,
+ Alan Cox).
+ 469. Fixed CRT modes > FP panel size for siliconmotion (Bugzilla #727,
+ Hugues Fournier).
+ 468. Fixed xedit coredumps: update counter of free objects when getting an
+ object from the list (Bugzilla #722, Egbert Eich).
+ 467. Fixed definition of UseInstalledOnCrossCompile so that it never is
+ undefined (Harlod L. Hunt II).
+ 466. Add the 'b' flag to fopen() when opening binary xkm files. This is
+ irrelevant for *nix OSes, but required for Cygwin. (Bugzilla #689,
+ Harold L Hunt II).
+ 465. Cygwin:
+ * MultiWindow Mode: Automatically validate the size of windows that are
+ being resized. (Earle F. Philhower III)
+ * Safely shutdown the MultiWindow Mode and Clipboard Manager threads on
+ server shutdown. (Earle F. Philhower III)
+ * MultiWindow Mode - Fix a crash from a string copy bug.
+ (Earle F. Philhower III)
+ * Add lots of defaults for keyboardlayout. (Alexander Gottwald)
+ * Add a system tha allows arbitrary commands to be added to the tray menu
+ icon. (Earle F. Philhower III)
+ * Print the name of the keyboardlayout to aid in adding more layouts.
+ (Alexander Gottwald)
+ * Stop printing the IDirectDrawSurface4_Blt() failure messages after 10
+ times. (Harold L Hunt II)
+ * Disable check for pc105 keyboard and just assume that it is present.
+ This check was causing problems with certain keyboard drivers that
+ failed to report that a pc105 keyboard was present.
+ (Alexander Gottwald)
+ * MultiWindow Mode - Add handling for WM_CHANGE_STATE IconicState
+ messages;
+ minimize the associated Windows window when these messages are
+ received. (Harold L Hunt II).
+ Submitted: (Bugzilla #704, Harold L. Hunt).
+ 464. cygwin.cf:
+ * removed BuildDPS flag.
+ * Changed Alloca flag as Cygwin 1.5.x supports alloca, now.
+ * Use external expat package by default.
+ * Changed XawI18nDefines to utilize improved wide char support in
+ Cygwin 1.5.x. (Bugzilla #699, Harold L. Hunt II).
+ 463. Fixed C&T panel register setting (Akira Taniguchi, Egbert Eich).
+ 462. Fixing crash on ia64 because of wrong setjmp buffer alignment (Bugzilla
+ #596, John Dennis).
+ 461. Changing ImPS/2 mouse Z-axis range to -8 to 7 (Bugzilla #691,
+ Matthew W. S. Bell, Egbert Eich).
+ 460. Making sure the compiled xkb config file is found by Xnest if
+ ProjectRoot is modified (Bugzilla #688, Frank Giessler).
+ 459. Fixing build of machine code .S files on OS/2 (Bugzilla #689,
+ Frank Giessler).
+ 458. Import Mesa 5.0.2 (Alan Hourihane).
+ 457. DRI merge (DRI Project)
+ * details to follow..........
+ 456. Fixes and updates for XKB keyboard maps:
+ - Update xkb geometry files (Alexander Pohoyda).
+ - Fix German-Romanian maps (Manfred Pohler).
+ - Cleanup Hungarian layout (Bugzilla #730, Egmont Koblinger).
+ 455. Change the order of the timeouts processing and the input devices
+ reading in WaitForSomething() which caused unneeded keyboard autorepat
+ events (Ivan Pascal).
+
+XFree86 4.3.99.13 (25 September 2003)
+ 454. Add support for chip ID 5964 (Radeon 9200 SE) to the radeon driver, and
+ fix detection of IDs 5962 and 5963 with Driver "ati" (Bugzilla #732,
+ Michel Daenzer)
+ 453. Add gcc format checking for the X server's message and logging
+ functions, and fix lots of associated warnings (David Dawes).
+ 452. Replace the perl version of ucs2any with a C version ( Ben Collver and
+ other NetBSD developers, Matthieu Herrb).
+ 451. For drivers that support 'Option "dri"' have the driver request
+ loading the dri module when this option is true. This brings
+ it in to line with how other things are handled. Other drivers
+ that have DRI support need to have the "dri" option added (David Dawes).
+ 450. Fix libGL bug that could cause deadlock when switching contexts
+ (John Harper).
+ 449. Improve the contrast of the whiteglass xterm cursor, and fix the
+ hotspot of the whiteglass right_ptr cursor and add transparency
+ to it (#5867, René Rebe).
+ 448. Fix a problem with the "pl2" (Polish qwertz) map where the order in
+ which the Alt_R and Shift keys are pressed affects the results
+ (Tom Pala).
+ 447. In xdm, use better pseudo-random number generators to generate
+ magic cookies. Add support for EGD and other compatible entropy
+ gathering daemons. (Oswald Buddenhagen from KDE, Matthieu Herrb).
+ 446. Fix IMPS/2 mouse wheel on platforms where char defaults to unsigned
+ (Rene Rebe).
+ 445. Fix rare xterm crash on Darwin due to dyld deadlock when a signal comes
+ in while dyld is looking up a symbol (Rob Braun).
+ 444. XDarwin cleanup and improvements:
+ - Load bundle at runtime for chosen Quartz mode: xpr, cr, or fullscreen.
+ - AppleWM extension has been generalized to work with any Quartz mode.
+ Currently only the xpr implementation is complete.
+ - Wrote a man page for AppleWM.
+ - Moved hw/darwin/quartz/aqua* files that contained code to protect
+ the alpha channel to miext/rootless/safeAlpha.
+ (Torrey T. Lyons).
+ 443. Remove lots of redundant redeclarations (David Dawes).
+ 442. VIA driver:
+ Fixed video memory detection. (Bugzilla #525, Alan Cox).
+ Fixed TV and FP initialization problems (Bugzilla #525, Frederic Crozat,
+ Alan Cox).
+ Removed remaining globals (Egbert Eich).
+ 441. Fixed memory leaks in the loader (Bugzilla #682 and #683, Juergen Keil).
+ 440. Fixed erroneous freeing of DisplayModeRec in xf86DeleteMode() when
+ deleting the modePool in xf86PruneDriverModes() the 'prev' member has
+ a different meaning for modePool modes than for ScrnInfoPtr->modes modes
+ where it creates a doubly linked list (Bugzilla #678, Juergen Keil).
+ 439. Fixed SDK for VIA driver (Bugzilla #674, Bernhard Rosenkraenzer).
+ 438. Extended list of monitor ranges and modes in xf86cfg (Egbert Eich).
+
+XFree86 4.3.99.12 (10 September 2003)
+ 437. Move the X server log file handling from the XFree86 DDX to the DIX,
+ allowing the more descriptive logging to be used throughout the server,
+ and the log messages to be more uniform in formatting (David Dawes).
+ 436. Added support for the Compaq Evo keyboard (Stanislav Brabec).
+ 435. Fixed writes past end of array in via_bios.c (Bugzilla #662,
+ Egbert Eich).
+ 434. Let luit copy the termios settings from the calling terminal (Bugzilla
+ #641, Juliusz Chroboczek).
+ 433. Add _ADOBE_POSTSCRIPT_FONTNAME to the list of font properties xlsfonts
+ that are atoms and should be converted to strings when run with the
+ -ll flag. Also fixed the lenght problems that may arise (Bugzilla # 659,
+ Alan Coopersmith).
+ 432. Backing out 321.: sysMem gets initialized once during server lifetime
+ (Egbert Eich).
+ 431. Fixing X11.tmpl to set XFTINCLUDES after defining a non-standard path
+ to fontconfig, adding FONTCONFIGINCLUDES to the build rules for fontconfig
+ (Kevin P. Fleming).
+ 430. Added support for the hp5181 inet keyboard (Bugzilla #648, Alan Strohm).
+ 429. Added support for Apple Laptop keyboards, added level3/group switching to
+ KP_Enter, modified layout so keyboards acts the same way as under Mac OS
+ (Bugzilla #642, Frank Murphy).
+ 428. Adding ANGKHANKHU (U+0E5A) character to level 3 of keycode <AD09> on
+ th_tis keymap (Theppitak Karoonboonyanan).
+ 427. Fixes and updates for XKB keyboard maps:
+ - Add 'Romanian keymap for German keyboard' and 'Romanian keymap with
+ access to German umlauts' (Manfred Pohler).
+ - Update xfree86.dtd file (Sergey V. Oudaltsov).
+ - Add an XkbOption that makes a keyboard map without special keysyms
+ on Ctrl+Alt+smth for those who use such combinations for another
+ purposes (Ivan Pascal).
+ 426. Reverse patch #423 because it causes compile problems (Ivan Pascal).
+ 425. Disable the bytecode interpreter by default in FreeType 1, bringing it
+ into line with the default for FreeType 2. Document how to enable
+ it in xf86site.def for those with no legal impediment to doing so
+ (David Dawes).
+ 424. Improvement of Xlib's keysym compose module:
+ - Allow to figure out a mulibyte string if it is omitted in Compose file.
+ - Add 'include' instruction with some substitutions.
+ - Add a searching of Compose file as a value of XCOMPOSEFILE environment
+ variable and as a $HOME/.XCompose file. (Ivan Pascal).
+ 423. Add a writing of some Xserver XKB module error messages into a servers
+ log file (Ivan Pascal).
+ 422. Add Trident CyberBladeXP4 support, but acceleration is currently
+ disabled. (Alan Hourihane).
+ 421. Xinstall.sh updates to reduce its reliance on external utilities and
+ provide better diagnostics when required external utilities don't exist.
+ (David Dawes).
+ 420. Fixes and updates for XKB keyboard maps:
+ - Fix unneeded BKSL redefinition in Ukrainian 'winkeys' keyboard map
+ (Andriy Rysin).
+ - Fix some keycodes for jp106 keyboard model (Bugzilla #657,
+ Stephen J. Turnbull).
+ - Update xfree86.xml registry file (Andriy Rysin, Sergey V. Oudaltsov).
+ 419. Add a missing xf86UnblockSIGIO() call to xf86InstallSIGIOHandler()
+ (#5839, NetBSD PR xsrc/22668, Yorick Hardy).
+ 418. Fix a problem with the "pl" map where the order in which the Alt_R and
+ Shift keys are pressed affects the results (#5832, Tom Pala).
+ 417. Fix the warning generated by the ONE_LEVEL <RALT> definition in
+ the "level3" map (#5832, Tom Pala).
+ 416. Remove the unnecessary dependence of RandR on RENDER (David Dawes).
+ 415. Remove some static variables that should be per-screen (David Dawes).
+ 414. SiS driver update:
+ - Add 8x8 Color Pattern Fill (315/330 series)
+ - Add transparency support for 8x8 Mono Pattern (300/315/330 series)
+ - Fix Xv "insufficency" triggered by MPlayer (315 series)
+ 413. Add missing REQUEST_SIZE_MATCH() to xSyncSetCounter protocol request
+ (noticed by Ruben Nunez Francisco).
+ 412. Allow building libOSMesa during non-XFree86 builds (Marc La France).
+ 411. Rip out incorrect limits on the number of PCI buses an ix86 chipset can
+ handle and implement an improved solution for avoiding "phantom" PCI
+ buses (Marc La France, Bugzilla #604).
+ 410. Fixes for potential integer overflows in font libraries. (blexim,
+ Matthieu Herrb).
+ 409. SiS driver: Add RENDER hardware acceleration
+ 408. Add a Fopen() function to open the Xauthority file without spawning
+ a shell (Bugzilla #255, Aidan Kehoe, Matthieu Herrb).
+ 407. Fix a bug introduced with #397 that results in the core pointer and
+ keyboard devices specified in a ServerLayout section being ignored
+ (David Dawes).
+ 406. Added big5hkscs encoding to font encoding files (Bugzilla #575,
+ Jungshik Shin).
+ 405. Don't call FBIOPAN_DISPLAY ioctl with arguments that will cause a
+ confusing if harmless error; make an fbdevhw internal function static to
+ fix a warning. (Michel Dänzer)
+ 404. Passing correct virtual screen size to xf86ValidateModes() in VIA driver
+ (Luc Verhaegen).
+ 403. Added RGB overlays to i810 driver (Bugzilla# 625, Alastair M. Robinson).
+ 402. Fixed mode switching and mode comparison for xf86VidMode extension for S3
+ driver (Bugzilla #613, Alexey Baj, Egbert Eich).
+ 401. Via driver: Fixed remaining globals, some formatting issues, out of
+ memory handling in Xv overlay code and a couple of small glitches caused
+ by the fixes (Bugzilla# 525, Alan Cox)
+ Fixed some missing globals and static build (Egbert Eich).
+ A handful globals still remain.
+ 400. Update the Xserver(1), XFree86(1) and XF86Config(5) man pages to
+ clarify how XFree86 configuration/run-time parameters are specified
+ and their order of precedence (David Dawes).
+
+XFree86 4.3.99.11 (25 August 2003)
+ 399. Try to make the state of libXfont more consistent. It shouldn't depend
+ on whether a static or loadable XFree86 server is being built, so it
+ now always has a dependency on the FreeType2 library (when FreeType
+ support is enabled) (David Dawes).
+ 398. Make the specification of a Monitor in the Screen sections of the
+ XF86Config file optional. Some drivers may need changes (coming later)
+ to maximise the utility of this (David Dawes).
+ 397. When a core keyboard or core pointer cannot be found in the
+ configuration, create default ones. The pointer part of this
+ requires some changes to the mouse driver (coming later) before
+ the default core pointer configuration will be useful on most
+ platforms (David Dawes).
+ 396. Add a facility for assigning version numbers to builtin XFree86 server
+ interfaces and allowing modules to query them. Assign versions for
+ the os-mouse and os-kbd interfaces (David Dawes).
+ 395. Include uname(2) information in the server's banner messages
+ (Marc La France).
+ 394. Fix bug in detection of multi-function PCI devices (Marc La France, in
+ partial resolution of Bugzilla #574).
+ 393. Change the XFree86 server's global default depth to 16, and change most
+ drivers that support the three common depths (8, 16, 24) to defer to
+ the global default rather than specifying their own (David Dawes).
+ 392. Fixed a crash when _XIMProtoOpenIM(), hich is called through XOpenIM()
+ API when protocol IM is being set up, fails (Bugzilla #618,
+ Hisashi MIYASHITA).
+ 391. Fixed a possible source of Sig11 in Jamstudio driver (Bugzilla #617,
+ Jonathan Hough, Egbert Eich).
+ 390. Fixed building without RENDER support (Bugzilla #306, Matthieu Herrb,
+ Egbert Eich).
+ 389. Pass pointer obtained by Xalloc() to Xfree() not the one that may be
+ manipulated in the mean time (Bugzilla #614, Alan Coopersmith).
+ 388. Added reverse mapping of keysyms to keycodes (XKeysymToKeycode())
+ to xev to detect situations where this maps to a different keycode than
+ the one of the key pressed (Egbert Eich).
+ 387. Made xauth called by startx quiet (Bugzilla #597, Stas Sergeev).
+ 386. Added missing operand size override handling to PUSH imm8 in x86emu
+ (Bugzilla #590, Boris Weissman).
+ 385. Fixed compile glitch with NetBSD in xdm/genauth.c (Bugzilla #587,
+ Nicolas JOLY)
+ 384. Fix bugs in Xlib's EUC string converters that cause incorrect work of
+ _Xmblen. Fix _Xmblen usage in imCallbk.c when Xlib is built with
+ X_LOCALE (Etsushi Kato).
+ 383. Update xev program for print the result of XmbLookupString call
+ (Bugzilla #582, Noah Levitt, Ivan Pascal)
+ 382. Fixes and updates for XKB keyboard maps:
+ - Fix for Uzbek keyboard map (Bugzilla #595, Mashrab Kuvatov).
+ - Fix for the problem with Alt+Tab combinations in some window mangers
+ (Bugzilla #580,616): window chooser menu doesn't disappear after
+ Alt key release (Egbert Eich, Ivan Pascal).
+ 381. Allow a Display subsection with no depth or fbbpp specified to match
+ any depth/fbbpp, and make Display subsections optional, creating one
+ with default parameters when no suitable one can be found (David Dawes).
+ 380. Include <sys/param.h> to get the BSD macro for luit (ITO Tsuyoshi).
+ 379. DRM resync from the DRI trunk...
+ - Lots of misc fixes/cleanups, and some resyncs with 2.4 and 2.6
+ kernels.
+ - Fix maplist entries being used after they were freed; thanks to
+ Benjamin Herrenschmidt for tracking this down (Michel Daenzer).
+ - FreeBSD updates (Eric Anholt).
+ - Fail in DRM(agp_acquire) if the AGP aperture can't be used, such
+ that the X server falls back to PCI GART or disables the DRI
+ gracefully (Michel Daenzer).
+ - Possibly fix stanford checker complaints about sarea for radeon
+ (Keith Whitwell).
+ - Restore i830 texture age waiting when swapping in new textures
+ (Keith Whitwell).
+ - Fix texture rectangle support for r100 (Keith Whitwell).
+ - Add i810 add page flipping support to the DRM (Dave Airlie).
+ - Merged DRM documentation (Jose Fonseca).
+ - r128 MESA_ycbcr_texture (Ian Romanick, Leif Delgass).
+ 378. Linux drm module build fixes for newish kernels from the DRI
+ repository (Michel Daenzer, Linus Torvalds, Leif Delgass). This
+ addresses Bugzilla #603, 605 (Calum Mackay).
+ 377. Fix the test for 2.5.x with x < 52 Linux kernels for the drm module
+ build (Bugzilla #601, Callum Mackay).
+ 376. Fix an XAA pixmap cache server crash that can happen in some cases
+ when the off-screen memory is heavily fragmented (David Dawes, based
+ on #5752, Koike Kazuhiko, Chisato Yamauchi).
+ 375. Fix for the Brazilian ABNT2 keyboard extra key that now translates to
+ a different keycode value. Patch suggested by Ivan Pascal.
+ 374. Fixed XDarwin fullscreen crash in some screen sizes (Torrey T. Lyons).
+ 373. Be a little more precise about differentiating between active and
+ inactive non-video PCI resources (Marc La France).
+ 372. Added Apple-WM extension and library (John Harper, Torrey T. Lyons).
+ 371. Fixed indirect GLX on Mac OS X when the client can not make a
+ connection to the CoreGraphics window server (John Harper).
+ 370. Fixed support for 64bit PCI bus on 32bit systems (Egbert Eich).
+ 369. Added support for using aliases in the -nolisten option. '-nolisten tcp'
+ aliases to IPv4 and IPv6 (Matthieu Herrb, Egbert Eich).
+ 368. Added fallback Xlib transport layer if IPv6 socket cannot be openend
+ (Egbert Eich).
+ 367. Added missing symbol to the vbeSymbols table in i740 driver (Bugzilla
+ #583, Egbert Eich).
+ 366. Changed scripts containing 'head -1' which is not supported by
+ POSIX 1003.1-2001 any more (Bugzilla #570, #569, Paul Eggert,
+ Egbert Eich).
+ 365. Changed POSIX 1003.1-2001 non-conformant 'sort +2' to 'sort -k 3' with
+ backward compatibility (Bugzilla #568, Paul Eggert).
+ 364. Add Microsoft Pro OEM model to XKB inet map (Bugzilla #458,
+ maxim@wzzrd.com)
+ 363. Extract the CHANGELOG's commit date and include it in the XFree86
+ server log/version information (David Dawes).
+ 362. Change the way xf86Build.h is created so that it doesn't cause its
+ dependencies to be rebuilt when its contents are not changed
+ (David Dawes).
-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
+XFree86 4.3.99.10 (10 August 2003)
+ 361. Fixes and updates for XKB keyboard maps:
+ - Added numpad:microsoft XKB option (Bugzilla #558, Will Styles).
+ - Fixed inconsistence in indicator names (Bugzilla #577, Noah Levitt).
+ - Added type6 model of Sun keyboard (Warren Turkal).
+ 360. Add UK (gb) layout to the dvorak XKB map (#5739, Mike Sulivan).
+ 359. More work on the NativeGDI server for Cygwin/XFree86. The span routines
+ are nearing completion (albeit they run slowly until the higher
+ level X primitive functions are implemented). The obvious issue with
+ the current code is the problems surrounding 1-bit DIBsections which
+ have msb/lsb issues compared to the other types of DIBsections.
+ This work was done quite some time ago in the Cygwin/XFree86 CVS.
+ (Alan Hourihane).
+ 358. SiS driver update:
+ - Added pseudo-Xinerama extension for MergedFB mode
+ - Fixes for Clevo L285/L287 (1024x768)
+ 357. Include Xmd.h in Xpm/lib/XpmI.h to get definitions of LONG64
+ (Bugzilla #562, John Dennis).
+ 356. Moved Meta_L/R keys and added Super_L/R keys on macintosh keyboard.
+ This makes the layout more compatible to the PC keyboard layout
+ (Bugzilla #565, Frank Murphy).
+ 355. Add check for Xmalloc() return value in XGetErrorDatabaseText() to avoid
+ Sig11 (Bugzilla #563, Alan Coopersmith).
+ 354. Separated build of libglx.a module and normal libglx.a library
+ (Bugzilla #541, Frank Giessler).
+ 353. Fixed build of Xnest, Xprt and Xvfb for OS/2 by linking with the linker
+ definition files (Bugzilla #541, Frank Giessler).
+ 352. Fixed freeing of properties form xkb_geomerty block (Bugzilla #550,
+ Alexander Pohoyda).
+ 351. Fixed string octal number parsing and string to int conversion for "\00"
+ in xkbcomp (Bugzilla #553, Egbert Eich).
+ 350. Removed stale definition from XftCompat.h (Bugzilla #543, Egbert Eich).
+ 349. Added XLC_LOCALE file for zh_CN.UTF-8, moved iso10646 encoding to the end
+ in ja_JP, ko_KR and zh_TW UTF-8 XLC_LOCALE files
+ (Bugzilla #544, Akira TAGOH).
+ 348. Fixed typo in #if conditional in cfb code (Bugzilla #556, Dave Love).
+ 347. Fixed ValidMode() in C&T driver to work with option 'FixPanelSize'
+ (Egbert Eich).
+ 346. Fixed Meta_R key on us layout Macintosh keyboard (Bugzilla #539,
+ Frank Murphy).
+ 345. Add new charset sequence for CText at the end of list. This way the
+ sequence of a charsets that were added earlier will be picked if two
+ sequences for the same charset are registered (Bugzilla #228,
+ Egbert Eich).
+ 344. Use return value sysconf (_SC_OPEN_MAX) instead of the fixed number 256
+ for allowed number of open files on POSIX.1 conformant systems
+ (Egbert Eich).
+ 343. Added missing exported functions in libfreetype to compile mkfontscale,
+ made mkfontsdir script install on platforms that use extensions (Bugzilla
+ 536, Frank Giessler).
+ 342, Fixed a sig11 in Xaw that may appear on the rare condition that no font
+ can be found (Bugzilla #482, Egbert Eich).
+ 341. Added KP_Separator to symbols that can generate decimal() in xcalc
+ (Egbert Eich).
+ 340. Disabled Color8x8PatternFill() in savage driver (Egbert Eich).
+ 339. Fixed a sig11 in twm when used with a session manager (Egbert Eich).
+ 338. Fixed rounding of refresh rate in RandR, updated Xrandr man page
+ (Bugzilla #527, Egbert Eich).
+ 337. Added MenuBorderWidth and MenuBorderColor options to twm (Bugzilla #529,
+ Alexander Pohoyda)
+ 336. Update for VIA driver:
+ - DGA no longer hangs (eg freedroidRPG now runs reliably)
+ - Starting two copies of Xine no longer aborts the X server
+ - Added support for KM400/K8M400
+ - Improved video overlay support.
+ - Fixed video overlay clipping when the image cliprects change but
+ not the size.
+ - TV tuner support via XV interface for two overlay ports.
+ - DRI support (the client side library is not yet fully ported to 4.3).
+ - Disable Xv in modes with insufficient bandwidth (1600c1200x16).
+ - Updated documentation
+ It differs from the base VIA codedrop.
+ - Several of the fixes were done by me on top of it (the dual Xine fix,
+ and bandwidth)
+ - Various system types have been turned to CARD32 to make the code
+ portable
+ - The hybrid Video4Linux/XV glue was racy and has been removed
+ (the XV layer is more than sufficient anyway)
+ - DRI library client code is not included (porting not yet finished)
+ - Additional debugging
+ (Bugzilla #525, VIA, Alan Cox) .
+ - Cleaning up namespace pollution, removing dependency on via_drm.h
+ removing some global symbols from driver (Egbert Eich).
+ Please note: there are more global symbols yet to be removed.
+ 335. Remove the 'xc/xkbcomp/geometry/HP' directory from the CVS repository.
+ 334. Substantial rewrite of the "nv" driver (Mark Vojkovich).
+ 333. Resync with Cygwin/XFree86 changes up to Test92 (#5721, Harold Hunt and
+ the Cygwin/XFree86 project).
+ 332. Add a clean target for Cygwin's ResourceObjectRule() rule (#5720,
+ Harold Hunt).
+ 331. Fix xman's formatting/displaying of manual pages on Darwin, where
+ 'groff' defaults to PostScript formatting (#5719, T. M. Pederson).
+ 330. SiS driver update:
+ - Fixed SiS 620 support
+ - Added interface for sisctrl utility
+ (Thomas Winischhofer)
+ 329. Fixes for regressions in xauth and xhost with IPv6 code
+ (Matthieu Herrb, Hideki ONO).
+ 328. Update X-TrueType (X-TT) to version 1.4.1 (Chisato Yamauchi,
+ After X-TT Project):
+ - Extension of code converter modules for ARABIC, ARMSCII8,
+ BIG5HKSCS, GB18030, ISO8859.*, etc. (Pablo Saratxaga, James Su)
+ - Try to use TT_Load_Glyph_Bitmap() in get_metrics() when `bs'
+ option is not set.
+ - Use Embedded Bitmap with the option `eb=y' when Auto Italic is set.
+ - Enhancements for `ds', `eb' and `bw' options.
+ - New options for TTCap, `fc' and `fm': they enable the *extremely*
+ fast loading of big Japanese or unicode fonts with `-p-' in the XLFD.
+ - Performance improvement of FreeTypeGetMetrics() function.
+ - Improved performance based on the solution to the buffer
+ overflow problem, caused by exceeding the range of
+ maxbounds.ascent/maxbounds.descent. This problem occurred only
+ when `-m-' spacing was used.
+ - Improved fix to crashes caused when certain fonts (e.g. verdana.ttf)
+ are used; solution based on investigating the true nature of the
+ problem.
+ - Added patch for mktcapdir-0.5.4 and some ttfconf files suitable for
+ X-TT 1.4.0.
+ - Preparation for extending the encoding field of XLFD. X-TT permits
+ the following additional XLFD format:
+ "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.0"
+ "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.1"
+ The last number can be used to indicate the plane number of a huge
+ character set.
+ - Support for reverse `fc' specification. `fc=0xaa00-0xa0ff' means
+ specifying the ranges 0x0000-0xa0ff and 0xaa00-0xffff. This is
+ useful for GB18030 proportional fonts.
+ - Improved fix for server crash that appears on Linux/PPC.
+ - Added ksc5601.*-3 and ksx1001.*-3 to KSCJOHAB/main.c (Jungshik Shin).
+ - Added U+20AC and U+00AE characters to KSCJOHABtoUCS2.c and
+ KSC5601toUCS2.c (Jungshik Shin).
+ - Fixed an X server crash when using LucidaSansRegular.ttf
+ (reported by Koike Kazuhiko).
+ - Improved fix to prevent NULL dereference when the font cache
+ becomes full; solution by allocation of a dummy area for bitmap.
+ - Fixed an X server crash because of an inconsistency problem between
+ XFree86 and X-TT (reported by Koike Kazuhiko).
+ - Numerous minor improvements.
+
+XFree86 4.3.99.9 (25 July 2003)
+ 327. Add Mach64 I2C framework. Derived from GATOS project (Marc La France).
+ 326. Removed ru_yawerty xkb symbols file as it is misleading as suggested
+ by Ivan Pasacal (Bugzilla #516, Ivan Pascal).
+ 325. Fixed two bounds errors in rman
+ (Bugzilla #505, Dan Nelson, Bugzilla #506, Eric Anholt).
+ 324. Cleaned up MMIO map/unmap in RADEONPreInit(), unmapped MMIO in
+ CloseScreen() even when server is switched away (Bugzilla #504,
+ Hui Yu, Egbert Eich).
+ 323. Modified transport code so that a bind to an IPv4 socket fails silently
+ when the bind to an IPv6 socket for the same port was successful.
+ This works around a problem in theIPv6 implementation on some OSes
+ that also handle IPv4 calls over IPv6 sockets (Egbert Eich).
+ 322. Simplified handling of the -nolisten option as suggested by
+ Alan Coopersmith. This option can now be issued multiple times.
+ 321. Added code to unmap sysMem when freeing int10 (Bugzilla #504,
+ Frank Giessler).
+ 320. Fix generic rootless crash while resizing when CopyBytes is not defined
+ by the implementation (Torrey T. Lyons).
+ 319. Fix XDarwin Cocoa rootless crash when unshaping a shaped window
+ (Torrey T. Lyons).
+ 318. More IPv6 changes from Alan Coopersmith as follows:
+ - Add support for IPv6 bracketed numeric addresses, similar to RFC 2732
+ syntax to a number of areas.
+ - Fix some issues with colon parsing and determining which addresses are
+ DECnet (two colons between hostname and display number) and which are
+ non-bracketed IPv6 numeric addresses ending in two colons, followed by
+ another colon and the display number (three colons in a row).
+ - Fix additional places Fabio forgot to change the string length when
+ switching "inetv6" to "inet6".
+ - Use MAXHOSTNAMELEN if it is defined for MAXHOSTNAME in xrdb. (Perhaps
+ NI_MAXHOST should be used as well on platforms that support it.)
+ - Make #include <sys/socket.h> in Xtrans.h look like the other places
+ it's included in the tree, with checks for Lynx & Win32
+ 317. IPv6: 2003.07.11 update to X.Org's response to comment #13; i.e.
+ s/FamilyInternetV6/FamilyInternet6/g (Marc La France).
+ 316. IPv6 build fixes for older Linux systems; Many of these are derived from
+ a suggestion by Alan Coopersmith (Marc La France).
+ 315. Change DEVID macro to work around glitch in SCO's C compiler
+ (Marc La France).
+ 314. Fixed Radeon driver so that clone modes survive server reset
+ (Bugzilla #487, Egbert Eich).
+ 313. Changed behavior of FreeType and Type1 renderer: when no encoding file
+ is found fail with BadFontName instead of using an iso8859-1 encoding
+ (Bugzilla #479, Roland Mainz, Juliusz Chroboczek, Egbert Eich).
+ 312. Fixed screen switching problem on SCO where VT was off by one
+ (Bugzilla #470, Kean Johnston).
+ 311. S3 driver:
+ . allow only specific displayWidths when acceleration is enabled
+ . added double_scan support (Egbert Eich).
+ 310. Removed build rules for hp Xserver that was recently removed from
+ Xserver/Imakefile (Egbert Eich).
+ 309. Fixes for C&T driver:
+ . switch to SW mouse in doublescan modes.
+ . centered video correctly for all interlaced modes (docs were
+ misleading).
+ . fixed README (Egbert Eich).
+ 308. Fixed a typo in mkfontscale (Bugzilla #491, Juliusz Chroboczek).
+ 307. A lot of X server prototype cleanups, including fixing an
+ inconsistency between the cfbBitBlt and CopyPlane functions
+ exposed by the prototyping (#A.1859, Alexander Stohr).
+ 306. Fix missing newline in Message -> MessageF transition in dri_glx.c
+ (#A.1833, Alexander Stohr).
+ 305. Fill out the sunleo man page (#A.1783, Arnaud Quette).
+ 304. Fix a typo in the XSetWMProtocols(3) man page (#5697, Alexander Pohoyda).
+ 303. Fix for a few Xlib charset converters (Bruno Haible).
+ 302. Fix calculation of CRTC2 frame offset with page flipping in radeon driver
+ (Michel Daenzer)
+ 301. Xinerama-fy the XTest extension (Rik Faith).
+
+XFree86 4.3.99.8 (10 July 2003)
+ 300. X.Org IPv6 changes (Bugzilla #227, Alan Coopersmith, Marc La France).
+ See http://www.x.org/IPV6_Specific_Changes.html for details. This has
+ been further modified as follows.
+ - Deal with small memory leaks in xdm & xauth.
+ - Fix a number of compilation issues.
+ - Where supported, use SIOCGLIFCONF to query network interfaces on more
+ than only Solaris.
+ - Incorporate X.Org responses to comments #'s 1, 2, 4, 5, 7, 10, 11, 12,
+ 13, 14 and 15 (taken from an X.Org-internal document dated 2003.06.17).
+ - Replace HasIPv6 imake symbol with BuildIPv6, defaulting it to YES, and
+ build in IPv6 support whenever BuildIPv6 is asserted _and_ the OS
+ #define's AF_INET6. This is to maximise IPv6 code exposure and
+ eliminate <OS>.cf file changes to support IPv6.
+ 299. On Solaris, don't allow remote root xdm logins if CONSOLE is set in
+ /etc/default/login (Bugzilla #227, Alan Coopersmith).
+ 298. Fix SEGV in fstobdf when font server is not specified and FSServerName()
+ returns NULL (Bugzilla #227, Alan Coopersmith).
+ 297. Fix XDMCP bug that could cause local host entries in /etc/X0.hosts to be
+ lost (Bugzilla #227, Alan Coopersmith).
+ 296. Make certain xtrans static variable volatile to avoid optimisation issues
+ that occur when they are modified by SIGALRM handlers
+ (Bugzilla #227, Alan Coopersmith).
+ 295. Use %p instead of %x to print pointer values in xtrans debug messages to
+ avoid overflow on platforms with 32-bit ints & 64-bit pointers
+ (Bugzilla #227, Alan Coopersmith).
+ 294. Change SUN-RPC code to use authdes_seccreate() call rather than the
+ deprecated authdes_create() (Bugzilla #227, Alan Coopersmith).
+ 293. Add xdm /dev/random handling for Solaris
+ (Bugzilla #227, Alan Coopersmith).
+ 292. Solaris compile fixes (Bugzilla #227, Alan Coopersmith).
+ 291. Update X.Org version numbers to X11R6.6 or X11R6.7 and replace old
+ references to X Consortium with X.Org (Bugzilla #227, Alan Coopersmith).
+ 290. Update the usage of DRM AGP handles so that valid handles aren't
+ mis-interpreted as invalid handles (based on Bugzilla #484, Dave Airlie).
+ 289. Twisting fontfile.c and fontdir.c to be able to pass all fonts (bitmap
+ and scaleable) to the scalable renderer as this one can deal with
+ XLFD names (Bugzilla #475, Juliusz Chroboczek). PLEASE TEST!
+ 288. Changing PS/2 mouse resolution to 8 counts/mm as some broken mice have
+ problems with other values (W. uses 8) (Egbert Eich).
+ 287. Fixing mode setting by BIOS. Wrong clock selection in MiscOut register
+ caused screen to stay blank (Egbert Eich).
+ 286. Added description for -dumpSched and -schedInterval to the usage
+ message (Egbert Eich)
+ 285. Update the SCO OpenServer port, fixing these specific problems:
+ . Fixed the Imake template so i[3456]86 and friends arent defined
+ . Fixed bad preprocessor stuff in X11.tmpl that was producing warnings
+ . Updated default GCC flags to more aggresively optimize
+ . Fixed keyboard LED handling
+ . Enable SCO function keys in xterm
+ . Make Delete key send DEL by default on SCO in xterm
+ . Fix to make fonttosfnt compile (Bugzilla #470, Kean Johnston).
+ 284. Added missing ro2 symbols file to list of files to install
+ (Bugzilla #476, Egbert Eich).
+ 283. Corrected precedence problem in test in xc/lib/X11/XKBUse.c:
+ XkbUseExtension(). This avoids an extra round trip during application
+ startup (Bugzilla #473, Owen Taylor).
+ 282. Fixing deadlock in libXi - when is called _XLockDisplay() twice - when
+ calling a Xi function that calls XGetExtensionVersion() (Bugzilla #260,
+ Bastien Nocera, Owen Taylor).
+ 281. Adding support for video modes <320x240 to S3 driver by changing the
+ minimal clock frequency to 15.6 MHz (Bugzilla #472, Alexey Baj).
+ 280. Made mkfontscale behavior and options compatible to mkfontdir, fixed
+ bugs in output format (Bugzilla #425, Juliusz Chroboczek, Kean Johnston).
+ 279. Changed xclock hands back to black (antialiased) , created XClk-col.ad
+ to set colored hands instead, added missing documentation for missing
+ resources. This follows the behavior of the other X applications more
+ closely (Bugzilla #437, Joerg Wunsch).
+ 278. Added support for Trio64UV+ and Trio64V2/DX/GX to S3 driver (backport
+ from 3.x) (Bugzilla #465, Alexej Baj).
+ 277. Increased Xlib default buffer size to 16k (was 2048), made size
+ configurable thru environment variable XLIBBUFFERSIZE (minimum 2048)
+ (Bugzilla #466, Roland Mainz).
+ 276. Increased maximum BIGREQUEST size to 4Mb and made it configurable thru
+ a command line option. This increases performance of certain
+ applications considerably (Bugzilla #460, Roland Mainz).
+ 275. VIA driver: initialized screen parameters in PreInit() instead of
+ AccelInit() so that they are set even when acceleration is disabled
+ (Egbert Eich).
+ 274. Do not drop H&V sync during screen blanking for Radeon
+ (Bugzilla #320, Michael Breuer, Hui Yu@ATI).
+ 273. Let out-of-limit pixel clocks only use the frequency below pll output
+ lower limit for Radeons (Bugzilla #262, John Vickers, Hui Yu@ATI).
+ 272. Add support for Radeon cards with DAC/TMDS wire up in different ways
+ from what the driver was originally programmed to; includes support
+ for dual DVI cards (Hui Yu@ATI).
+ 271. Add Radeon DPMS handling for flat panels (Bugzilla #26, Hui Yu@ATI).
+ 270. Decreased the retry loops in DDC probing so that Radeon startup
+ time won't be too long in the worst case (Hui Yu@ATI).
+ 269. Fix Radeon Asic bug in RMX unit of IGP chips (Hui Yu@ATI).
+ 268. Fix Radeon register initialization for RGB offset to fix the
+ "milky-screen" problem (Bugzilla #351, Hui Yu@ATI).
+ 267. Add support for new Radeon chips: R350(9800), RV350(9600,M10),
+ RS250(IGP7000), RS300(IGP9000), RV280(9200) (Hui Yu@ATI).
+ 266. Fix a lockup with the trident driver when stopping/starting Xv
+ applications (Alan Hourihane).
+ 265. Fix initialisation in xauth (Martin Birgmeier).
+ 264. Calling RADEONSaveFPRegisters() regardless of display type to catch
+ register restauration problems (Bugzilla #193, Hui Yu).
+ 263. Fixed order of name and filename in encodings.dir files generated by
+ mkfontscale (Roland Mainz).
+ 262. Changed resource registration in TDFX driver: VGA mem resources
+ are unused during OPERATING state, RAC isn't required for memory
+ resources (Bugzilla #357, Egbert Eich).
+ 261. Attempt to fix VIA driver lockups when moving windows:
+ assumed bug compatibility to previous S3 products
+ (Bugzilla #435, Egbert Eich).
+ 260. Disabled mode writeback to client program from MGA driver (Egbert Eich).
+ 259. #ifdef'ed variables in os-support/bsd in cases they are not needed
+ (Bugzilla #430, Jason L. Wright).
+ 258. Fixes and updates for XKB keyboard maps:
+ - add Faroese keyboard map (Bugzilla #401, Roi a Torkilsheyggi)
+ - add missing KPPT key to ABNT2 keycodes list (Bugzilla #431, Christian
+ Tosta)
+ - fix geometry/pc file (Alexander Pohoyda).
+ 257. Don't sleep on Darwin for directory owner/mode problems (John Harper).
+ 256. Limit 430TX and 430VX to 128 and 32 PCI buses respectively
+ (Marc La France).
+ 255. Add direct GLX rendering on Mac OS X and Apple-DRI extension
+ (John Harper).
+ 254. Replaced inline asms with compier intrinsics for Intel compiler
+ (Bugzilla #427, Slava Sysoltsev).
+ 253. Partly fixed build problems caused by mkfontdir replacement
+ (Bugzilla #425, Egbert Eich).
+ 252. SiS driver update:
+ Fixed Xabre support
+ (Final) fix for Compaq 3045US
+ Customized timing for 848x480 parallel panels
+ 251. Replaced mkfontdir by simple shell script that calls mkfontscale
+ (see #233) (Bugzilla #388, Juliusz Chroboczek).
+ 250. Added encoding files for Arabic (iso8859-6.16 and iso8859-6.8x)
+ (Bugzilla #420, Roland Mainz).
+ 249. Removed O_SYNC from open call for /dev/mem for all Linux platforms.
+ This hopefully takes care of the speed problem
+ (Bugzilla #419, #414, Egbert Eich).
+ 248. Fixed fontstosfnt to build on OS/2 (Bugzilla #415, Frank Giessler
+ Juliusz Chroboczek).
+ 247. Fixed DMC touchscreen driver: button press events are properly
+ recognized now, made sure device is still recognized after a restart,
+ fixed misleading error messages (Bugzilla #418, Andreas Kies).
+ 246. Added PanoramiX supprt for the RENDER requests: Trapezoids, Triangles,
+ TriStrip, TriFan, SetPictureTransform and SetPictureFilter
+ (Bugzilla #138, Egbert Eich).
+ 245. Fixed SW/Theme cursor drawing glitches in i740 driver (Bugzilla #21,
+ Egbert Eich).
+ 244. Added input driver for Aiptek tablet (Bugzilla: #393, (list #5686),
+ Bryan W. Headley).
+
+XFree86 4.3.99.7 (25 June 2003)
+ 243. Added 'BitKeeper' to the directories that get excluded by lndir
+ (Bugzilla #408, H.J.Lu).
+ 242. Fixed gcc warnings in xdmauth.c (Bugzilla #410, Jason L. Wright).
+ 241. Updated Citron touchscreen driver: set 'block duration time'
+ to one second to avoid timeouts, added user strings to inform about
+ HW version (Peter Kunzmann).
+ 240. Fixed wraparound bug in TimerSet() (Peter Osterlund).
+ 239. Fixed X*LookupString() in imDevLkup.c to return status
+ XBufferOverflow and the required size as required
+ (Bugzilla #397, Kusanagi Kouichi).
+ Dto. for imLcLkup.c (Egbert Eich).
+ 238. Removed unused function QualifyName, Exit() from Xprint
+ and CountBits(), matchVisuals() from GLX
+ (Bugzilla #395, #400, #394 Jason L. Wright).
+ 237. Fixed type warning when building sunffb driver on 64bit
+ (Bugzilla #404, Jason L. Wright).
+ 236. Fixed warnings when building Palmex touchscreen driver statically
+ (Bugzilla #405, Jason L. Wright).
+ 235. Fixes and updates for XKB keyboard maps:
+ - add programmers variant to the Turkish keyboard map (Nilgün Belma
+ Bugüner)
+ - add a variant of the Romanian keyboard map for German keyboard
+ (Manfred Pohler)
+ - add layout for BTC 9001AH keyboard (Nick Kurshev)
+ - add Uzbek keymap description (Bugzilla #391, Mashrab Kuvatov)
+ - update geometry files (Alexander Pohoyda)
+ 234. Added fonttosfnt, a utility that generates bitmap-only TTFs. It is
+ capable of reading most font formats (Bugzilla #389,
+ Juliusz Chroboczek).
+ 233. Added functionalities to mkfontscale so mkfontscale performs every
+ functionality mkfontdir does (Bugzilla #387, Juliusz Chroboczek).
+ 232. Removed absolute path from cpp for Linux as /usr/bin/ should be
+ in the default search patch (Egbert Eich).
+ 231. Fix regression of Xvideo not working with some videos on the
+ CyberBladeXP/Ai1 chips (Bugzilla #251, Stephane Voltz).
+ 230. Added early failure and warning message when not sufficient memory
+ available for DRI in i8xx driver (Egbert Eich).
+ 229. Fix bug in original patch which added support for two new relocation
+ types for IA64 (Bugzilla #195, John Dennis).
+ 228. Fix scaling calculus in savage driver (Bugzilla #274, Emmanuel).
+ 227. Clarifying if conditions, fixing memory leaks in error path, removing
+ useless code in savage driver (Bugzilla #278+279, Emmanuel).
+ 226. Adding message to R128 driver which informs about modified modes for LCD
+ according to VBIOS (Bugzilla #23, Egbert Eich).
+ 225. Fixed chipset ID for v2100/v2200 for overrides (Egbert Eich).
+ 224. Added interlaced support for Voodoo 3,4,5 to TDFX driver (Bugzilla #383,
+ Jakub Bogusz).
+ 223. Fixed typo in getPciBiosTypes() (Bugzilla #382, Jakub Bogusz).
+ 222. Restore previous mode if mode switch fails (Bugzilla #381, Jakub Bogusz).
+ 221. Fixed typo that prevented lubB19 fonts with different maps from being
+ generated (Bugzilla #380, Jakub Bogusz).
+ 220. Sync entrypoints for OS/2 with recent changes in fontconfig and Xft
+ (Bugzilla #374, Frank Giessler).
+ 219. Added detection of 2Mb memory for CLGD7548, fixed a possible memory
+ leak and did minor cleanups (Bugzilla #369, Lucas Correia Villa Real).
+ (PLEASE TEST!)
+ 218. Recode single-byte keyboard scancodes that clash with recoded
+ double-byte scancodes (David Dawes).
+ 217. Fixes and updates for XKB keyboard maps:
+ - add more EuroSign to "us_intl" keyboard map (Paul Bolle)
+ - update geometry files (Alexander Pohoyda)
+ - add AudioMute key to inet(hpxe3gc) (Bugzilla #350, Paul Pacheco)
+ - add option for replacing RCtrl key with Right Alt (Bugzilla #343,
+ Adam Tlalka)
+ - add Uzbek keyboard map (Bugzilla #372, Mashrab Kuvatov)
+ 216. (Re-)fix portability of gccmakedep and generate ccmakedep on all
+ platforms (Marc La France).
+ 215. Fix i810/i815 problem with interlaced modes where only the top half
+ of the screen gets displayed (Paul Stewart).
+ 214. Changed any occurance of x86_64 to AMD64, the official name of the
+ architecture (Egbert Eich).
+ 213. Removed Copyright sign from man pages as this causes some formatters
+ to choke (Egbert Eich).
+ 212. Export SysV IPC functions to modules in Net and OpenBSD
+ (Bugzilla #355, Quentin Garnier).
+ 211. Fix rootless bug when reordering windows behind others (Torrey T Lyons).
+ 210. Fix page size issues that prevented the mmap()'ing of SBUS devices
+ (Marc La France).
+ 209. Fixes for the following problems on OS/2:
+ - long startup delay of xinit
+ - recovery from hard-error popups
+ - text-mode version of xf86cfg
+ - xf86cfg unable to find default config file
+ - installation of static libraries
+ - missing exported functions in X11.dll
+ - typo in xf86pathIsAbsolute()
+ (Bugzilla #267, Frank Giessler).
+ 208. SiS driver update:
+ Fixed 1280x960 and 1280x1024 LCD support (SiS 30x)
+ Added Chroma-Keying support to Xv part
+ Added support for Barco iQ R and G series projectors
+
+XFree86 4.3.99.6 (10 June 2003)
+ 207. Add support for the Mac's KP_Equal key (untested) (David Dawes).
+ 206. Import fontconfig 2.1.0 as an external package, and update the build
+ to use this version (David Dawes).
+ 205. New version of the FreeType backend. (Bugzilla #325, Juliusz Chroboczek).
+ 204. Rework XDarwin's Cocoa rootless implementation to use new generic
+ rootless code in miext/rootless (Torrey T. Lyons).
+ 203. Fix repeated image problem when using a vesa video mode before starting
+ the Xserver on the S3 Trio3D cards (Alan Hourihane).
+ 202. Import zlib 1.1.4 for systems that don't provide it (Matthieu Herrb).
+ 201. Improve fonts width and weight detection (Bugzilla #265-266,
+ Juliusz Chroboczek).
+ 200. Fix library dependencies for xlibi18n modules (Bugzilla #82, Joe Kelsey,
+ Matthieu Herrb).
+ 199. Fix manual pages typos (Bugzilla #316, Jens Schweikhardt).
+ 198. Fix bug (Bugzilla #315) in _XTextPropertyToTextList() that causes
+ an application crash in some circumstances (Ivan Pascal).
+ 197. Fixes and updates for XKB keyboard maps:
+ - add asciitilde to Swedish 'nodeadkeys' map (Bugzilla #291).
+ - add map for true Romanian keyboard (Bugzilla #300, Manfred Pohler).
+ - add EuroSign to "us_intl" keyboard map (Bugzilla #309, Paul Bolle).
+ - fix some keys in Armenian 'phonetic' layout (Bugzilla #313, Ani).
+ - add some geometry files (Alexander Pohoyda).
+ - some cosmetic changes.
+ 196. Import FreeType 2.1.4, and do initial merge for config/build
+ (David Dawes).
+ 195. Remove unnecessary links of libm (Marc La France).
+ 194. IRIX 6.5 build fixes and noise reductions (Marc La France).
+ 193. Clean up confusion in Imakefiles between XONLYLIB and XLIBONLY (and
+ between DEPXONLYLIB and the previously non-existent DEPXLIBONLY)
+ (Marc La France).
+ 192. Do not unnecessarily link libXmu, libXt and/or libXext into executables
+ (Marc La France).
+ 191. Fix makedepend for IRIX 6.5 (Marc La France).
+ 190. Make the handling of X_BYTE_ORDER in Imakefiles more portable
+ (Marc La France).
+ 189. Allow building of a libXfont without font cache support (Marc La France).
+ 188. When using cpp to generate scripts and data files, change XCOMM to pound
+ signs even when preceeded by only whitespace, and provide a means to
+ generate output lines with trailing backslashes. Change `startx` script
+ accordingly (Marc La France).
+
+XFree86 4.3.99.5 (25 May 2003)
+ 187. Fix XDMCP queries in xdm on systems using getifaddrs().
+ (Bugzilla #277, Joel Ray Holveck).
+ 186. Initial imake/config support for more closely (and more
+ automatically) emulating how libtool handles shared library revisions.
+ Implmemented for Linux only so far (David Dawes).
+ 185. Fix libexpat shared lib revision on platforms that use minor version
+ numbers (David Dawes).
+ 184. Update Tamil keyboard map (Thuraiappah Vaseeharan).
+ 183. Add missing xfs reply to GetEventMask requests (Marc La France).
+ 182. Change the ELF loader to ignore .debug* sections (Marc La France).
+ 181. Simplify internal interfaces in the PCI code and remove the Xserver's
+ interference with normal PCMCIA operation (Marc La France).
+ 180. i810/815 depth buffer needs to be a multiple of the tile size. This
+ fixes 3D corruption near the bottom of the screen at 800x600@16bpp
+ (Bugzilla #283, Dave Airlie).
+ 179. SiS driver update
+ - Allow Modelines for LCD and secondary VGA on 301B
+ - Support plasma panels natively (including a small
+ database for some known panels since some panels
+ report wrong timing data via DDC)
+ 178. DRM resync from the DRI trunk...
+ - Lots of fixes/cleanups/resyncs for the BSD DRM drivers (Eric Anholt).
+ - Fix potential oops and memory leaks when allocations fail in
+ addbufs_agp/pci (Leif Delgass).
+ - Add support for buffer private structs with PCI DMA buffers
+ (Leif Delgass).
+ - Disable MTRRS on FreeBSD-stable (Eric Anholt).
+ - Remove some unused code (Keith Whitwell).
+ - Move prototypes for gamma functions to gamma_drv.h (Keith Whitwell).
+ - 2.5.x resync (Linus Torvalds).
+ - Ensure driver has been initialized before installing irq handler,
+ and modify all drivers to ensure irq handler is removed before
+ cleanup, and cleanup is called at takedown (Leif Delgass).
+ - Check for lock on init/cleanup in all drivers except i810/i830
+ (Leif Delgass).
+ - Put back __HAVE_KERNEL_CTX_SWITCH for the sparc drm driver
+ (Keith Whitwell).
+ - Only free original pagelist in addbufs_pci if one already exists
+ (fixes oops) (Leif Delgass).
+ - texmem-0-0-1 branch merge (Ian Romanick).
+ - Fix warning on machines where sizeof(drm_addr_t) != 4 (Randy Dunlap).
+ - Support AGP bridges where the AGP aperture can't be accessed directly
+ by the CPU (David Mosberger, Benjamin Herrenschmidt, Michel Daenzer,
+ Paul Mackerras, Jeff Wiedemeier).
+ 177. Fix another xedit compile problem (Marc La France).
+ 176. Small fix for Italian keyboard map (Sebastiano Vigna).
+ 175. Don't ship xf86Bus.h and xf86pciBus.h with the SDK (Marc La France).
+ 174. Restore VGA driver's checking for depths 1, 4 & 8 (Marc La France).
+ 173. Fix a problem with savage driver when UseBIOS is off, such that the
+ performance drops dramatically. Now the performance matches or
+ exceeds that of the option UseBIOS (Alan Hourihane).
+ 172. Add workaround for problems that arise when in multi-layout map
+ different modifier keysyms share the same key (Ivan Pascal).
+ 171. Fix bug that causes XGetKeyboardMapping produce incorrect map when keys
+ have more then two keysyms. Also add a map columns duplication for better
+ compatibility with core protocol keyboard maps (Ivan Pascal).
+ 170. Fix XKB bug (Bugzilla #253) that causes an Xserver crash when XKB action
+ RedirectKey is used (Ivan Pascal).
+ 169. Add missing letters to Ukrainian phonetic keyboard map (Andriy Rysin).
+
+XFree86 4.3.99.4 (10 May 2003)
+ 168. 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
+ 167. Support for building a DRI enabled server on OpenBSD (Wilbern Cobb,
+ Matthieu Herrb).
+ 166. 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
+ 165. 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
+ 164. 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
+ 163. Add an entry to the i2c module that drivers can call to retrieve an array
+ of all I2C buses associated with a screen (Marc La France).
+ 162. 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
+ 161. Change the /dev/ file used on some *BSD's to mmap the framebuffer in DGA
+ clients to match the /dev/ file used by the server (Marc La France).
+ 160. SiS driver fixes:
+ - Added MergedFB mode (including HWCursor and Xv)
+ - Xv enhancements and fixes for all chipsets
+ - New Xv properties (SWITCHCRT, TVPOSITION, etc)
+ - Added support for custom LCD resolutions (via DDC)
+ - Fixed DVI output (DVI-D and DVI-A), automatic detection
+ - Numerous bugfixes and enhancements
+ (Thomas Winischhofer)
+ 159. Make freetype-config more useful on NetBSD (#5693, Thomas Klausner).
+ 158. Small fixes in keyboard maps:
+ - add an explicit type declaration in level3(ralt_switch)
+ (Bugzilla #225, Séamus Ó Ciardhuáin);
+ - fix wrong group number in Russian keyboard map (Ivan Pascal).
+ 157. Add rootless implementation for XDarwin using Apple's Xplugin API
+ (John Harper, Torrey T. Lyons).
+ 156. Fix precision problems in xf86XVClipVideoHelper and in Mach64 XVideo
+ support (Marc La France).
+ 155. Add missing symbols when DRI is disabled to glint driver
+ (Bugzilla #203, Mike Harris).
+ 154. Fix a memory leak caused by the data allocated in XGetDefault() never
+ being freed (Jim Radford).
+ 153. Update keysym capitalization rules in XConvertCase() with unicode
+ keysyms and some missed charsets (Bugzilla #209, Séamus Ó Ciardhuáin).
+ 152. Use C89 style function prototypes in manual pages (Bugzilla #208,
+ Aidan Kehoe).
+ 151. Fix small memory leaks in XvQueryAdaptors() and __driUtilCreateScreen()
+ (Jim Radford).
+ 150. Updated Wacom driver to support ntuos 2 2D mouse and a few styli,
+ TabletPC with ISD V4 protocol, intiq 15X and Cintiq 18SX
+ (Wacom).
+ 149. Fix programming error in ix86 motherboard chipset determination
+ (Marc La France).
+ 148. Ansi prototypes cleanup in Xserver/include and Xserver/os
+ (Matthieu Herrb).
+ 147. Fix shared libXp dependencies on *BSD and Darwin (Dale Rahn).
+ 146. 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
+ 145. 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
+ 144. Portability changes for older Sun compilers (Alan Coopersmith).
+
+XFree86 4.3.99.3 (25 April 2003)
+ 143. Fix building of the dristat and drmstat utilities (David Dawes).
+ 142. From the DRI trunk...
+ - Remove more dead code from the BSD DRM (Eric Anholt).
+ - Remove some #if 0'd code and unused string functions from the Linux
+ DRM (Keith Whitwell).
+ - Move debug versions of the DRM memory functions to a new file
+ (Keith Whitwell).
+ - drm_memory cleanup (Leif Delgass).
+ - dristat and drmstat cleanups (Leif Delgass).
+ - Remove unused dev->map_count (Leif Delgass).
+ - For the i830 DRM driver, pass the dma handle from pci_alloc_consistent
+ to the card for status page rather than using virt_to_bus on
+ the virtual address (Leif Delgass).
+ - Cleanup the style of the linux-compat code in the BSD DRM, and use
+ ioctl directly rather than reimplementing it (Eric Anholt).
+ 141. Remove old XF86Setup source code. (Matthieu Herrb).
+ 140. Only add all default modes to mode list when RandR is enabled and
+ active (Egbert Eich).
+ 139. MGA driver: vertical blanking can generate interrupt (2D driver part)
+ (Ville Syrjala Bugz.: 199).
+ 138. Fix mmapw SEGV (Marc La France).
+ 137. From the DRI trunk...
+ - Install dummy/noop read & poll fops unless the driver has
+ replacements (Keith Whitwell).
+ - Remove gamma-specific stuff from the BSD DRM (Eric Anholt).
+ - Remove DRM_DMA_HISTOGRAM and associated code from the BSD DRM
+ (Eric Anholt).
+ - Remove BSD DRM's unused drm_init.h (Eric Anholt).
+ - Handle read() failures in the drm X server module (Michel Daenzer).
+ - Set DRM device major for NetBSD.
+ 136. Fix bug that prevented fbman from using the last partial scanline of a
+ Mach64 framebuffer (Marc La France).
+ 135. Make ATI Mach64 FIFO cache integrity testing optional (Marc La France).
+ 134. Export ATI Mach64 hardware overlay as an XVideo adaptor (derived from
+ GATOS project, Egbert Eich, Marc La France).
+ 133. Reorganise ATI Mach64 support into separate source files
(Marc La France).
- 975. Fix bug in mode validation that occurs when the XF86Config doesn't
+ 132. Refine atimisc's decoding of the panel mode on server entry in an attempt
+ to reduce the effect of atyfb bugs (Marc La France).
+ 131. Make Rage128 and Radeon XVideo available even when 2D acceleration is
+ disabled (Marc La France).
+ 130. There is no longer any need to require hardware cursors during Rage128
+ and Radeon XVideo displays (Marc La France).
+ 129. Initialise v4l's XVideo adaptors last (Marc La France).
+ 128. Reduce cut&paste effects by adding more helpers to Xv
+ (derived from #5645, Björn Augustsson, Marc La France).
+ 127. Centralise a region comparison primitive into 'mi' and use it instead of
+ local definitions throughout the server (Marc La France).
+ 126. DPMSExtension & XvExtension driver cleanups (Marc La France).
+ 125. Add missing tests for vtSema to xaa 'Picture' functions.
+ These missing checks caused strange behavior with some drivers
+ when RENDER extension requests were made while X was switched away.
+ (Egbert Eich).
+ 124. i810 driver: call drmCtlUninstHandler() on CloseScreen()
+ (David Airlie).
+ 123. Savage driver updated to 1.1.1.27: several fixes for video glitches
+ (Tim Roberts).
+ 122. Put back the DRM part of Charl Botha's Radeon suspend/resume support
+ that was inadvertently backed out in the DRI resync last week.
+ 121. Resync the Linux drm modules with the DRI trunk. Includes:
+ - Check for NULL map before calling DRM(ioremapfree) on cleanup
+ (Leif Delgass).
+ - Remove DRM read, poll and write_string (Keith Whitwell).
+ - Add more get_param queries for embedded project (Keith Whitwell).
+ - Move a bunch of gamma-specific code into a gamma-specific file,
+ and restore the kooky DRM(write_string) code for gamma
+ (Keith Whitwell).
+ - Remove unused DMA histogram code (Keith Whitwell).
+ - Remove unused 'DRM_FLAG_NOCTX' option (Keith Whitwell).
+ - Remove unused __HAVE_KERNEL_CTX_SWITCH code (Keith Whitwell).
+ - Fix templates so the i8x0 drivers don't have to define
+ __HAVE_DMA_WAITLIST (Keith Whitwell).
+ - Gamma drm updates (Alan Hourihane).
+ - Only mga, i810, i830 require AGP (Leif Delgass).
+ - Remove PCIGART_ENABLED define for radeon, pcigart support now
+ included for any arch (Leif Delgass).
+ - Get rid of superfluous fields in struct drm_radeon_ring_buffer
+ (Michel Daenzer).
+ - Use correct address for radeon ring read pointer writeback
+ (Michel Daenzer).
+ 120. Fix a potential bug in ZX1 support (Marc La France).
+ 119. Fix a buffer overflow in xkbprint (Ivan Pascal).
+ 118. Fix a bug in Xlib that prevents a vertical text drawing with
+ X[mb|wc]DrawString (bugzilla #178, OSAME Ken-ichiro).
+ 117. Added missing files to the SDK so it can actually be used (Sven Luther).
+ 116. mkfontscale enhancements (bugzilla #166, Julius Chroboczek).
+ 115. Fix handling of local host names in /etc/X<n>.hosts (bugzilla #156,
+ Alan Coopersmith).
+ 114. Add to XLookupString an automatic search of the layout which keysym can
+ be converted to a control-code when Control modifier is set (Ivan Pascal).
+ 113. Fix xkbcomp crash with some combinations of layouts in a multi-layout
+ keyboard map (Ivan Pascal).
+ 112. Keyboard maps cleanups, including:
+ - fix incorrect aliases in a keycodes file.
+ - remove unneeded type declarations.
+ - remove ThirdLevel modifier key descriptions in maps and replace them
+ with references to a common one in 'level3' file.
+ - some cosmetic changes.
+ (Ivan Pascal).
+ 111. Fix some function definition conflicts from Xlib cleanup when X_LOCALE
+ or NeedWidePrototypes is set (Torrey T. Lyons).
+ 110. Resync the BSD drm modules with the DRI trunk (Eric Anholt).
+ 109. Resync the Linux drm modules with the DRI trunk. Includes:
+ - Add 2nd arg for DRM_FREE (Keith Whitwell).
+ - Use file pointers instead of pids for resource and lock tracking
+ (Keith Whitwell).
+ - Add 'SG' map type identifier string ((pci scatter/gather) to /proc vm
+ info (Leif Delgass).
+ - Use list_entry() to get container struct from struct list_head
+ pointers. Build fix for RedHat 9 kernel (5 args to
+ remap_page_range()) (Leif Delgass).
+ 108. Fix a server crash with shadowfb and render when refreshing outside the
+ visible screen (Sven Luther).
+ 107. Fix a potential infinite loop during server generation when in
+ Xinerama (Rik Faith).
+ 106. Fix DRM module build on 2.5.41 and later kernels (tqueue -> workqueue)
+ (David Dawes).
+ 105. Fix lockup when using Xv in the trident driver (Alan Hourihane).
+ 104. Add support for TV chipsets VT1621 and CH7005 to the trident driver
+ (VIA, Alan Hourihane).
+ 103. Add VIA CLE266 driver (Bugzilla #154, VIA/S3)
+ 102. Remove non-functioning glxStub, and remove external GlxStaticServerLib
+ support (David Dawes).
+ 101. Change the WORLDOPTS default to empty. This means that 'make World'
+ will now stop on the first error. To get the old behaviour, run
+ 'make WORLDOPTS=-k World' (David Dawes).
+ 100. Add preliminary version of generic rootless code based on XDarwin's
+ rootless mode (Torrey T. Lyons, John Harper).
+ 99. Remove PEX and XIE source code (Matthieu Herrb).
+ 98. The XKB version of XRefreshKeyboardMapping() had an UnlockDisplay()
+ call without a preceding LockDisplay() call (Yoel Perl).
+ 97. Xlib cleanups and fixes, including:
+ - Fixed up any old style function defintions that raised warnings.
+ - Fixed functions with no parameter or return value.
+ - Moved any external prototype in a c-files to h-files.
+ - Set unreferenced and unmentioned functions to static.
+ - Completed any forward declartion with its calling parameters.
+ - Established function typedefs where might be helpful.
+ - Fixed bogus XIM callback function to XID type, fixed XPointer* -
+ XPointer mismatch on some callback.
+ - Added explicit FIXME XXX statement on locations for the work around
+ macro XCMS_CONVERSION_HARDWARE where the compiler was unsatisfied
+ about a known problem with the currently inconsistent src_to_CIEXYZ
+ table types.
+ - Split _XcmsSetGetColor and *Colors handling routine in order
+ to avoid any type conflicts there, fixed a memory leak for
+ error case in that area. Used stack based Buffer for single-color
+ version (should be simpler and faster).
+ - Fixed _XAsyncReply where a "register variable pend" was passed
+ and returned with the & operator. This location is further
+ suspect of variable size problems on anything else but 32 bit
+ platforms, with the new code it might more likely raise a type
+ mismatch warning for those specific location.
+ (#A.1729, Alexander Stohr).
+ 96. Fix the <KPDL> mapping for the hr XKB map, and add an hr_US map (#A.1726,
+ Vlatko Kosturjak).
+ 95. Fix vmware driver crash when running two X servers concurrently (#5688,
+ Nolan Leake).
+ 94. Rework the Linux drm kernel module build to leverage off the standard
+ kernel build system. This is based on suggestions and examples from
+ David Woodhouse. This approach has the advantage that the build
+ requirements of a wider range of standard kernels are now supported
+ transparently, but the disadvantage of some extra complexity to handle
+ building against clean vendor-distributed kernel source trees.
+ This has been tested with some recent Red Hat and SuSE distributions
+ (David Dawes).
+ 93. Update Italian keyboard map (Bugzilla #109, Sebastiano Vigna).
+ 92. Add keys missed in multi-layout keyboard maps: LSGT key in Belgian map
+ and 'old','phonetic' variants in Armenian map (Ivan Pascal).
+ 91. More reliable workaround for handling the I830Sync() function being
+ called while VT switched away (David Dawes).
+ 90. Fix references to DRI functions in non-DRI i810_driver.c build
+ (David Dawes).
+ 89. Import expat 1.95.4 (Matthieu Herrb).
+
+XFree86 4.3.99.2 (10 April 2003)
+ 88. Fix file descriptor leaks in xman (Ted Unangst, OpenBSD PR#3186).
+ 87. 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
+ 86. Resetting 'bound' flag for an agp entry after undbind succeeded in
+ drm_agpsupport.h (Egbert Eich).
+ 85. Ignoring hw_lock for drm device if lock was set by a different instance
+ (ie Xserver) to prevent second server to spin in driver release function
+ (currently only relevant for i8xx drm drivers) (David Dawes).
+ 84. Adding extra delay before doing a slowBcopy in ia64 to prevent a MC
+ when saving/restoring VGA fonts (Egbert Eich).
+ 83. Turn off needToSync in LeaveVT() in i830 driver to prevent server
+ crashes because xaa tries to sync blitter while switched away
+ (Egbert Eich).
+ 82. Added the O_SYNC flag when opening /dev/mem to work around a kernel bug
+ which causes conflits between WC settings in MTRR registers and cacheable
+ attribute in page table (Egbert Eich).
+ 81. Reduced retry count for mouse configuration to 4. This should speed
+ up server start for people who use a mouse repeater like gpm
+ (Egbert Eich).
+ 80. Fixed xf86cfg to duplicate font names before they get freed when
+ unloading the module (Egbert Eich).
+ 79. Added missing functions to xf86cfg (Egbert Eich).
+ 78. Added missing ROP_NEEDS_SOURCE to Savage driver;
+ now all 2D accel functions should use this flag (Egbert Eich).
+ 77. Reduced flicker with video playback in Savage driver (Tim Roberts).
+ 76. Load vgahw submodule in RENDITION driver before using it
+ (Egbert Eich).
+ 75. Magically speed up video playback on Neomagic (Egbert Eich).
+ 74. Added drmAgpUnbind()/drmAgpBind() functionality on Leave/Enter for i810
+ cards to allow a second Xserver to be started if the first one has
+ DRI enabled (Egbert Eich).
+ 73. Set NeedRingBufferLow for i855/i865 to avoid lockups on vt switches
+ (Egbert Eich).
+ 72. Check for vtSema before accessing registers in I830BIOSSaveScreen()
+ (Egbert Eich).
+ 71. Some sanity fixes for atiprobe to work better with xf86cfg: Handle
+ situation gracefully if the PCI config pointer doesn't exist
+ (Egbert Eich).
+ 70. Changed behavior of fontfile: don't drop the entire directory if some
+ fonts cannot be rendered (Egbert Eich).
+ 69. Fixed B&H bdf fonts: AVERAGE_WIDTH is not a string but an int (Mike Fabian).
+ 68. Fixed type in radeon driver which caused display to go into
+ powersaving mode when Xcursor is disabled (Bugz: 90, Michel Dänzer).
+ 67. Fixed typo in XKB-Config.sgml (Bugz: 53, Hiroyuki Bessho).
+ 66. Fix SiliconMotion driver for mode switching and SEGV problem when
+ initializing Xv functionality (Bugzilla #50, Alan Hourihane).
+ 65. Add Radeon DRI suspend/resume support (Charl Botha, #A.1431).
+ 64. Rage 128 Xv fix for high resolution displays (Rik Faith).
+ 63. PPC updates for Radeon (Michel Dänzer, Hui Yu@ATI).
+ 62. Radeon patch from ATI (Hui Yu@ATI).
+ - IGP320/330/340 support (2D only)
+ - RV280 (9200/M9+) support
+ - Fix for some M9 laptop panels
+ - Improved version of monitor detection code previously submitted
+ - Fixed bug for two or more radeon cards
+ - Man page updates
+ - Workaround for double scan modes problem at high resolutions
+ - Overlay scaling problem when RMX is used
+ 61. Fix xprop to get all windows (not only the first) in a property holding
+ a window list printed (#A.1676, Kim Woelders).
+ 60. Fix for spontaneous repeated keyboard events during sync grab (#A.1713,
+ Michal Maruska).
+ 59. Fixed DPMS problem on C&T 69000 due to incorrect LCD flag
+ (Bugzilla #101, Egbert Eich).
+ 58. Added xkb symbols layout for BTC 5090 internet keyboard
+ (Bugzilla #57, Jack Angel).
+ 57. Fix the Xinstall.sh script so that it can handle being run from a
+ directory with white space in its path name (#A.1690, Eric Branlund).
+ 56. Allow AGPGART support to be enabled for OpenBSD (#A.1684, Brian Feldman).
+ 55. Make the mouse driver check the SendDragEvents option (based on #A.1682,
+ Juuso Åberg).
+ 54. Fix a double allocation in _XTextPropertyToTextList() (#A.1681,
+ Lubos Lunak).
+ 53. Fix a typo that causes the 'yu' keymap to emit a lower case 'L' in
+ both shift states (#A.1675, Nikola Smolenski).
+ 52. Allow the remote shell command for xon to be specified from the
+ command line. This allows ssh to be used (for example) (#A.1657,
+ Mike Urban).
+ 51. Fix segfaults that can happen when using composition of RENDER and
+ non-RENDER fonts (#A.1656, Wu Jian Feng).
+ 50. Add convenient ways to enter "double quote" and "cedilla" with the
+ en_US.UTF-8 compose rules (Alexandre Oliva).
+ 49. Improve support for Wacom Cintiq boards (#A.1547, Sebastian Rittau).
+ 48. Add support for Kensington's "ValuMouse" to the mouse driver (#A.1494,
+ Roy Wood).
+ 47. Workaround for a crash that happens if a scalable font has a bitmap
+ entry in fonts.dir (#5687, Juliusz Chroboczek).
+ 46. Single/dual rasterizer quiescence patch for the glint/gamma DRI driver
+ (#5685, Sven Luther).
+ 45. Fix a FreeBSD/alpha build problem (#5679, Fred Clift).
+ 44. Fix a bug in the GLU/project.3gl man page (#5676, Thomas Klausner).
+ 43. Luit fixes:
+ - Fix a buffer overflow.
+ - Allow for holes in the pty space, and use the union of the pty
+ names in 4.4BSD and recent FreeBSD.
+ - Allow luit to be set-uid on all BSD releases, and introduce an
+ additional security fix on POSIX saved-id systems.
+ (#5672, 5674, ITO Tsuyoshi, Juliusz Chroboczek).
+ 42. Fix memory leaks in ProcXF86VidModeModModeLine and
+ ProcXF86VidModeValidateModeLine, and unintialized fields of the mode
+ structure in ProcXF86VidModeAddModeLine, VidModeCreateMode, and
+ VidModeAddModeline (#5671, Miguel Freitas).
+ 41. Fix SEGV in fbdev's mode validation (Alexandr Andreev).
+ 40. Add two more variations of Thai XKB maps (#5658,
+ Theppitak Karoonboonyanan, Visanu Euarchukiati,
+ Supphachoke Santiwichaya).
+ 39. Fix a twm crash when the window menu is used and no windows are open
+ (#5667, Matthias Scheler).
+ 38. Restore the sign of UNDERLINE_POSITION in the FreeType backend (#5665,
+ Roman Kagan).
+ 37. Check the return value of fclose() in xauth to prevent losing the
+ existing contents of an Xauthority file when there is insufficient
+ space to write the new one (#5663, Owen Taylor).
+ 36. Fix case in xmag which would cause a BadMatch during a X_GetImage for
+ single child of root class InputOnly. Also do some null pointer
+ protection (#5657, Kevin Brosius).
+ 35. Allow an arbitary message to be sent to the DDX by pressing a key
+ which has the appropriate action definition (#5519, Joe Moss).
+ 34. Add a new request to the XF86Misc extension that allows a client
+ to send an arbitrary message to the DDX, which in turn can send the
+ message to the driver. The driver may also send a string back.
+ An example of this is implemented for the radeon driver (#5518,
+ Joe Moss).
+ 33. Remove duplicate XShmGetEventBase() declaration (#5656,
+ Branden Robinson).
+ 32. Fix drag lock when using a mouse button greater than 4
+ (Bugzilla #51, Paul Elliott)
+ 31. Fix lockup on server shutdown/restart with the radeon driver
+ (Bugzilla #94, Michel Dänzer).
+ 30. Add missing symbols to reference list that show up when DRI is not
+ loaded in r128 driver (Bugzilla #83, Leif Delgass).
+ 29. Add missing symbols to reference list that show up when DRI is not
+ loaded in mga driver (Bugzilla #84, Leif Delgass).
+ 28. Various build and warning fixes (#A.1703, Peter Breitenlohner).
+ 27. Avoid overlapping strcpy() in imake.c (Dan Nelson).
+ 26. Updates for building on OS/2 (#5650, Frank Giessler).
+
+XFree86 4.3.99.1 (23 March 2003)
+ 25. Xterm patch #176 (Thomas Dickey).
+ 24. 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
+ 23. int10 fix for all ix86 non-Linux systems (Marc La France).
+ 22. Add preliminary support for generating HTML and PDF versions of most
+ spec documents (David Dawes).
+ 21. Use lower-case extensions uniformly for text and PostScript documents
+ (based on #4876, Branden Robinson).
+ 20. Disable cuase of SEGV's in rendition driver (Marc La France).
+ 18. Limit 440EX & 440LX based systems to 32 PCI buses (Marc La France).
+ 18. Fix typo that caused incorrect initialization of xkb memory
+ (John Heasley).
+ 17. Fix bug in trident driver that caused old Cyber 9382/9385 chipsets
+ to display half a jittered screen (Alan Hourihane).
+ 16. Add shadowfb support to XDarwin IOKit mode (Torrey T. Lyons).
+ 15. Change most of os-support/ to respect VIDMEM_READONLY (Marc La France).
+ 14. 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
+ 13. setjmp/longjmp related fixes for Linux/libc5 systems (Marc La France).
+ 12. Fix possible overflow in _XlcLocaleDirName. (Matthieu Herrb).
+ 11. Various NetBSD fixes for non-i386 (#5662, #5666 Aymeric Vincent,
+ Matthew Green, Chris Gilbert, Thomas Klausner).
+ 10. Enable native thread support on NetBSD 1.6M and later (#5597, #5660,
+ Matthias Scheler).
+ 9. 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
+ 8. Fix for non-PC keyboard bug introduced by changes to make SysRq
+ generate the same keycode as PrtScrn (Ivan Pascal).
+ 7. Workaround for problems linking C programs against libGLU on FreeBSD 3.x
+ (David Dawes).
+ 6. Make setjmp/longjmp emulation save/restore blocked signal masks on all
+ 5. 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
+ 4. 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).
+ 3. Fix minor glitch in the generation of Makefiles for libraries that don't
+ need threads support (Marc La France).
+ 2. Fix XDarwin build broken by #960 (Shantonu Sen).
+ 1. 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
@@ -91,7 +1741,7 @@ XFree86 4.3.0 (27 February 2003)
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).
+ bigger then the associated top level window (John Harper).
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
@@ -443,14 +2093,14 @@ XFree86 4.2.99.901 (4 February 2003)
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).
+ window pixmap pointers are 32-bit aligned (John Harper, 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).
+ root buses (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
@@ -483,7 +2133,7 @@ XFree86 4.2.99.901 (4 February 2003)
(#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).
+ 772. Fix XDarwin rootless crash when resizing a window (John Harper).
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
@@ -495,7 +2145,7 @@ XFree86 4.2.99.901 (4 February 2003)
(reported by Alexis Vartanian).
XFree86 4.2.99.4 (20 January 2003)
- 766. Fix XDarwin's rootless mode with 16-bit color (Apple).
+ 766. Fix XDarwin's rootless mode with 16-bit color (John Harper).
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
@@ -16580,7 +18230,7 @@ XFree86 3.0a (28 April 1994)
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 $
+$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2982 2003/11/21 06:01:42 dawes Exp $
diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/devel/README.DRIcomp
index 1e9773ccc..0f1bd1b69 100644
--- a/hw/xfree86/doc/devel/README.DRIcomp
+++ b/hw/xfree86/doc/devel/README.DRIcomp
@@ -374,6 +374,13 @@ a 2.4.x kernel, you should add the following:
#define MesaUseSSE YES
+If you want to build the DRM kernel modules as part of the full build pro-
+cess, add the following:
+
+ #define BuildXF86DRM YES
+
+Otherwise, you'll need to build them separately as described below.
+
8.3 Compilation
To compile the complete DRI tree:
@@ -401,11 +408,21 @@ work with XFree86/DRI.
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:
+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.
+
+If you edited your host.def file to enable automatic building of the DRI ker-
+nel module(s), verify that they were built:
cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
ls
+Otherwise, build them now by running
+
+ cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
+ make -f Makefile.linux
+
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.
@@ -416,17 +433,14 @@ 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,
+source tree. This can be fixed by explicitly setting the value of LINUXDIR.
+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.
+ make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x
-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.
+or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN-
+UXDIR line.
8.5 DRI kernel module installation
@@ -537,7 +551,7 @@ 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 $
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.20 dawes Exp $
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.16 2002/11/26 02:24:01 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.17 2003/07/15 02:28:28 dawes Exp $
diff --git a/hw/xfree86/doc/sgml/DESIGN.sgml b/hw/xfree86/doc/sgml/DESIGN.sgml
index 322ab00e0..365acaf1a 100644
--- a/hw/xfree86/doc/sgml/DESIGN.sgml
+++ b/hw/xfree86/doc/sgml/DESIGN.sgml
@@ -36,7 +36,7 @@
<ident>
-$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.52 2003/02/25 19:31:00 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.53 2003/08/23 14:10:14 dawes Exp $
</ident>
@@ -6784,11 +6784,13 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags)
*/
/*
- * Set the depth/bpp. Our preferred default depth/bpp is 8, and
- * we support both 24bpp and 32bpp framebuffer layouts.
+ * Set the depth/bpp. Use the globally preferred depth/bpp. If the
+ * driver has special default depth/bpp requirements, the defaults should
+ * be specified here explicitly.
+ * We support both 24bpp and 32bpp framebuffer layouts.
* This sets pScrn->display also.
*/
- if (!xf86SetDepthBpp(pScrn, 8, 8, 8,
+ if (!xf86SetDepthBpp(pScrn, 0, 0, 0,
Support24bppFb | Support32bppFb)) {
return FALSE;
} else {
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index b08379099..409ada437 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.38 2002/11/20 18:10:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.39 2003/11/10 18:21:41 tsi Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -1557,7 +1557,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
if(pDRIPriv->nrWindows > 0) {
RegionRec reg;
- REGION_INIT(pScreen, &reg, NullBox, 0);
+ REGION_NULL(pScreen, &reg);
TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
if(REGION_NOTEMPTY(pScreen, &reg)) {
diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h
index 99c04b9e9..fcb4b59bd 100644
--- a/hw/xfree86/dri/sarea.h
+++ b/hw/xfree86/dri/sarea.h
@@ -1,40 +1,41 @@
-/* $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.
-
-**************************************************************************/
+/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */
+/**
+ * \file sarea.h
+ * SAREA definitions.
+ *
+ * \author Kevin E. Martin <kevin@precisioninsight.com>
+ * \author Jens Owen <jens@tungstengraphics.com>
+ * \author Rickard E. (Rik) Faith <faith@valinux.com>
+ */
/*
- * Authors:
- * Kevin E. Martin <kevin@precisioninsight.com>
- * Jens Owen <jens@tungstengraphics.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
+ * 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.
*/
+/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */
+
#ifndef _SAREA_H_
#define _SAREA_H_
@@ -54,11 +55,21 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
+/**
+ * SAREA per drawable information.
+ *
+ * \sa _XF86DRISAREA.
+ */
typedef struct _XF86DRISAREADrawable {
unsigned int stamp;
unsigned int flags;
} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
+/**
+ * SAREA frame information.
+ *
+ * \sa _XF86DRISAREA.
+ */
typedef struct _XF86DRISAREAFrame {
unsigned int x;
unsigned int y;
@@ -67,10 +78,13 @@ typedef struct _XF86DRISAREAFrame {
unsigned int fullscreen;
} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
+/**
+ * SAREA definition.
+ */
typedef struct _XF86DRISAREA {
- /* first thing is always the drm locking structure */
+ /** first thing is always the DRM locking structure */
drmLock lock;
- /* NOT_DONE: Use readers/writer lock for drawable_lock */
+ /** \todo Use readers/writer lock for drawable_lock */
drmLock drawable_lock;
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
XF86DRISAREAFrameRec frame;
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index 7920b217d..3df0cca59 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.12 2002/12/14 01:36:08 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.13 2003/09/24 02:43:12 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -241,7 +241,7 @@ ProcXF86DRIAuthConnection(
rep.authenticated = 1;
if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
- ErrorF("Failed to authenticate %u\n", stuff->magic);
+ ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic);
rep.authenticated = 0;
}
WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);
diff --git a/hw/xfree86/dummylib/dummylib.h b/hw/xfree86/dummylib/dummylib.h
index 4b685e272..d8a0d285a 100644
--- a/hw/xfree86/dummylib/dummylib.h
+++ b/hw/xfree86/dummylib/dummylib.h
@@ -1,8 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.1 2000/02/13 03:06:38 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.2 2003/09/09 03:20: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/logvwrite.c b/hw/xfree86/dummylib/logvwrite.c
new file mode 100644
index 000000000..75634d7f3
--- /dev/null
+++ b/hw/xfree86/dummylib/logvwrite.c
@@ -0,0 +1,18 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/logvwrite.c,v 1.1 2003/09/09 03:20:38 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+LogVWrite(int verb, const char *format, va_list ap)
+{
+ if (xf86Verbose >= verb)
+ vfprintf(stderr, format, ap);
+}
+
diff --git a/hw/xfree86/dummylib/xf86drvmsg.c b/hw/xfree86/dummylib/xf86drvmsg.c
index ffcefd6bf..5780d9c13 100644
--- a/hw/xfree86/dummylib/xf86drvmsg.c
+++ b/hw/xfree86/dummylib/xf86drvmsg.c
@@ -1,10 +1,9 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
-#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@@ -16,7 +15,7 @@ xf86DrvMsg(int i, MessageType type, const char *format, ...)
va_list ap;
va_start(ap, format);
- VErrorFVerb(1, format, ap);
+ LogVWrite(1, format, ap);
va_end(ap);
}
diff --git a/hw/xfree86/dummylib/xf86drvmsgverb.c b/hw/xfree86/dummylib/xf86drvmsgverb.c
index f59c42abf..b7c0ddb53 100644
--- a/hw/xfree86/dummylib/xf86drvmsgverb.c
+++ b/hw/xfree86/dummylib/xf86drvmsgverb.c
@@ -1,10 +1,9 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
-#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@@ -16,7 +15,7 @@ xf86DrvMsgVerb(int i, MessageType type, int verb, const char *format, ...)
va_list ap;
va_start(ap, format);
- VErrorFVerb(verb, format, ap);
+ LogVWrite(verb, format, ap);
va_end(ap);
}
diff --git a/hw/xfree86/dummylib/xf86errorf.c b/hw/xfree86/dummylib/xf86errorf.c
index 072f639ca..122f46d43 100644
--- a/hw/xfree86/dummylib/xf86errorf.c
+++ b/hw/xfree86/dummylib/xf86errorf.c
@@ -1,10 +1,9 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.2 2000/05/31 07:15:05 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.3 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
-#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@@ -16,7 +15,7 @@ xf86ErrorF(const char *format, ...)
va_list ap;
va_start(ap, format);
- VErrorFVerb(1, format, ap);
+ LogVWrite(1, format, ap);
va_end(ap);
}
@@ -26,6 +25,6 @@ ErrorF(const char *format, ...)
va_list ap;
va_start(ap, format);
- VErrorFVerb(1, format, ap);
+ LogVWrite(1, format, ap);
va_end(ap);
}
diff --git a/hw/xfree86/dummylib/xf86errorfverb.c b/hw/xfree86/dummylib/xf86errorfverb.c
index 61bff15a5..61c3e02a2 100644
--- a/hw/xfree86/dummylib/xf86errorfverb.c
+++ b/hw/xfree86/dummylib/xf86errorfverb.c
@@ -1,10 +1,9 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
-#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@@ -16,7 +15,7 @@ xf86ErrorFVerb(int verb, const char *format, ...)
va_list ap;
va_start(ap, format);
- VErrorFVerb(verb, format, ap);
+ LogVWrite(verb, format, ap);
va_end(ap);
}
diff --git a/hw/xfree86/dummylib/xf86msg.c b/hw/xfree86/dummylib/xf86msg.c
index bc8c76626..2d36bea97 100644
--- a/hw/xfree86/dummylib/xf86msg.c
+++ b/hw/xfree86/dummylib/xf86msg.c
@@ -1,10 +1,9 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
-#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@@ -16,7 +15,7 @@ xf86Msg(MessageType type, const char *format, ...)
va_list ap;
va_start(ap, format);
- VErrorFVerb(1, format, ap);
+ LogVWrite(1, format, ap);
va_end(ap);
}
diff --git a/hw/xfree86/dummylib/xf86msgverb.c b/hw/xfree86/dummylib/xf86msgverb.c
index b9e343fd9..f460b6b9f 100644
--- a/hw/xfree86/dummylib/xf86msgverb.c
+++ b/hw/xfree86/dummylib/xf86msgverb.c
@@ -1,10 +1,9 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
-#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@@ -16,7 +15,7 @@ xf86MsgVerb(MessageType type, int verb, const char *format, ...)
va_list ap;
va_start(ap, format);
- VErrorFVerb(verb, format, ap);
+ LogVWrite(verb, format, ap);
va_end(ap);
}
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index a90fff34c..752cdb044 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.30 2002/11/25 14:05:00 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.33 2003/10/30 17:37:16 tsi Exp $ */
/* all driver need this */
#include "xf86.h"
@@ -462,7 +462,7 @@ fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
int virtY = pScrn->display->virtualY;
struct fb_var_screeninfo var;
char **modename;
- DisplayModePtr mode,this,last = NULL;
+ DisplayModePtr mode,this,last = pScrn->modes;
TRACE_ENTER("VerifyModes");
if (NULL == pScrn->display->modes)
@@ -542,7 +542,7 @@ fbdevHWUseBuildinMode(ScrnInfoPtr pScrn)
/* -------------------------------------------------------------------- */
-void
+static void
calculateFbmem_len(fbdevHWPtr fPtr)
{
fPtr->fboff = (unsigned long) fPtr->fix.smem_start & ~PAGE_MASK;
@@ -747,7 +747,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
/* -------------------------------------------------------------------- */
/* these can be hooked directly into ScrnInfoRec */
-int
+ModeStatus
fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
@@ -789,6 +789,11 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
TRACE_ENTER("AdjustFrame");
+
+ if ( x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual ||
+ y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual )
+ return;
+
fPtr->var.xoffset = x;
fPtr->var.yoffset = y;
if (-1 == ioctl(fPtr->fd,FBIOPAN_DISPLAY,(void*)&fPtr->var))
diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
index 78a5b5882..cfc47f905 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.h
+++ b/hw/xfree86/fbdevhw/fbdevhw.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.11 2001/10/01 13:44:12 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.12 2003/10/30 17:37:16 tsi Exp $ */
#ifndef _FBDEVHW_H_
#define _FBDEVHW_H_
@@ -40,7 +40,7 @@ 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);
+ModeStatus 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);
diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c
index 02086ef8f..b262be90f 100644
--- a/hw/xfree86/fbdevhw/fbdevhwstub.c
+++ b/hw/xfree86/fbdevhw/fbdevhwstub.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.12 2001/10/28 03:33:55 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.13 2003/10/30 17:37:16 tsi Exp $ */
#include "xf86.h"
#include "xf86cmap.h"
@@ -130,7 +130,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
{
}
-int
+ModeStatus
fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
return MODE_ERROR;
diff --git a/hw/xfree86/getconfig/cfg.man.pre b/hw/xfree86/getconfig/cfg.man.pre
new file mode 100644
index 000000000..fcf1a6161
--- /dev/null
+++ b/hw/xfree86/getconfig/cfg.man.pre
@@ -0,0 +1,138 @@
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/cfg.man,v 1.1 2003/11/12 04:52:15 dawes Exp $
+.TH getconfig __filemansuffix__ __vendorversion__
+.SH NAME
+getconfig - meta configuration files for getconfig(1)
+.SH SYNOPSIS
+.B \(**.cfg
+.SH DESCRIPTION
+.B getconfig
+is a programatic interface that is used by the
+.B XFree86
+server to get configuration information about video hardware when
+operating without an
+.B XF86Config
+file.
+.PP
+This implementation of
+.B getconfig
+is written in perl. It processes rules from meta-configuration files.
+All meta-configuration files have a
+.I .cfg
+suffix.
+.PP
+Lines starting with a pound-sign (#) are comments, and are ignored.
+Blank lines that consist only of white space are also treated as comments
+and ignored.
+.PP
+The first non-comment line must be a signature string followed by
+the file format version number. The signature string is
+.PP
+.RS 4
+.nf
+"XFree86 Project getconfig rules file.\ \ Version: "
+.fi
+.RE
+.PP
+The currently defined version is "1.0". Files that do not have the
+correct signature string are ignored.
+.PP
+The remaining non-comment lines define rules. The start of a new rule
+is indicated by a line with no leading white space. Subsequent lines
+making up a rule must be indented with white space. Logical lines within
+a rule may be split over multiple physical lines by using the usual
+continuation convention ('\e' at the end of the line). The first logical
+line of each rule is a perl expression. It may be any valid perl
+expression whose evaluated (with 'eval') result may be used as the
+argument to a perl 'if' statement. The second logical line should be
+the name of the XFree86 video driver to use when the rule is true, and
+subsequent logical lines of each rule, if present, are additional
+configuration output for the video device's
+.B XF86Config
+.B Device
+section. The driver name and additional lines of configuration information
+are written to standard output when the rule is chosen as the successful
+rule.
+.PP
+Pseudo rules consisting of perl expressions may be present in the file
+for the purpose of defining custom perl variables or setting the weight
+to use for the following rules. Pseudo rules are rules that consist of
+a single logical line only, and the are never candidates themselves for the
+successful rule.
+.PP
+Several perl variables are pre-defined, and may be used within rules.
+They include:
+.PP
+.RS 4
+.nf
+.BR "$vendor " "PCI vendor ID"
+.BR "$device " "PCI device ID"
+.BR "$revision " "PCI revision ID"
+.BR "$subsys " "PCI subsystem ID"
+.BR "$subsysVendor " "PCI subsystem vendor ID"
+.BR "$class " "PCI class"
+.BR "$XFree86Version " "XFree86 version, as a 'v' string"
+.BR "$XFree86VersionNumeric " "XFree86 numeric version"
+.BR "$XFree86VersionMajor " "XFree86 major version"
+.BR "$XFree86VersionMinor " "XFree86 minor version"
+.BR "$XFree86VersionPatch " "XFree86 patch version"
+.BR "$XFree86VersionSnap " "XFree86 snap version"
+.BR "$weight " "current rule weight"
+.fi
+.RE
+.PP
+The
+.B $weight
+variable deterines the weight of the rules as they are processed. The
+weight for subsequent rules may be set with a pseudo rule that sets or
+changes the value of
+.BR $weight .
+The default weight, and the weight used for built-in rules is 500. The
+meta-configuration files are processed in an unpredictable order. The
+weighting of the rules is used to determine their relative priority
+.PP
+After processing all of the rules, both built-in and those read from
+the meta-configration files, the
+.B getconfig
+program chooses as the successful rule the last and highest weighted
+rule that evaluates to true.
+.SH FILES
+.I .cfg
+files located in the search path. The search path typically specified
+by the
+.B XFree86
+server is:
+.PP
+.RS 4
+.nf
+.I /etc/X11
+.I __projectroot__/etc/X11
+.I <modulepath>
+.I __projectroot__/lib/X11/getconfig
+.fi
+.RE
+.PP
+where
+.I <modulepath>
+is the
+.B XFree86
+server's module search path.
+.PP
+.TP 30
+.I __projectroot__/lib/X11/getconfig/xfree86.cfg
+Default rules file that gets installed. This file doesn't contain any
+rules by default.
+.TP 30
+.I __projectroot__/lib/X11/getconfig/cfg.sample
+A sample rules file that gives some examples of what types of rules can
+appear in rules files.
+
+.SH "SEE ALSO"
+getconfig(1),
+XFree86(1),
+XF86Config(__filemansuffix__).
+
+.SH AUTHORS
+The XFree86 automatic configuration support and the
+.B getconfig
+interface was written by David H. Dawes, with the support of X-Oz
+Technologies.
diff --git a/hw/xfree86/getconfig/cfg.sample b/hw/xfree86/getconfig/cfg.sample
new file mode 100644
index 000000000..acf262d1a
--- /dev/null
+++ b/hw/xfree86/getconfig/cfg.sample
@@ -0,0 +1,111 @@
+# $DHD: xc/programs/Xserver/hw/xfree86/getconfig/cfg.sample,v 1.2 2003/09/23 05:12:07 dawes Exp $
+# $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/cfg.sample,v 1.2 2003/11/12 04:52:15 dawes Exp $
+
+# Some sample XFree86 getconfig rules file.
+
+#
+# The line below is the getconfig rules file signature, and must be the
+# first non-blank, non-comment line.
+#
+
+XFree86 Project getconfig rules file. Version: 1.0
+
+#
+# Set the weight for the following rules. This should be set, otherwise
+# the previously set weight will get used, and you have no idea of knowing
+# what that might be.
+#
+
+$weight = 1000
+
+#
+# Rules. Rules consist of a condition (in perl code) followed by
+# a driver name and optionally some additional strings. The start of a
+# rule is indicated by a line with no leading white space. Subsequent
+# lines making up a rule must be indented. Logical lines may be split
+# over multiple physical lines by using the usual continuation '\'.
+#
+# Rules that are not followed by a driver name may be used to do other
+# things, like setting the weight as above.
+#
+
+#
+# Pre-defined variables include:
+#
+# $vendor PCI vendor ID
+# $device PCI device ID
+# $revision PCI revision ID
+# $subsys PCI subsystem ID
+# $subsysVendor PCI subsystem vendor ID
+# $class PCI class
+# $XFree86Version XFree86 version, as a 'v' string.
+#
+# The XFree86 version information is also available as the following:
+#
+# $XFree86VersionNumeric
+# $XFree86VersionMajor
+# $XFree86VersionMinor
+# $XFree86VersionPatch
+# $XFree86VersionSnap
+#
+
+# Define a fake vendor ID for some sample rules.
+
+$novendor = 0x10000
+$nodevice = 0x10000
+
+$vendor == $novendor
+ nodriver
+ Option "xx"
+ Videoram 1000
+
+# A rule with continued lines.
+
+$vendor == $novendor && \
+$device == $nodevice
+ nodriver2
+ Option \
+ "yy"
+
+# Increase the weight of the following rules if the XFree86 version is 4.3 or
+# higher.
+
+$weight++ if ($XFree86Version ge v4.3)
+
+$vendor == $novendor
+ nodriver
+ Option "yy"
+
+#
+# The weight can be changed at any times, and applies to rules that follow
+# until changed again.
+#
+
+$weight = 100
+
+$vendor == $novendor && $XFree86Version eq v4.3.2.1
+ nodriver3
+
+$weight = 600
+
+#
+# The following two examples use some real values.
+#
+
+# Example: make the default depth 24 for Radeon R200 and RV200 cards.
+
+$vendor == 0x1002 && \
+ ($device >= 0x5148 && $device <= 0x514F || \
+ $device >= 0x5168 && $device <= 0x516C || \
+ $device == 0x4242 || \
+ $device >= 0x5157 && device <= 0x5158)
+ ati
+ Option "DefaultDepth" "24"
+
+
+# Example: enable DRI for MGA G400
+
+$vendor == 0x102b && $device == 0x0525
+ mga
+ Option "dri"
+
diff --git a/hw/xfree86/getconfig/getconfig b/hw/xfree86/getconfig/getconfig
new file mode 100644
index 000000000..d2acc9bb8
--- /dev/null
+++ b/hw/xfree86/getconfig/getconfig
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# $DHD: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.sh,v 1.2 2003/09/20 01:45:57 dawes Exp $
+
+#
+# Copyright 2003 by David H. Dawes.
+# Copyright 2003 by X-Oz Technologies.
+# 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+# and 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 copyright holder(s) and author(s).
+#
+# Author: David Dawes <dawes@XFree86.Org>.
+#
+
+# $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.sh,v 1.1 2003/10/08 14:58:29 dawes Exp $
+
+# A simple wrapper to execute the real getconfig program. So long as perl
+# is in $PATH, we don't need to know where it is this way.
+
+if echo $0 | grep / >/dev/null 2>&1; then
+ DIR=`dirname $0`/
+fi
+
+exec perl ${DIR}getconfig.pl "$@"
diff --git a/hw/xfree86/getconfig/getconfig.man.pre b/hw/xfree86/getconfig/getconfig.man.pre
new file mode 100644
index 000000000..16c472fc5
--- /dev/null
+++ b/hw/xfree86/getconfig/getconfig.man.pre
@@ -0,0 +1,98 @@
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.man,v 1.1 2003/11/12 04:52:15 dawes Exp $
+.TH getconfig 1 __vendorversion__
+.SH NAME
+getconfig - get configuration information for the XFree86 server
+.SH SYNOPSIS
+.B getconfig
+.RI [ option
+.IR ... ]
+.SH DESCRIPTION
+.B getconfig
+is a programatic interface that is used by the
+.B XFree86
+server to get configuration information about video hardware when
+operating without an
+.B XF86Config
+file.
+.PP
+This implementation of
+.B getconfig
+is written in perl. It processes a prioritized and ordered list of
+rules supplied internally and from meta-configuration files. The rules
+are in the form of perl expressions.
+.B getconfig
+writes to standard output the XF86Config-style configuration data
+specified by the last highest priority rule that evaluates to true.
+Information about the format of the meta-configuration files can be
+found in the getconfig(__filemansuffix__) manual page.
+.SH OPTIONS
+.TP 8
+.BI \-I " search-path"
+Specify the search path to use for meta-config files.
+.I search-path
+is a comma-separated list of directories to search. Each directory in
+the search path is searched for files with a
+.I .cfg
+suffix. Each such file is opened and checked for a valid signature
+string. Rules are read from files with a valid signature string and
+appended to the list of rules to evaluate. If no search path is specified,
+only the internally supplied configuration rules will be used.
+.TP 8
+.B \-D
+Enable debugging output.
+.TP 8
+.B \-V
+Print out the version information and exit.
+.TP 8
+.BI \-X " XFree86-version"
+Specify the XFree86 version in numeric (integer) form.
+.TP 8
+.BI \-b " subsys-id"
+Specify the PCI subsystem ID of the video device.
+.TP 8
+.BI \-c " class"
+Specify the PCI class of the video device.
+.TP 8
+.BI \-d " device-id"
+Specify the PCI devide ID of the video device.
+.TP 8
+.BI \-r " revision"
+Specify the PCI revision of the video device.
+.TP 8
+.BI \-s " subsysvendor-id"
+Specify the PCI subsystem vendor ID of the video device.
+.TP 8
+.BI \-v " vendor-id"
+Specify the PCI vendor ID of the video device.
+.SH FILES
+.I .cfg
+files located in the search path. The search path typically specified
+by the
+.B XFree86
+server is:
+.PP
+.RS 4
+.nf
+.I /etc/X11
+.I __projectroot__/etc/X11
+.I <modulepath>
+.I __projectroot__/lib/X11/getconfig
+.fi
+.RE
+.PP
+where
+.I <modulepath>
+is the
+.B XFree86
+server's module search path.
+
+.SH "SEE ALSO"
+getconfig(__filemansuffix__),
+XFree86(1),
+XF86Config(__filemansuffix__).
+
+.SH AUTHORS
+The XFree86 automatic configuration support and the
+.B getconfig
+interface was written by David H. Dawes, with the support of X-Oz
+Technologies.
diff --git a/hw/xfree86/getconfig/getconfig.pl b/hw/xfree86/getconfig/getconfig.pl
new file mode 100644
index 000000000..fcfd7d057
--- /dev/null
+++ b/hw/xfree86/getconfig/getconfig.pl
@@ -0,0 +1,429 @@
+#!/usr/bin/perl
+
+# $DHD: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.pl,v 1.13 2003/09/23 05:12:07 dawes Exp $
+
+#
+# Copyright 2003 by David H. Dawes.
+# Copyright 2003 by X-Oz Technologies.
+# 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+# and 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 copyright holder(s) and author(s).
+#
+# Author: David Dawes <dawes@XFree86.Org>.
+#
+
+# $XFree86: xc/programs/Xserver/hw/xfree86/getconfig/getconfig.pl,v 1.1 2003/10/08 14:58:29 dawes Exp $
+
+#
+# This script takes PCI id information, compares it against an ordered list
+# of rules, and prints out the configuration information specified by the
+# last matching rule.
+#
+# This script is called by xf86AutoConfig().
+#
+
+# Command line processing.
+
+$GetconfigVersion = v1.0;
+
+$debug = 0;
+
+$myname = $0;
+$myname =~ s/.*\///;
+
+$signature = "XFree86 Project getconfig rules file. Version: ";
+
+while (@ARGV[0] =~ /^-[A-Za-z]$/) {
+ $f = shift;
+ SWITCH: {
+ if ($f eq "-D") {
+ $debug = 1;
+ last SWITCH;
+ }
+ if ($f eq "-I") {
+ push(@searchPaths, split(/,/, shift));
+ last SWITCH;
+ }
+ if ($f eq "-V") {
+ printf STDERR "$myname: Version %vd.\n", $GetconfigVersion;
+ exit 0;
+ }
+ if ($f eq "-X") {
+ $XFree86VersionNumeric = shift;
+ if (!defined($XFree86VersionNumeric)) {
+ print STDERR "$myname: -X requires the XFree86 version.\n";
+ exit 1;
+ }
+ }
+ if ($f eq "-b") {
+ $subsys = oct(shift);
+ if (!defined($subsys)) {
+ print STDERR "$myname: -b requires the subsys id.\n";
+ exit 1;
+ }
+ last SWITCH;
+ }
+ if ($f eq "-c") {
+ $class = oct(shift);
+ if (!defined($class)) {
+ print STDERR "$myname: -c requires the class value.\n";
+ exit 1;
+ }
+ last SWITCH;
+ }
+ if ($f eq "-d") {
+ $device = oct(shift);
+ if (!defined($device)) {
+ print STDERR "$myname: -d requires the device id.\n";
+ exit 1;
+ }
+ last SWITCH;
+ }
+ if ($f eq "-r") {
+ $revision = oct(shift);
+ if (!defined($revision)) {
+ print STDERR "$myname: -r requires the device revision.\n";
+ exit 1;
+ }
+ last SWITCH;
+ }
+ if ($f eq "-s") {
+ $subsysVendor = oct(shift);
+ if (!defined($subsysVendor)) {
+ print STDERR "$myname: -s requires the subsysVendor id.\n";
+ exit 1;
+ }
+ last SWITCH;
+ }
+ if ($f eq "-v") {
+ $vendor = oct(shift);
+ if (!defined($vendor)) {
+ print STDERR "$myname: -v requires the vendor id.\n";
+ exit 1;
+ }
+ last SWITCH;
+ }
+ }
+}
+
+printf STDERR "$myname: Version %vd.\n", $GetconfigVersion;
+
+if (defined($XFree86VersionNumeric)) {
+ $XFree86VersionMajor = $XFree86VersionNumeric / 10000000;
+ $XFree86VersionMinor = ($XFree86VersionNumeric % 10000000) / 100000;
+ $XFree86VersionPatch = ($XFree86VersionNumeric % 100000) / 1000;
+ $XFree86VersionSnapshot = $XFree86VersionNumeric % 1000;
+ $XFree86Version = chr($XFree86VersionMajor) . chr($XFree86VersionMinor) .
+ chr($XFree86VersionPatch) . chr($XFree86VersionSnapshot);
+}
+
+if ($debug) {
+ printf STDERR "$myname: XFree86 Version: %d, %d.%d.%d.%d, %vd.\n",
+ $XFree86VersionNumeric, $XFree86VersionMajor, $XFree86VersionMinor,
+ $XFree86VersionPatch, $XFree86VersionSnapshot, $XFree86Version;
+} else {
+ printf STDERR "$myname: XFree86 Version: %vd.\n", $XFree86Version;
+}
+
+
+# The rules here are just basic vendor ID to driver mappings.
+# Ideally this is all that would be required. More complicated configuration
+# rules will be provided in external files.
+
+# XXX This set of basic rules isn't complete yet.
+
+@rules = (
+
+# Set the weight for the built-in rules.
+['$weight = 500'],
+
+# APM
+['$vendor == 0x1142',
+ 'apm'],
+
+# ARK
+['$vendor == 0xedd8',
+ 'apm'],
+
+# ATI
+['$vendor == 0x1002',
+ 'ati'],
+
+# Chips & Technologies
+['$vendor == 0x102c',
+ 'chips'],
+
+# Cirrus
+['$vendor == 0x1013',
+ 'cirrus'],
+
+# Intel
+['$vendor == 0x8086',
+ 'i810'],
+['$vendor == 0x8086 && ($chipType == 0x00d1 || $chipType == 0x7800)',
+ 'i740'],
+
+# Matrox
+['$vendor == 0x102b',
+ 'mga'],
+
+# Neomagic
+['$vendor == 0x10c8',
+ 'neomagic'],
+
+# Number Nine
+['$vendor == 0x105d',
+ 'i128'],
+
+# NVIDIA
+['$vendor == 0x10de || $vendor == 0x12d2',
+ 'nv'],
+
+# S3
+['$vendor == 0x5333 && ($device == 0x88d0 ||' .
+ '$device == 0x88d1 ||' .
+ '$device == 0x88f0 ||' .
+ '$device == 0x8811 ||' .
+ '$device == 0x8812 ||' .
+ '$device == 0x8814 ||' .
+ '$device == 0x8901)',
+ 's3'],
+
+# S3 virge
+['$vendor == 0x5333 && ($device == 0x5631 ||' .
+ '$device == 0x883d ||' .
+ '$device == 0x8a01 ||' .
+ '$device == 0x8a10 ||' .
+ '$device == 0x8c01 ||' .
+ '$device == 0x8c03 ||' .
+ '$device == 0x8904 ||' .
+ '$device == 0x8a13)',
+ 's3virge'],
+
+# S3 Savage
+['$vendor == 0x5333 && ($device >= 0x8a20 && $device <= 0x8a22 ||' .
+ '$device == 0x9102 ||' .
+ '$device >= 0x8c10 && $device <= 0x8c13 ||' .
+ '$device == 0x8a25 ||' .
+ '$device == 0x8a26 ||' .
+ '$device >= 0x8d01 && $device <= 0x8d04 ||' .
+ '$device >= 0x8c2a && $device <= 0x8c2f ||' .
+ '$device == 0x8c22 ||' .
+ '$device == 0x8c24 ||' .
+ '$device == 0x8c26)',
+ 'savage'],
+
+# SIS
+['$vendor == 0x1039',
+ 'sis'],
+
+# SMI
+['$vendor == 0x126f',
+ 'siliconmotion'],
+
+# 3Dfx
+['$vendor == 0x121a',
+ 'tdfx'],
+
+# 3Dlabs
+['$vendor == 0x3d3d',
+ 'glint'],
+
+# Trident
+['$vendor == 0x1023',
+ 'trident'],
+
+# Tseng Labs
+['$vendor == 0x100c',
+ 'tseng'],
+
+# VIA
+['$vendor == 0x1106',
+ 'via'],
+
+# VMware
+['$vendor == 0x15ad',
+ 'vmware'],
+
+);
+
+# Reverse the search path list, since the later rules have higher priority
+# than earlier ones (weighting being equal).
+
+@searchPaths = reverse(@searchPaths);
+
+if ($debug) {
+ $i = 0;
+ for $path (@searchPaths) {
+ print STDERR "$myname: Search path $i is: \"$path\".\n";
+ $i++;
+ }
+}
+
+print STDERR "$myname: ", $#rules + 1, " built-in rule", plural($#rules + 1),
+ ".\n";
+
+for $path (@searchPaths) {
+ while (<$path/*.cfg>) {
+ @tmp = readRulesFile($_);
+ if (defined(@tmp[0])) {
+ push @rules, @tmp;
+ }
+ }
+}
+
+if ($debug) {
+ $i = 0;
+ for $r (@rules) {
+ print STDERR "$myname: rule $i is: \'@$r\'.\n";
+ $i++
+ }
+}
+
+$i = 0;
+$e = 0;
+$weight = 0;
+$w = 0;
+for $r (@rules) {
+ ($cond, $d, @o) = @$r;
+ $result = eval $cond;
+ if ($@) {
+ print STDERR "$myname: Error evaluating rule $i \'$cond\': $@";
+ $e++;
+ }
+ if ($debug) {
+ print STDERR "$myname: rule $i \'$cond\' evaluates to \'$result\'.\n";
+ }
+ if ($result && defined($d) && $weight >= $w) {
+ $driver = $d;
+ @opts = @o;
+ $w = $weight;
+ }
+ $i++;
+}
+
+print STDERR "$myname: Evaluated $i rule", plural($i),
+ " with $e error", plural($e), ".\n";
+
+print STDERR "$myname: Weight of result is $w.\n";
+
+if ($debug) {
+ if (defined($driver)) {
+ print STDERR "$myname: Driver is \'$driver\'.\n";
+ } else {
+ print STDERR "$myname: No driver.\n";
+ }
+ if (defined(@opts)) {
+ print STDERR "$myname: options are:\n";
+ for $opt (@opts) {
+ print STDERR "\t$opt\n";
+ }
+ } else {
+ print STDERR "$myname: No options.\n";
+ }
+}
+
+print "$driver\n";
+for $opt (@opts) {
+ print "$opt\n";
+}
+
+exit 0;
+
+# Subroutines.
+
+sub readRulesFile {
+ my ($file) = @_;
+ my $signatureOK = 0;
+ my @r, @tmp;
+ my $line, $cont, $prevcont, $fileversion;
+
+ undef @tmp;
+ undef @r;
+
+ if (open(RF, "<$file")) {
+ $prevcont = 0;
+ while (<RF>) {
+ chop;
+ $line = $_;
+ next if ($line =~ /^#/);
+ next if ($line =~ /^\s*$/);
+ if (!$signatureOK) {
+ if ($line =~ /^$signature(.*)$/) {
+ $fileversion = $1;
+ $signatureOK = 1;
+ print STDERR
+ "$myname: rules file \'$file\' has version $fileversion.\n";
+ next;
+ }
+ }
+ if (!$signatureOK) {
+ print STDERR "$myname: file \'$file\' has bad signature.\n";
+ close(RF);
+ last;
+ }
+ $cont = 0;
+ if ($line =~ s/\\\s*$//) {
+ $cont = 1;
+ }
+ if (!$prevcont && $line =~ /^\S+/) {
+ if (defined(@tmp[0])) {
+ push(@r,[@tmp]);
+ }
+ undef @tmp;
+ }
+ if ($prevcont) {
+ push(@tmp, pop(@tmp) . $line);
+ } else {
+ push(@tmp, $line);
+ }
+ $prevcont = $cont;
+ }
+ if (defined(@tmp[0])) {
+ push(@r,[@tmp]);
+ }
+ if (!defined(@r[0])) {
+ print STDERR "$myname: no rules in file \'$file\'.\n";
+ } else {
+ print STDERR "$myname: ", $#r + 1,
+ " rule", plural($#r + 1),
+ " added from file \'$file\'.\n";
+ }
+ } else {
+ print STDERR "$myname: cannot open file \'$file\'.\n";
+ }
+
+ return @r;
+}
+
+sub plural {
+ my ($count) = @_;
+
+ if ($count != 1) {
+ return "s";
+ } else {
+ return "";
+ }
+}
+
diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
index 494f9303b..a7f5adf1a 100644
--- a/hw/xfree86/i2c/xf86i2c.c
+++ b/hw/xfree86/i2c/xf86i2c.c
@@ -6,7 +6,7 @@
* (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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c,v 1.15 2003/08/29 21:08:06 tsi Exp $ */
#if 1
#include "misc.h"
@@ -750,7 +750,7 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too)
if (b) {
I2CBusPtr *p;
- /* Remove this from the list of active I2C busses. */
+ /* Remove this from the list of active I2C buses */
for (p = &I2CBusList; *p != NULL; p = &(*p)->NextBus)
if (*p == b) {
@@ -794,7 +794,7 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too)
Bool
xf86I2CBusInit(I2CBusPtr b)
{
- /* I2C busses must be identified by a unique scrnIndex
+ /* I2C buses 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.
*/
@@ -861,3 +861,32 @@ xf86I2CFindBus(int scrnIndex, char *name)
return NULL;
}
+
+/*
+ * Return an array of I2CBusPtr's related to a screen. The caller is
+ * responsible for freeing the array.
+ */
+int
+xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus)
+{
+ I2CBusPtr pI2CBus;
+ int n = 0;
+
+ if (pppI2CBus)
+ *pppI2CBus = NULL;
+
+ for (pI2CBus = I2CBusList; pI2CBus; pI2CBus = pI2CBus->NextBus) {
+ if ((pI2CBus->scrnIndex >= 0) && (pI2CBus->scrnIndex != scrnIndex))
+ continue;
+
+ n++;
+
+ if (!pppI2CBus)
+ continue;
+
+ *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr));
+ *pppI2CBus[n - 1] = pI2CBus;
+ }
+
+ return n;
+}
diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h
index 42b68a179..e7423155a 100644
--- a/hw/xfree86/i2c/xf86i2c.h
+++ b/hw/xfree86/i2c/xf86i2c.h
@@ -2,11 +2,11 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.11 2003/08/29 21:08:06 tsi Exp $ */
#ifndef _XF86I2C_H
#define _XF86I2C_H
-#include "miscstruct.h"
+#include "regionstr.h"
typedef unsigned char I2CByte;
typedef unsigned short I2CSlaveAddr;
@@ -52,6 +52,8 @@ I2CBusPtr xf86CreateI2CBusRec(void);
void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too);
Bool xf86I2CBusInit(I2CBusPtr pI2CBus);
I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name);
+int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus);
+
/* I2C slave devices */
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index d481f000d..845c8a177 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.25.2.1 2003/03/20 15:14:25 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.29 2003/09/24 02:43:33 dawes Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -139,20 +139,22 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
if (bios.bus == BUS_ISA && bios.location.legacy) {
xf86DrvMsg(screen, X_CONFIG,
- "Overriding BIOS location: 0x%lx\n",
+ "Overriding BIOS location: 0x%x\n",
bios.location.legacy);
cs = bios.location.legacy >> 4;
#define CHECK_V_SEGMENT_RANGE(x) \
- if ((x << 4) < V_BIOS) {\
+ if (((x) << 4) < V_BIOS) {\
xf86DrvMsg(screen, X_ERROR, \
- "V_BIOS address 0x%x out of range\n",x << 4); \
+ "V_BIOS address 0x%lx out of range\n", \
+ (unsigned long)(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);
+ "No V_BIOS at specified address 0x%lx\n",
+ (unsigned long)cs << 4);
goto error1;
}
} else {
@@ -182,7 +184,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
}
}
- xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
+ xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%lx\n",
+ (unsigned long)cs);
set_return_trap(pInt);
pInt->BIOSseg = cs;
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index 2d6c0eb24..7528fea0e 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.24 2002/11/25 21:05:49 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.26 2003/11/06 18:38:12 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@@ -145,7 +145,7 @@ void
dump_code(xf86Int10InfoPtr pInt)
{
int i;
- CARD32 lina = SEG_ADR((CARD32), X86_CS, IP);
+ unsigned long 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++)
@@ -160,25 +160,28 @@ 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);
+ "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n",
+ (unsigned long)X86_EAX, (unsigned long)X86_EBX,
+ (unsigned long)X86_ECX, (unsigned long)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);
+ "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n",
+ (unsigned long)X86_ESP, (unsigned long)X86_EBP,
+ (unsigned long)X86_ESI, (unsigned long)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);
+ "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n",
+ (unsigned long)X86_EIP, (unsigned long)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);
+ unsigned long stack = SEG_ADR((CARD32), X86_SS, SP);
+ unsigned long tail = (CARD32)((X86_SS << 4) + 0x1000);
if (stack >= tail) return;
diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c
index d6c5d1f43..a74bbeacd 100644
--- a/hw/xfree86/int10/xf86int10.c
+++ b/hw/xfree86/int10/xf86int10.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.10.2.1 2003/03/21 22:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.11 2003/03/21 22:26:11 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
diff --git a/hw/xfree86/loader/aout.h b/hw/xfree86/loader/aout.h
index 2e58f2cab..cd7807531 100644
--- a/hw/xfree86/loader/aout.h
+++ b/hw/xfree86/loader/aout.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.7 2002/05/31 18:46:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.8 2003/10/15 16:29:02 dawes Exp $ */
/*
* Borrowed from NetBSD's exec_aout.h
@@ -41,8 +41,8 @@
#include <ctype.h>
/* OS/2 EMX has ntohl in this file */
-#ifdef __UNIXOS2__
-#include <sys/param.h>
+#ifdef __UNIXOS2__
+#include <sys/param.h>
#endif
#define __LDPGSZ 4096U
@@ -54,44 +54,44 @@
* 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 */
+ 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 */
+#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 */
+#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
@@ -179,19 +179,19 @@ typedef struct AOUT_exec {
#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 */
+ 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
/*
@@ -200,33 +200,32 @@ struct relocation_info_i386 {
*/
typedef struct AOUT_nlist {
union {
- char *n_name; /* symbol name (in memory) */
- long n_strx; /* file string table offset (on disk) */
+ 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 */
+#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) */
+#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
index 98e657dca..f77b3d73c 100644
--- a/hw/xfree86/loader/aoutloader.c
+++ b/hw/xfree86/loader/aoutloader.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.17 2001/11/16 16:47:55 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.20 2003/10/15 17:46:00 dawes Exp $ */
/*
*
@@ -52,10 +52,13 @@
#include "loader.h"
#include "aoutloader.h"
-/*
-#define AOUTDEBUG ErrorF
-*/
+#ifndef LOADERDEBUG
+#define LOADERDEBUG 0
+#endif
+#if LOADERDEBUG
+#define AOUTDEBUG ErrorF
+#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
@@ -67,22 +70,22 @@
*/
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 */
+ 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;
@@ -121,10 +124,12 @@ 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 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 *);
+static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr, int,
+ struct relocation_info_i386 *);
/*
* Return 1 if the symbol in item belongs to aoutfile
@@ -133,6 +138,7 @@ static int
AOUTHashCleanOut(void *voidptr, itemPtr item)
{
AOUTModulePtr aoutfile = (AOUTModulePtr) voidptr;
+
return (aoutfile->handle == item->handle);
}
@@ -140,8 +146,8 @@ AOUTHashCleanOut(void *voidptr, itemPtr item)
* Manage listResolv
*/
static AOUTRelocPtr
-AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
- struct relocation_info *rel)
+AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
+ struct relocation_info *rel)
{
AOUTRelocPtr reloc;
@@ -158,8 +164,6 @@ AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
reloc->next = 0;
return reloc;
}
-
-
/*
* Manage listCOMMON
@@ -170,8 +174,8 @@ AOUTAddCommon(struct AOUT_nlist *sym, int index)
{
AOUTCommonPtr common;
- if ((common = xf86loadermalloc(sizeof (AOUTCommonRec))) == NULL) {
- ErrorF( "AOUTAddCommon() Unable to allocate memory\n" );
+ if ((common = xf86loadermalloc(sizeof(AOUTCommonRec))) == NULL) {
+ ErrorF("AOUTAddCommon() Unable to allocate memory\n");
return 0;
}
common->sym = sym;
@@ -183,8 +187,8 @@ AOUTAddCommon(struct AOUT_nlist *sym, int index)
static LOOKUP *
AOUTCreateCommon(AOUTModulePtr aoutfile)
{
- int numsyms = 0, size = 0, l = 0;
- int offset = 0;
+ int numsyms = 0, size = 0, l = 0;
+ int offset = 0;
AOUTCommonPtr common;
LOOKUP *lookup;
@@ -194,46 +198,47 @@ AOUTCreateCommon(AOUTModulePtr aoutfile)
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);
+ 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 */
+ } /* while */
#ifdef AOUTDEBUG
AOUTDEBUG("AOUTCreateCommon() %d entries (%d bytes) of COMMON data\n",
- numsyms, size );
+ numsyms, size);
#endif
-
- if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) {
- ErrorF( "AOUTCreateCommon() Unable to allocate memory\n" );
- return NULL;
+
+ 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;
+ 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);
+ 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 );
+ AOUTDEBUG("Adding %p %s\n", (void *)lookup[l].offset,
+ lookup[l].symName);
#endif
- listCOMMON = common->next;
- offset += common->sym->n_value;
- xf86loaderfree(common);
- l++;
- } /* while */
+ listCOMMON = common->next;
+ offset += common->sym->n_value;
+ xf86loaderfree(common);
+ l++;
+ } /* while */
/* listCOMMON == NULL */
- lookup[l].symName=NULL; /* Terminate the list */
+ lookup[l].symName = NULL; /* Terminate the list */
return lookup;
}
@@ -244,7 +249,7 @@ AOUTCreateCommon(AOUTModulePtr aoutfile)
static char *
AOUTGetString(AOUTModulePtr aoutfile, int index)
{
- char *symname = (char *) &(aoutfile->strings[index]);
+ char *symname = (char *)&(aoutfile->strings[index]);
if (symname[0] == '_') {
symname++;
@@ -252,20 +257,21 @@ AOUTGetString(AOUTModulePtr aoutfile, int index)
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 *symname = AOUTGetString(aoutfile, sym->n_un.n_strx);
char *name;
- name=xf86loadermalloc(strlen(symname)+1);
+ name = xf86loadermalloc(strlen(symname) + 1);
if (!name)
FatalError("AOUTGetSymbolName: Out of memory\n");
- strcpy(name,symname);
+ strcpy(name, symname);
return name;
}
@@ -276,13 +282,13 @@ AOUTGetSymbolName(AOUTModulePtr aoutfile, struct AOUT_nlist *sym)
static void *
AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index)
{
- void *symval = NULL; /* value of the indicated symbol */
- itemPtr symbol = NULL; /* name/value of symbol */
+ 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 )
+ if (name)
symbol = LoaderHashFind(name);
if (symbol)
@@ -292,7 +298,6 @@ AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index)
return symval;
}
-
/*
* Perform the actual relocation
*/
@@ -300,28 +305,27 @@ 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");
+ AOUTDEBUG("AOUT_Relocate %p : %08lx %s",
+ (void *)destl, *destl, pcrel == 1 ? "rel" : "abs");
#endif
if (pcrel) {
/* relative to PC */
- *destl = val - ((unsigned long)destl + sizeof(long));
+ *destl = val - ((unsigned long)destl + sizeof(long));
} else {
*destl += val;
}
#ifdef AOUTDEBUG
- AOUTDEBUG(" -> %08x\n", *destl);
+ AOUTDEBUG(" -> %08lx\n", *destl);
#endif
}
-
/*
* Fix the relocation for text or data section
*/
static AOUTRelocPtr
AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
- struct relocation_info *rel)
+ struct relocation_info *rel)
{
AOUTHDR *header = aoutfile->header;
AOUT_nlist *symtab = aoutfile->symtab;
@@ -330,22 +334,23 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
unsigned long *destl; /* address of the location to be modified */
symnum = rel->r_symbolnum;
-#ifdef AOUTDEBUG
+#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);
+ 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 */
@@ -356,15 +361,15 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
* First find the address to modify
*/
switch (type) {
- case AOUT_TEXT:
+ 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:
+ case AOUT_DATA:
/* Check that the relocation offset is in the data segment */
if (rel->r_address > header->a_data) {
ErrorF("AOUT_RelocateEntry():"
@@ -372,10 +377,10 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
}
destl = (unsigned long *)(aoutfile->data + rel->r_address);
break;
- default:
+ default:
ErrorF("AOUT_RelocateEntry(): unknown section type %d\n", type);
return 0;
- } /* switch */
+ } /* switch */
/*
* Now handle the relocation
@@ -385,70 +390,70 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
symval = AOUTGetSymbolValue(aoutfile, symnum);
if (symval != 0) {
/* we've got the value */
- AOUT_Relocate(destl, (unsigned long) symval, rel->r_pcrel);
+ 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:
+ case AOUT_UNDF:
#ifdef AOUTDEBUG
AOUTDEBUG(" extern AOUT_UNDEF\n");
#endif
/* Add this relocation back to the global list */
- return AOUTDelayRelocation(aoutfile,type,rel);
+ return AOUTDelayRelocation(aoutfile, type, rel);
- default:
+ default:
ErrorF("AOUT_RelocateEntry():"
- " impossible intern relocation type: %d\n",
+ " impossible intern relocation type: %d\n",
symtab[symnum].n_type);
return 0;
- } /* switch */
+ } /* switch */
}
} else {
/* intern */
switch (rel->r_symbolnum) {
- case AOUT_TEXT:
+ 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,
+ if (rel->r_pcrel == 0)
+ AOUT_Relocate(destl, (unsigned long)aoutfile->text,
rel->r_pcrel);
return 0;
- case AOUT_DATA:
+ case AOUT_DATA:
#ifdef AOUTDEBUG
AOUTDEBUG(" AOUT_DATA\n");
#endif
- if (rel->r_pcrel == 0)
+ 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:
+ 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,
+ - 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:
+ default:
ErrorF("AOUT_RelocateEntry():"
" unknown intern relocation type: %d\n", rel->r_symbolnum);
return 0;
- } /* switch */
+ } /* switch */
}
-} /* AOUT_RelocateEntry */
-
+} /* AOUT_RelocateEntry */
+
static AOUTRelocPtr
AOUTCollectRelocations(AOUTModulePtr aoutfile)
{
@@ -460,7 +465,7 @@ AOUTCollectRelocations(AOUTModulePtr aoutfile)
/* Text relocations */
if (aoutfile->text != NULL && aoutfile->txtrel != NULL) {
- nreloc = header->a_trsize/sizeof(struct relocation_info);
+ nreloc = header->a_trsize / sizeof(struct relocation_info);
for (i = 0; i < nreloc; i++) {
rel = aoutfile->txtrel + i;
@@ -469,28 +474,28 @@ AOUTCollectRelocations(AOUTModulePtr aoutfile)
tmp->next = reloc_head;
reloc_head = tmp;
}
- } /* for */
+ } /* for */
}
/* Data relocations */
if (aoutfile->data != NULL && aoutfile->datarel != NULL) {
- nreloc = header->a_drsize/sizeof(struct relocation_info);
-
+ 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 */
+ } /* for */
}
return reloc_head;
-} /* AOUTCollectRelocations */
+} /* AOUTCollectRelocations */
/*
* AOUT_GetSymbols()
*
* add the symbols to the loader's symbol table
*/
-static LOOKUP *
+static LOOKUP *
AOUT_GetSymbols(AOUTModulePtr aoutfile)
{
int fd = aoutfile->fd;
@@ -501,11 +506,11 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
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);
+ 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");
@@ -513,17 +518,16 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
}
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)
+ soff = s->n_un.n_strx;
+ if (soff == 0 || (s->n_type & AOUT_STAB) != 0)
continue;
- symname=AOUTGetSymbolName(aoutfile,s);
+ symname = AOUTGetSymbolName(aoutfile, s);
#ifdef AOUTDEBUG
- AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08x\n",
- symname, s->n_type,
- s->n_other, s->n_value);
+ AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08lx\n",
+ symname, s->n_type, s->n_other, s->n_value);
#endif
switch (s->n_type & AOUT_TYPE) {
- case AOUT_UNDF:
+ case AOUT_UNDF:
if (s->n_value != 0) {
if (!LoaderHashFind(symname)) {
#ifdef AOUTDEBUG
@@ -542,51 +546,54 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
}
xf86loaderfree(symname);
break;
- case AOUT_TEXT:
+ 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);
+ lookup[l].offset = (funcptr) (aoutfile->text + s->n_value);
#ifdef AOUTDEBUG
- AOUTDEBUG("Adding text %s %08x\n", symname, lookup[l].offset);
+ AOUTDEBUG("Adding text %s %p\n", symname,
+ (void *)lookup[l].offset);
#endif
l++;
} else {
xf86loaderfree(symname);
}
break;
- case AOUT_DATA :
+ 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);
+ lookup[l].offset = (funcptr) (aoutfile->data +
+ s->n_value - header->a_text);
#ifdef AOUTDEBUG
- AOUTDEBUG("Adding data %s %08x\n", symname, lookup[l].offset);
+ AOUTDEBUG("Adding data %s %p\n", symname,
+ (void *)lookup[l].offset);
#endif
l++;
} else {
xf86loaderfree(symname);
}
break;
- case AOUT_BSS:
+ 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));
+ 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);
+ AOUTDEBUG("Adding bss %s %p\n", symname,
+ (void *)lookup[l].offset);
#endif
l++;
} else {
xf86loaderfree(symname);
}
break;
- case AOUT_FN:
+ case AOUT_FN:
#ifdef AOUTDEBUG
- if (n->n_type& AOUT_EXT) {
+ if (s->n_type & AOUT_EXT) {
AOUTDEBUG("Ignoring AOUT_FN %s\n", symname);
} else {
AOUTDEBUG("Ignoring AOUT_WARN %s\n", symname);
@@ -594,68 +601,66 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
#endif
xf86loaderfree(symname);
break;
- default:
- ErrorF("Unknown symbol type %x\n", s->n_type & AOUT_TYPE);
- xf86loaderfree(symname);
- } /* switch */
- } /* for */
+ 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));
+ 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 */
+} /* AOUT_GetSymbols */
/*
* Public API for the a.out implementation of the loader
*/
void *
-AOUTLoadModule(loaderPtr modrec,
- int aoutfd,
- LOOKUP **ppLookup)
+AOUTLoadModule(loaderPtr modrec, int aoutfd, LOOKUP ** ppLookup)
{
AOUTModulePtr aoutfile = NULL;
AOUTHDR *header;
AOUTRelocPtr reloc, tail;
- void *v;
+ 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" );
+ 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;
+ 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;
+ 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,
+ aoutfile->text = _LoaderFileToMem(aoutfile->fd,
AOUT_TXTOFF(header),
header->a_text, "text");
aoutfile->textsize = header->a_text;
@@ -689,13 +694,13 @@ AOUTLoadModule(loaderPtr modrec,
/* Data Relocations */
if (header->a_drsize != 0) {
aoutfile->datarel = _LoaderFileToMem(aoutfile->fd,
- AOUT_DRELOFF(header),
- header->a_drsize, "datarel");
+ AOUT_DRELOFF(header),
+ header->a_drsize, "datarel");
} else {
aoutfile->datarel = NULL;
}
/* String table */
- _LoaderFileRead(aoutfile->fd, AOUT_STROFF(header),
+ _LoaderFileRead(aoutfile->fd, AOUT_STROFF(header),
&(aoutfile->strsize), sizeof(int));
if (aoutfile->strsize != 0) {
aoutfile->strings = _LoaderFileToMem(aoutfile->fd,
@@ -711,8 +716,7 @@ AOUTLoadModule(loaderPtr modrec,
reloc = AOUTCollectRelocations(aoutfile);
if (reloc) {
- for (tail = reloc; tail->next; tail = tail->next)
- ;
+ for (tail = reloc; tail->next; tail = tail->next) ;
tail->next = _LoaderGetRelocations(v)->aout_reloc;
_LoaderGetRelocations(v)->aout_reloc = reloc;
}
@@ -721,8 +725,7 @@ AOUTLoadModule(loaderPtr modrec,
}
void
-AOUTResolveSymbols(mod)
-void *mod;
+AOUTResolveSymbols(void *mod)
{
AOUTRelocPtr newlist, p, tmp;
@@ -731,7 +734,7 @@ void *mod;
#endif
newlist = 0;
- for (p = _LoaderGetRelocations(mod)->aout_reloc; p; ) {
+ 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. */
@@ -743,11 +746,10 @@ void *mod;
xf86loaderfree(tmp);
}
_LoaderGetRelocations(mod)->aout_reloc = newlist;
-} /* AOUTResolveSymbols */
+} /* AOUTResolveSymbols */
int
-AOUTCheckForUnresolved(mod)
-void *mod;
+AOUTCheckForUnresolved(void *mod)
{
int symnum;
AOUTRelocPtr crel;
@@ -763,18 +765,20 @@ void *mod;
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,
+ * 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));
+ name = AOUTGetSymbolName(crel->file, crel->file->symtab + symnum);
+ flag = _LoaderHandleUnresolved(name,
+ _LoaderHandleToName(crel->file->
+ handle));
xf86loaderfree(name);
- if (flag) fatalsym = 1;
+ if (flag)
+ fatalsym = 1;
crel = crel->next;
}
return fatalsym;
@@ -783,8 +787,9 @@ void *mod;
void
AOUTUnloadModule(void *modptr)
{
- AOUTModulePtr aoutfile = (AOUTModulePtr)modptr;
+ AOUTModulePtr aoutfile = (AOUTModulePtr) modptr;
AOUTRelocPtr relptr, *prevptr;
+
#ifdef AOUTDEBUG
AOUTDEBUG("AOUTUnLoadModule(0x%p)\n", modptr);
#endif
@@ -793,8 +798,8 @@ AOUTUnloadModule(void *modptr)
* Delete any unresolved relocations
*/
- relptr=_LoaderGetRelocations(aoutfile->funcs)->aout_reloc;
- prevptr=&(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc);
+ relptr = _LoaderGetRelocations(aoutfile->funcs)->aout_reloc;
+ prevptr = &(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc);
while (relptr) {
if (relptr->file == aoutfile) {
@@ -805,19 +810,19 @@ AOUTUnloadModule(void *modptr)
prevptr = &(relptr->next);
relptr = relptr->next;
}
- } /* while */
-
+ } /* 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);
+ 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);
@@ -838,21 +843,20 @@ AOUTUnloadModule(void *modptr)
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";
- }
+ 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
index 2714b140f..b0e156319 100644
--- a/hw/xfree86/loader/aoutloader.h
+++ b/hw/xfree86/loader/aoutloader.h
@@ -19,13 +19,13 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.3 1998/09/20 14:41:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.4 2003/10/15 16:29:02 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 char *AOUTAddressToSection(void *, unsigned long);
extern void AOUTUnloadModule(void *);
#endif
diff --git a/hw/xfree86/loader/ar.h b/hw/xfree86/loader/ar.h
index 4dbc97901..956b810a0 100644
--- a/hw/xfree86/loader/ar.h
+++ b/hw/xfree86/loader/ar.h
@@ -1,5 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.3 1998/07/25 16:56:12 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */
#ifndef _AR_H
#define _AR_H
@@ -10,13 +9,13 @@
#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];
+ char ar_name[16];
+ char ar_date[12];
+ char ar_uid[6];
+ char ar_gid[6];
+ char ar_mode[8];
+ char ar_size[10];
+ char ar_fmag[2];
};
#else
@@ -25,35 +24,31 @@ struct ar_hdr {
#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 */
+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 */
+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
@@ -74,4 +69,3 @@ struct ar_hdr /* archive file member header - printable ascii */
#endif /* !__powerpc__ && Lynx */
#endif /* _AR_H */
-
diff --git a/hw/xfree86/loader/coff.h b/hw/xfree86/loader/coff.h
index cebf5e179..52553278e 100644
--- a/hw/xfree86/loader/coff.h
+++ b/hw/xfree86/loader/coff.h
@@ -1,5 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.5 1998/07/25 16:56:12 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.6 2003/10/15 16:29:02 dawes Exp $ */
/* This file was implemented from the information in the book
Understanding and Using COFF
@@ -20,7 +19,7 @@
#ifndef _COFF_H
#define _COFF_H
-#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
+#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
/*
* Intel 386/486
*/
@@ -29,15 +28,14 @@
* 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 */
+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)
@@ -46,18 +44,17 @@ typedef struct COFF_filehdr
* 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 */
+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
@@ -68,41 +65,36 @@ typedef struct COFF_scnhdr
* 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 */
+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 */
+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 */
+ 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
@@ -110,8 +102,8 @@ typedef struct COFF_syment
#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_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 */
@@ -131,62 +123,59 @@ typedef struct COFF_syment
* 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;
+ 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 */
+#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 */
+#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 */
+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 */
+ 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 */
+ } _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 */
+ unsigned short r_type; /* Relocation type */
#endif
} RELOC;
@@ -222,7 +211,7 @@ typedef struct COFF_reloc
#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 */
+ /* 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 */
diff --git a/hw/xfree86/loader/coffloader.c b/hw/xfree86/loader/coffloader.c
index 7a1ef28ad..b2fbfcf14 100644
--- a/hw/xfree86/loader/coffloader.c
+++ b/hw/xfree86/loader/coffloader.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.18 2002/09/16 18:06:10 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.21 2003/10/15 17:40:15 dawes Exp $ */
/*
*
@@ -48,63 +48,66 @@
#include "coffloader.h"
#include "compiler.h"
-/*
-#ifndef LDTEST
+
+#ifndef LOADERDEBUG
+#define LOADERDEBUG 0
+#endif
+
+#if LOADERDEBUG
#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;
+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;
+ COFFModulePtr file;
+ RELOC *rel;
+ int secndx;
+ struct _coff_reloc *next;
} COFFRelocRec;
/*
@@ -116,10 +119,10 @@ typedef struct _coff_reloc {
*/
typedef struct _coff_COMMON {
- SYMENT *sym;
- int index;
- struct _coff_COMMON *next;
- } COFFCommonRec;
+ SYMENT *sym;
+ int index;
+ struct _coff_COMMON *next;
+} COFFCommonRec;
static COFFCommonPtr listCOMMON = NULL;
@@ -140,36 +143,30 @@ static COFFRelocPtr COFFCollectRelocations(COFFModulePtr);
* Utility Functions
*/
-
static int
-COFFhashCleanOut(voidptr, item)
-void *voidptr;
-itemPtr item ;
+COFFhashCleanOut(void *voidptr, itemPtr item)
{
- COFFModulePtr module = (COFFModulePtr) voidptr;
- return ( module->handle == item->handle ) ;
-}
+ COFFModulePtr module = (COFFModulePtr) voidptr;
+ return (module->handle == item->handle);
+}
/*
* Manage listResolv
*/
static COFFRelocPtr
-COFFDelayRelocation(cofffile,secndx,rel)
-COFFModulePtr cofffile;
-int secndx;
-RELOC *rel;
+COFFDelayRelocation(COFFModulePtr cofffile, int secndx, RELOC *rel)
{
COFFRelocPtr reloc;
if ((reloc = xf86loadermalloc(sizeof(COFFRelocRec))) == NULL) {
- ErrorF( "COFFDelayRelocation() Unable to allocate memory!!!!\n" );
+ ErrorF("COFFDelayRelocation() Unable to allocate memory!!!!\n");
return 0;
}
- reloc->file=cofffile;
- reloc->secndx=secndx;
- reloc->rel=rel;
+ reloc->file = cofffile;
+ reloc->secndx = secndx;
+ reloc->rel = rel;
reloc->next = 0;
return reloc;
@@ -180,83 +177,80 @@ RELOC *rel;
*/
static COFFCommonPtr
-COFFAddCOMMON(sym,index)
-SYMENT *sym;
-int index;
+COFFAddCOMMON(SYMENT *sym, int index)
{
COFFCommonPtr common;
if ((common = xf86loadermalloc(sizeof(COFFCommonRec))) == NULL) {
- ErrorF( "COFFAddCOMMON() Unable to allocate memory!!!!\n" );
+ ErrorF("COFFAddCOMMON() Unable to allocate memory!!!!\n");
return 0;
}
- common->sym=sym;
- common->index=index;
- common->next=0;
+ common->sym = sym;
+ common->index = index;
+ common->next = 0;
return common;
}
static LOOKUP *
-COFFCreateCOMMON(cofffile)
-COFFModulePtr cofffile;
+COFFCreateCOMMON(COFFModulePtr cofffile)
{
- int numsyms=0,size=0,l=0;
- int offset=0;
- LOOKUP *lookup;
+ int numsyms = 0, size = 0, l = 0;
+ int offset = 0;
+ LOOKUP *lookup;
COFFCommonPtr common;
if (listCOMMON == NULL)
return NULL;
- common=listCOMMON;
+ 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);
+ 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;
+ size += common->sym->n_value;
numsyms++;
}
#ifdef COFFDEBUG
COFFDEBUG("COFFCreateCOMMON() %d entries (%d bytes) of COMMON data\n",
- numsyms, size );
+ numsyms, size);
#endif
- if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) {
- ErrorF( "COFFCreateCOMMON() Unable to allocate memory!!!!\n" );
- return NULL;
+ 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;
+ 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);
+ 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 );
+ COFFDEBUG("Adding %p %s\n", (void *)lookup[l].offset,
+ lookup[l].symName);
#endif
- listCOMMON=common->next;
- offset+=common->sym->n_value;
- xf86loaderfree(common);
- l++;
+ listCOMMON = common->next;
+ offset += common->sym->n_value;
+ xf86loaderfree(common);
+ l++;
}
/* listCOMMON == NULL */
- lookup[l].symName=NULL; /* Terminate the list */
+ lookup[l].symName = NULL; /* Terminate the list */
return lookup;
}
@@ -268,68 +262,62 @@ COFFModulePtr cofffile;
* Get symbol name
*/
static char *
-COFFGetSymbolName(cofffile, index)
-COFFModulePtr cofffile;
-int index;
+COFFGetSymbolName(COFFModulePtr cofffile, int index)
{
- char *name;
- SYMENT *sym;
+ char *name;
+ SYMENT *sym;
- sym=(SYMENT *)(((unsigned char *)cofffile->symtab)+(index*SYMESZ));
+ sym = (SYMENT *) (((unsigned char *)cofffile->symtab) + (index * SYMESZ));
#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolName(%x,%x) %x",cofffile, index, sym->n_zeroes );
+ COFFDEBUG("COFFGetSymbolName(%p,%x) %lx", (void *)cofffile, index,
+ sym->n_zeroes);
#endif
name = xf86loadermalloc(sym->n_zeroes ? SYMNMLEN + 1
- : strlen((const char *)&cofffile->strtab[(int)sym->n_offset-4]) + 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]);
- }
+ 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 );
+ COFFDEBUG(" %s\n", name);
#endif
return name;
}
static SYMENT *
-COFFGetSymbol(file, index)
-COFFModulePtr file;
-int index;
+COFFGetSymbol(COFFModulePtr file, int index)
{
- return (SYMENT *)(((unsigned char *)file->symtab)+(index*SYMESZ));
+ return (SYMENT *) (((unsigned char *)file->symtab) + (index * SYMESZ));
}
static unsigned char *
-COFFGetSymbolValue(cofffile, index)
-COFFModulePtr cofffile;
-int index;
+COFFGetSymbolValue(COFFModulePtr cofffile, int index)
{
- unsigned char *symval=0; /* value of the indicated symbol */
+ unsigned char *symval = 0; /* value of the indicated symbol */
itemPtr symbol; /* name/value of symbol */
- char *symname;
+ char *symname;
- symname=COFFGetSymbolName(cofffile, index);
+ symname = COFFGetSymbolName(cofffile, index);
#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolValue() for %s=", symname );
+ COFFDEBUG("COFFGetSymbolValue() for %s=", symname);
#endif
symbol = LoaderHashFind(symname);
- if( symbol )
- symval=(unsigned char *)symbol->address;
+ if (symbol)
+ symval = (unsigned char *)symbol->address;
#ifdef COFFDEBUG
- COFFDEBUG("%x\n", symval );
+ COFFDEBUG("%p\n", symval);
#endif
xf86loaderfree(symname);
@@ -343,22 +331,20 @@ int index;
* same module as the calling function.
*/
static unsigned char *
-COFFGetSymbolGlinkValue(cofffile, index)
-COFFModulePtr cofffile;
-int index;
+COFFGetSymbolGlinkValue(COFFModulePtr cofffile, int index)
{
- unsigned char *symval=0; /* value of the indicated symbol */
+ unsigned char *symval = 0; /* value of the indicated symbol */
itemPtr symbol; /* name/value of symbol */
- char *name;
+ char *name;
- name=COFFGetSymbolName(cofffile, index);
+ name = COFFGetSymbolName(cofffile, index);
#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name );
+ COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name);
#endif
- symbol = LoaderHashFind(name+1); /* Eat the '.' so we get the
- Function descriptor instead */
+ 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.
@@ -373,26 +359,27 @@ int index;
7 00000018 4e800420 bctr # branch to it
*/
- if( symbol ) {
- symval=(unsigned char *)&symbol->code.glink;
+ 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;
+ 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]);
}
@@ -406,17 +393,15 @@ int index;
* 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;
+COFF_RelocateEntry(COFFModulePtr cofffile, int secndx, RELOC *rel)
{
- SYMENT *symbol; /* value of the indicated symbol */
+ 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;
+ itemPtr symitem; /* symbol structure from has table */
+ char *name;
#endif
unsigned char *symval; /* value of the indicated symbol */
@@ -431,386 +416,401 @@ RELOC *rel;
*/
#ifdef COFFDEBUG
- COFFDEBUG("%x %d %o ",
- rel->r_vaddr,rel->r_symndx,rel->r_type );
+ COFFDEBUG("%lx %ld %o ", (unsigned long)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));
+ RELOC_RSIGN(*rel), RELOC_RFIXUP(*rel), RELOC_RLEN(*rel));
#endif
#endif
- symbol=COFFGetSymbol(cofffile,rel->r_symndx);
+ symbol = COFFGetSymbol(cofffile, rel->r_symndx);
#ifdef COFFDEBUG
- COFFDEBUG("%d %x %d-%d\n", symbol->n_sclass, symbol->n_value, symbol->n_scnum, secndx );
+ COFFDEBUG("%d %lx %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 */
+ */
+ 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");
+ 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));
+ 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");
+ 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));
+ 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");
+ 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));
+ dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) +
+ ((unsigned char *)rel->r_vaddr -
+ cofffile->bssaddr));
break;
default:
- FatalError("Relocation against unknown section %d\n", secndx );
+ FatalError("Relocation against unknown section %d\n", secndx);
}
- if( symbol->n_sclass == 0 )
- {
- symval=(unsigned char *)(symbol->n_value+(*dest32)-symbol->n_type);
+ 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 );
+ COFFDEBUG("symbol->n_sclass==0\n");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
#endif
- *dest32=(unsigned long)symval;
- return 0;
- }
+ *dest32 = (unsigned long)symval;
+ return 0;
+ }
- switch( rel->r_type )
- {
+ switch (rel->r_type) {
#if defined(i386)
- case R_DIR32:
- symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
- if( symval ) {
+ 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:
+ char *namestr;
+
+ COFFDEBUG("R_DIR32 %s\n",
+ namestr = COFFGetSymbolName(cofffile, rel->r_symndx));
+ xf86loaderfree(namestr);
+ COFFDEBUG("txtsize=%x\t", cofffile->txtsize);
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\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" );
+ COFFDEBUG("R_DIR32 N_UNDEF\n");
#endif
- return COFFDelayRelocation(cofffile,secndx,rel);
- case N_ABS:
+ return COFFDelayRelocation(cofffile, secndx, rel);
+ case N_ABS:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_ABS\n" );
+ COFFDEBUG("R_DIR32 N_ABS\n");
#endif
- return 0;
- case N_DEBUG:
+ return 0;
+ case N_DEBUG:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_DEBUG\n" );
+ COFFDEBUG("R_DIR32 N_DEBUG\n");
#endif
- return 0;
- case N_COMMENT:
+ return 0;
+ case N_COMMENT:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_COMMENT\n" );
+ COFFDEBUG("R_DIR32 N_COMMENT\n");
#endif
- return 0;
- case N_TEXT:
+ 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:
+ COFFDEBUG("R_DIR32 N_TEXT\n");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\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:
+ COFFDEBUG("R_DIR32 N_DATA\n");
+ COFFDEBUG("txtsize=%x\t", cofffile->txtsize);
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\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 );
- }
-
+ COFFDEBUG("R_DIR32 N_BSS\n");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\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 );
+ COFFDEBUG("*dest32=%8.8lx\n", *dest32);
#endif
+ break;
+ case R_PCRLONG:
+ if (symbol->n_scnum == N_TEXT)
break;
- case R_PCRLONG:
- if( symbol->n_scnum == N_TEXT )
- break;
- symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
+ 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 );
+ COFFDEBUG("R_PCRLONG ");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
#endif
- if( symval == 0 ) {
+ if (symval == 0) {
#ifdef COFFDEBUG
- char *name;
- COFFDEBUG( "***Unable to resolve symbol %s\n",
- name=COFFGetSymbolName(cofffile,rel->r_symndx) );
- xf86loaderfree(name);
+ 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)));
+ return COFFDelayRelocation(cofffile, secndx, rel);
+ }
+ *dest32 = (unsigned long)(symval - ((long)dest32 + sizeof(long)));
#ifdef COFFDEBUG
- COFFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ COFFDEBUG("*dest32=%8.8lx\n", *dest32);
#endif
- break;
- case R_ABS:
- /*
- * Nothing to really do here.
- * Usually, a dummy relocation for .file
- */
- break;
+ 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 ) {
+ 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 );
+ 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:
+ *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" );
+ COFFDEBUG("R_POS N_UNDEF\n");
#endif
- return COFFDelayRelocation(cofffile,secndx,rel);
- case N_ABS:
+ return COFFDelayRelocation(cofffile, secndx, rel);
+ case N_ABS:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_ABS\n" );
+ COFFDEBUG("R_POS N_ABS\n");
#endif
- return 0;
- case N_DEBUG:
+ return 0;
+ case N_DEBUG:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_DEBUG\n" );
+ COFFDEBUG("R_POS N_DEBUG\n");
#endif
- return 0;
- case N_COMMENT:
+ return 0;
+ case N_COMMENT:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_COMMENT\n" );
+ COFFDEBUG("R_POS N_COMMENT\n");
#endif
- return 0;
- case N_TEXT:
+ 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:
+ 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:
+ 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 );
- }
+ 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" );
+ 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" );
+ 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));
+ 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" );
+ 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);
+ 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 == 0 ) {
- name++;
- symitem = LoaderHashFind(name);
- }
- if( symitem && cofffile->module != symitem->module ) {
+ }
+ if (symitem && cofffile->module != symitem->module) {
#ifdef COFFDEBUG
- COFFDEBUG("Symbol module %d != file module %d\n",
- symitem->module, cofffile->module );
+ 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 ) {
+ 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);
+ char *name;
+
+ COFFDEBUG("***Unable to resolve symbol %s\n",
+ name = COFFGetSymbolName(cofffile, rel->r_symndx));
+ xf86loaderfree(name);
#endif
- return COFFDelayRelocation(cofffile,secndx,rel);
- }
+ 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);
+ 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 );
+ 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;
+ 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);
+ 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 );
+ COFFDEBUG("*dest32=%8.8x\n", *dest32);
#endif
- if( cofffile->module != symitem->module ) {
- (*++dest32)=0x80410014; /* lwz r2,20(r1) */
- }
- ppc_flush_icache(--dest32);
+ if (cofffile->module != symitem->module) {
+ (*++dest32) = 0x80410014; /* lwz r2,20(r1) */
}
+ ppc_flush_icache(--dest32);
+ }
- break;
+ break;
#endif /* __powerpc__ */
- default:
- ErrorF(
- "COFF_RelocateEntry() Unsupported relocation type %o\n",
- rel->r_type );
- break;
- }
+ default:
+ ErrorF("COFF_RelocateEntry() Unsupported relocation type %o\n",
+ rel->r_type);
+ break;
+ }
return 0;
}
static COFFRelocPtr
-COFFCollectRelocations(cofffile)
-COFFModulePtr cofffile;
+COFFCollectRelocations(COFFModulePtr cofffile)
{
- unsigned short i,j;
- RELOC *rel;
- SCNHDR *sec;
+ 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);
+ 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;
}
@@ -826,199 +826,191 @@ COFFModulePtr cofffile;
*/
static LOOKUP *
-COFF_GetSymbols(cofffile)
-COFFModulePtr cofffile;
+COFF_GetSymbols(COFFModulePtr cofffile)
{
- SYMENT *sym;
- AUXENT *aux=NULL;
- int i, l, numsyms;
- LOOKUP *lookup, *lookup_common, *p;
- char *symname;
+ 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;
+ numsyms = cofffile->header->f_nsyms;
#ifdef COFFDEBUG
- COFFDEBUG("COFF_GetSymbols(): %d symbols\n", numsyms );
+ 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");
+ 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)
+ 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;
+ 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));
+ COFFDEBUG("\t%d %d %lx %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%ld %lx %x %x %x %lx %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 );
+ COFFDEBUG("TOC=%lx\n", cofffile->toc);
+ COFFDEBUG("TOCaddr=%p\n", cofffile->tocaddr);
#endif
- continue;
- }
- if( sym->n_sclass == C_HIDEXT ) {
+ 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 );
+ 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);
+ 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);
+ COFFDEBUG("Adding COMMON space for %s\n", name);
+#endif
+ if (!LoaderHashFind(name)) {
+ tmp = COFFAddCOMMON(sym, i);
+ if (tmp) {
+ tmp->next = listCOMMON;
+ listCOMMON = tmp;
}
- xf86loaderfree(symname);
- break;
- case N_ABS:
- case N_DEBUG:
- case N_COMMENT:
+ }
+ 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);
+ 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 );
+ COFFDEBUG("Adding %p %s\n",
+ (void *)lookup[l].offset, lookup[l].symName);
#endif
- l++;
- }
- else {
+ l++;
+ } else {
#ifdef COFFDEBUG
- COFFDEBUG( "TEXT Section not loaded %d\n",
- sym->n_scnum-1 );
+ 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);
+ 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 );
+ COFFDEBUG("Adding %p %s\n",
+ (void *)lookup[l].offset, lookup[l].symName);
#endif
- l++;
- }
- else {
+ l++;
+ } else {
#ifdef COFFDEBUG
- COFFDEBUG( "DATA Section not loaded %d\n",
- sym->n_scnum-1 );
+ 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);
+ 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 );
+ COFFDEBUG("Adding %p %s\n",
+ (void *)lookup[l].offset, lookup[l].symName);
#endif
- l++;
- }
- else {
+ l++;
+ } else {
#ifdef COFFDEBUG
- COFFDEBUG( "BSS Section not loaded %d\n",
- sym->n_scnum-1 );
+ 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;
- }
+ xf86loaderfree(symname);
+ }
+ break;
+ default:
+ ErrorF("Unknown Section number %d\n", sym->n_scnum);
+ xf86loaderfree(symname);
+ break;
}
+ }
- lookup[l].symName=NULL; /* Terminate the list */
+ 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));
+ for (i = 0, p = lookup_common; p->symName; i++, p++) ;
+ memcpy(&(lookup[l]), lookup_common, i * sizeof(LOOKUP));
xf86loaderfree(lookup_common);
l += i;
@@ -1030,10 +1022,11 @@ COFFModulePtr cofffile;
*/
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")
+ || !strcmp(lookup[i].symName, ".data")
+ || !strcmp(lookup[i].symName, ".bss")
)) {
- memmove(&(lookup[i]), &(lookup[i+1]), (l-- - i) * sizeof (LOOKUP));
+ memmove(&(lookup[i]), &(lookup[i + 1]),
+ (l-- - i) * sizeof(LOOKUP));
}
}
@@ -1052,94 +1045,95 @@ COFFModulePtr cofffile;
* Do the work required to load each section into memory.
*/
static void
-COFFCollectSections(cofffile)
-COFFModulePtr cofffile;
+COFFCollectSections(COFFModulePtr cofffile)
{
- unsigned short i;
+ unsigned short i;
/*
* Find and identify all of the Sections
*/
#ifdef COFFDEBUG
- COFFDEBUG("COFFCollectSections(): %d sections\n", cofffile->numsh );
+ COFFDEBUG("COFFCollectSections(): %d sections\n", cofffile->numsh);
#endif
- for( i=0; i<cofffile->numsh; i++) {
+ for (i = 0; i < cofffile->numsh; i++) {
#ifdef COFFDEBUG
- COFFDEBUG("%d %s\n", i, cofffile->sections[i].s_name );
+ 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");
+ 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 );
+ COFFDEBUG(".text starts at %p (%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");
+ 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 );
+ COFFDEBUG(".data starts at %p (%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));
+ 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);
+ 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 );
+ COFFDEBUG(".bss starts at %p (%x bytes)\n", cofffile->bss,
+ cofffile->bsssize);
#endif
continue;
}
/* .comment */
- if( strncmp(cofffile->sections[i].s_name,
- ".comment",strlen(".comment") ) == 0 ) {
+ if (strncmp(cofffile->sections[i].s_name,
+ ".comment", strlen(".comment")) == 0) {
continue;
}
/* .stab */
- if( strcmp(cofffile->sections[i].s_name,
- ".stab" ) == 0 ) {
+ if (strcmp(cofffile->sections[i].s_name, ".stab") == 0) {
continue;
}
/* .stabstr */
- if( strcmp(cofffile->sections[i].s_name,
- ".stabstr" ) == 0 ) {
+ if (strcmp(cofffile->sections[i].s_name, ".stabstr") == 0) {
continue;
}
/* .stab.* */
- if( strncmp(cofffile->sections[i].s_name,
- ".stab.", strlen(".stab.") ) == 0 ) {
+ if (strncmp(cofffile->sections[i].s_name,
+ ".stab.", strlen(".stab.")) == 0) {
continue;
}
- ErrorF("COFF: Not loading %s\n", cofffile->sections[i].s_name );
+ ErrorF("COFF: Not loading %s\n", cofffile->sections[i].s_name);
}
}
@@ -1147,52 +1141,54 @@ COFFModulePtr cofffile;
* Public API for the COFF implementation of the loader.
*/
void *
-COFFLoadModule(modrec, cofffd, ppLookup)
-loaderPtr modrec;
-int cofffd;
-LOOKUP **ppLookup;
+COFFLoadModule(loaderPtr modrec, int cofffd, LOOKUP **ppLookup)
{
- COFFModulePtr cofffile;
+ COFFModulePtr cofffile;
FILHDR *header;
- int stroffset; /* offset of string table */
+ int stroffset; /* offset of string table */
COFFRelocPtr coff_reloc, tail;
- void *v;
+ void *v;
#ifdef COFFDEBUG
- COFFDEBUG("COFFLoadModule(%s,%x,%x)\n",modrec->name,modrec->handle,cofffd);
+ 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" );
+ 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;
+ 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;
+ cofffile->header =
+ (FILHDR *) _LoaderFileToMem(cofffd, 0, sizeof(FILHDR), "header");
+ header = (FILHDR *) cofffile->header;
- if( header->f_symptr == 0 || header->f_nsyms == 0 ) {
+ if (header->f_symptr == 0 || header->f_nsyms == 0) {
ErrorF("No symbols found in module\n");
- _LoaderFreeFileMem(header,sizeof(FILHDR));
+ _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 *));
+ 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 ?????
@@ -1206,13 +1202,14 @@ LOOKUP **ppLookup;
/*
* load the string table (must be done before we process symbols).
*/
- stroffset=header->f_symptr+(header->f_nsyms*SYMESZ);
+ stroffset = header->f_symptr + (header->f_nsyms * SYMESZ);
- _LoaderFileRead(cofffd,stroffset,&(cofffile->strsize),sizeof(int));
+ _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");
+ 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
@@ -1224,8 +1221,7 @@ LOOKUP **ppLookup;
*/
coff_reloc = COFFCollectRelocations(cofffile);
if (coff_reloc) {
- for (tail = coff_reloc; tail->next; tail = tail->next)
- ;
+ for (tail = coff_reloc; tail->next; tail = tail->next) ;
tail->next = _LoaderGetRelocations(v)->coff_reloc;
_LoaderGetRelocations(v)->coff_reloc = coff_reloc;
}
@@ -1234,8 +1230,7 @@ LOOKUP **ppLookup;
}
void
-COFFResolveSymbols(mod)
-void *mod;
+COFFResolveSymbols(void *mod)
{
COFFRelocPtr newlist, p, tmp;
@@ -1243,7 +1238,7 @@ void *mod;
* which we failed to relocate. Destroy the old list in the process.
*/
newlist = 0;
- for (p = _LoaderGetRelocations(mod)->coff_reloc; p; ) {
+ 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. */
@@ -1258,53 +1253,51 @@ void *mod;
}
int
-COFFCheckForUnresolved( mod)
-void *mod;
+COFFCheckForUnresolved(void *mod)
{
- char *name;
+ char *name;
COFFRelocPtr crel;
int flag, fatalsym = 0;
if ((crel = _LoaderGetRelocations(mod)->coff_reloc) == NULL)
return 0;
- while( crel )
- {
+ while (crel) {
name = COFFGetSymbolName(crel->file, crel->rel->r_symndx);
- flag = _LoaderHandleUnresolved(name,
- _LoaderHandleToName(crel->file->handle));
- if (flag) fatalsym = 1;
+ flag = _LoaderHandleUnresolved(name,
+ _LoaderHandleToName(crel->file->
+ handle));
+ if (flag)
+ fatalsym = 1;
xf86loaderfree(name);
- crel=crel->next;
- }
+ crel = crel->next;
+ }
return fatalsym;
}
void
-COFFUnloadModule(modptr)
-void *modptr;
+COFFUnloadModule(void *modptr)
{
- COFFModulePtr cofffile = (COFFModulePtr)modptr;
- COFFRelocPtr relptr, reltptr, *brelptr;
+ 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 */
+ 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 */
}
- else {
- brelptr=&(relptr->next);
- relptr=relptr->next; /* advance the pointer */
- }
}
/*
@@ -1318,22 +1311,22 @@ void *modptr;
*/
#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 )
+ 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);
+ _LoaderFreeFileMem(cofffile->sections, cofffile->secsize);
xf86loaderfree(cofffile->saddr);
xf86loaderfree(cofffile->reladdr);
- _LoaderFreeFileMem(cofffile->header,sizeof(FILHDR));
+ _LoaderFreeFileMem(cofffile->header, sizeof(FILHDR));
/*
* Free the COFFModuleRec
*/
@@ -1345,14 +1338,14 @@ void *modptr;
char *
COFFAddressToSection(void *modptr, unsigned long address)
{
- COFFModulePtr cofffile = (COFFModulePtr)modptr;
+ 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;
+ 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
index 35ce4b2c5..217474671 100644
--- a/hw/xfree86/loader/coffloader.h
+++ b/hw/xfree86/loader/coffloader.h
@@ -21,7 +21,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.h,v 1.3 1998/09/20 14:41:04 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */
#ifndef _COFFLOADER_H
#define _COFFLOADER_H
@@ -29,6 +29,6 @@
extern void *COFFLoadModule(loaderPtr, int, LOOKUP **);
extern void COFFResolveSymbols(void *);
extern int COFFCheckForUnresolved(void *);
-extern char *COFFAddressToSection(void *,unsigned long);
+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
index 3c1d5b883..3808cf3e3 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -1,8 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.53 2003/01/26 16:40:42 eich Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.61 2003/11/10 18:22:35 tsi Exp $ */
/*
- *
* Copyright 1995-1998 by Metro Link, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -23,6 +21,32 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#undef DBMALLOC
#include "sym.h"
@@ -68,300 +92,309 @@ extern int NumCurrentSelections;
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)
+ /* 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)
+ 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)
+ /* 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)
+ 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)
+ /* 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)
+ SYMVAR(currentRegionScreen)
+ /* bigreq */
+ SYMVAR(maxBigRequestSize)
#ifdef XV
- /* XXX These are exported from the DDX, not DIX. */
- SYMVAR(XvScreenInitProc)
- SYMVAR(XvGetScreenIndexProc)
- SYMVAR(XvGetRTPortProc)
- SYMVAR(XvMCScreenInitProc)
+ /* 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)
+#ifdef PIXPRIV
+ SYMFUNC(AllocatePixmapPrivateIndex)
+ SYMFUNC(AllocatePixmapPrivate)
#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)
+ /* 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)
+ SYMFUNC(SecurityLookupIDByClass)
+ SYMFUNC(SecurityLookupIDByType)
#endif
- SYMFUNC(FindClientResourcesByType)
- SYMFUNC(FindAllClientResources)
- SYMVAR(lastResourceType)
- SYMVAR(TypeMask)
+ SYMFUNC(FindClientResourcesByType)
+ SYMFUNC(FindAllClientResources)
+ SYMVAR(lastResourceType)
+ SYMVAR(TypeMask)
#ifdef RES
- SYMFUNC(RegisterResourceName)
- SYMVAR(ResourceNames)
+ 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)
+ /* 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)
+ /*os/ */
+ /* access.c */
+ SYMFUNC(LocalClient)
+ /* utils.c */
+ SYMFUNC(Xstrdup)
+ SYMFUNC(XNFstrdup)
+ SYMVAR(Must_have_memory)
+ SYMFUNC(AdjustWaitForDelay)
+ SYMVAR(noTestExtensions)
+ SYMFUNC(GiveUp)
+ /* log.c */
+ SYMFUNC(LogVWrite)
+ SYMFUNC(LogWrite)
+ SYMFUNC(LogVMessageVerb)
+ SYMFUNC(LogMessageVerb)
+ SYMFUNC(LogMessage)
+ SYMFUNC(FatalError)
+ SYMFUNC(VErrorF)
+ SYMFUNC(ErrorF)
+ SYMFUNC(Error)
+ /* 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)
- /* devices.c */
- SYMFUNC(InitPointerDeviceStruct)
- SYMFUNC(LookupKeyboardDevice)
- SYMFUNC(LookupPointerDevice)
+ /* devices.c */
+ SYMFUNC(InitPointerDeviceStruct)
+ SYMFUNC(LookupKeyboardDevice)
+ SYMFUNC(LookupPointerDevice)
#ifdef XKB
- /* xkb/xkbInit.c */
- SYMFUNC(XkbInitKeyboardDeviceStruct)
- SYMFUNC(XkbSetRulesDflts)
- SYMVAR(noXkbExtension)
+ /* xkb/xkbInit.c */
+ SYMFUNC(XkbInitKeyboardDeviceStruct)
+ SYMFUNC(XkbSetRulesDflts)
+ SYMVAR(noXkbExtension)
#endif
#ifdef XINPUT
- /* Xi */
- /* exevents.c */
- SYMFUNC(InitValuatorAxisStruct)
- SYMFUNC(InitProximityClassDeviceStruct)
- /* extinit.c */
- SYMFUNC(AssignTypeAndName)
+ /* 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)
+ /* xf86DGA.c */
+ /* XXX This is exported from the DDX, not DIX. */
+ SYMVAR(XDGAEventBase)
- /* librender.a */
+ /* 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)
+ 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 },
-
+ {0, 0}
};
diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c
index bf4c8c078..9d3011caf 100644
--- a/hw/xfree86/loader/dlloader.c
+++ b/hw/xfree86/loader/dlloader.c
@@ -1,5 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.c,v 1.11 2000/08/23 22:10:14 tsi Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.c,v 1.13 2003/10/15 16:29:02 dawes Exp $ */
/*
*
@@ -100,13 +99,13 @@ DLFindSymbol(const char *name)
n = xf86loadermalloc(strlen(name) + 2);
sprintf(n, "_%s", name);
#endif
-
- (void)dlerror(); /* Clear out any previous error */
+
+ (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);
+ p = dlsym(l->module->dlhandle, n);
#else
- p = dlsym(l->module->dlhandle, name);
+ p = dlsym(l->module->dlhandle, name);
#endif
if (dlerror() == NULL) {
#ifdef NEED_UNDERSCORE_FOR_DLLSYM
@@ -115,10 +114,10 @@ DLFindSymbol(const char *name)
return p;
}
}
-#ifdef NEED_UNDERSCORE_FOR_DLLSYM
+#ifdef NEED_UNDERSCORE_FOR_DLLSYM
xf86loaderfree(n);
#endif
-
+
return NULL;
}
@@ -126,12 +125,12 @@ DLFindSymbol(const char *name)
* public interface
*/
void *
-DLLoadModule(loaderPtr modrec, int fd, LOOKUP **ppLookup)
+DLLoadModule(loaderPtr modrec, int fd, LOOKUP ** ppLookup)
{
DLModulePtr dlfile;
DLModuleList *l;
- if ((dlfile=xf86loadercalloc(1,sizeof(DLModuleRec)))==NULL) {
+ if ((dlfile = xf86loadercalloc(1, sizeof(DLModuleRec))) == NULL) {
ErrorF("Unable to allocate DLModuleRec\n");
return NULL;
}
@@ -167,7 +166,7 @@ DLCheckForUnresolved(void *mod)
void
DLUnloadModule(void *modptr)
{
- DLModulePtr dlfile = (DLModulePtr)modptr;
+ DLModulePtr dlfile = (DLModulePtr) modptr;
DLModuleList *l, *p;
/* remove it from dlModuleList */
diff --git a/hw/xfree86/loader/elf.h b/hw/xfree86/loader/elf.h
index ad072c199..91130e63d 100644
--- a/hw/xfree86/loader/elf.h
+++ b/hw/xfree86/loader/elf.h
@@ -1,19 +1,18 @@
-/* $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;
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.17 2003/10/15 16:29:02 dawes 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
@@ -42,7 +41,7 @@ typedef long Elf64_Sxword;
#define EM_386 3
#define EM_68K 4
#define EM_88K 5
-#define EM_486 6 /* Perhaps disused */
+#define EM_486 6 /* Perhaps disused */
#define EM_860 7
#define EM_MIPS 8
#define EM_MIPS_RS4_BE 10
@@ -101,23 +100,23 @@ typedef long Elf64_Sxword;
#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_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_Sxword d_tag;
+ union {
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
} Elf64_Dyn;
#ifndef QNX4
-extern Elf32_Dyn _DYNAMIC [];
+extern Elf32_Dyn _DYNAMIC[];
#endif
/* The following are used with relocations */
@@ -141,7 +140,7 @@ extern Elf32_Dyn _DYNAMIC [];
#define R_386_GOTPC 10
#define R_386_NUM 11
-/* x86_64 Relocation Types */
+/* AMD64 Relocation Types */
#define R_X86_64_NONE 0
#define R_X86_64_64 1
#define R_X86_64_PC32 2
@@ -221,29 +220,29 @@ extern Elf32_Dyn _DYNAMIC [];
#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 */
+#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 */
@@ -495,79 +494,79 @@ extern Elf32_Dyn _DYNAMIC [];
#define R_ARM_RBASE 255
typedef struct elf32_rel {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
} Elf32_Rel;
typedef struct elf64_rel {
- Elf64_Addr r_offset;
- Elf64_Xword r_info;
+ 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;
+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;
+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;
+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;
+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;
+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;
+ 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
@@ -576,27 +575,26 @@ typedef struct elf64hdr {
#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;
+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;
+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 */
@@ -618,7 +616,7 @@ typedef struct
#define SHT_LOUSER 0x80000000
#define SHT_HIUSER 0xffffffff
-#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
/* sh_flags */
#define SHF_WRITE 0x1
@@ -634,35 +632,34 @@ typedef struct
#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_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;
+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_MAG0 0 /* e_ident[] indexes */
#define EI_MAG1 1
#define EI_MAG2 2
#define EI_MAG3 3
@@ -671,7 +668,7 @@ typedef struct
#define EI_VERSION 6
#define EI_PAD 7
-#define ELFMAG0 0x7f /* EI_MAG */
+#define ELFMAG0 0x7f /* EI_MAG */
#define ELFMAG1 'E'
#define ELFMAG2 'L'
#define ELFMAG3 'F'
@@ -681,16 +678,16 @@ typedef struct
#define ELFDLMAG 3
#define ELFDLOFF 16
-#define ELFCLASSNONE 0 /* EI_CLASS */
+#define ELFCLASSNONE 0 /* EI_CLASS */
#define ELFCLASS32 1
#define ELFCLASS64 2
#define ELFCLASSNUM 3
-#define ELFDATANONE 0 /* e_ident[EI_DATA] */
+#define ELFDATANONE 0 /* e_ident[EI_DATA] */
#define ELFDATA2LSB 1
#define ELFDATA2MSB 2
-#define EV_NONE 0 /* e_version, EI_VERSION */
+#define EV_NONE 0 /* e_version, EI_VERSION */
#define EV_CURRENT 1
#define EV_NUM 2
@@ -702,9 +699,9 @@ typedef struct
/* 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_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
index 822a50efa..5ab8af62d 100644
--- a/hw/xfree86/loader/elfloader.c
+++ b/hw/xfree86/loader/elfloader.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.49 2003/01/24 17:26:35 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.62 2003/11/06 18:38:13 tsi Exp $ */
/*
*
@@ -23,7 +23,9 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
+#ifndef __UNIXOS2__
#include <sys/mman.h>
+#endif
#include <unistd.h>
#include <stdlib.h>
#ifdef __QNX__
@@ -52,13 +54,75 @@
#include "compiler.h"
-#undef LDTEST
+#ifndef LOADERDEBUG
+#define LOADERDEBUG 0
+#endif
-/*
-#ifndef LDTEST
+#if LOADERDEBUG
# define ELFDEBUG ErrorF
#endif
-*/
+
+#if defined(__ia64__)
+
+/*
+ * R_IA64_LTOFF22X and R_IA64_LDXMOV are relocation optimizations for
+ * IA64. Conforming implementations must recognize them and may either
+ * implement the optimization or may fallback to previous
+ * non-optimized behavior by treating R_IA64_LTOFF22X as a
+ * R_IA64_LTOFF22 and ignoring R_IA64_LDXMOV. The
+ * IA64_LDX_OPTIMIZATION conditional controls the fallback behavior,
+ * if defined the optimizations are performed.
+ *
+ * To implement the optimization we want to change is the sequence on
+ * the left to that on the right, without regard to any intervening
+ * instructions:
+ *
+ * 1) addl t1=@ltoff(var),gp ==> addl t1=@gprel(var),gp
+ * 2) ld8 t2=[t1] ==> mov t2=t1
+ * 3) ld8 loc0=[t2] ==> ld8 loc0=[t2]
+ *
+ * The relocations that match the above instructions are:
+ *
+ * 1) R_IA64_LTOFF22 ==> R_IA64_LTOFF22X
+ * 2) -- ==> R_IA64_LDXMOV
+ * 3) -- ==> --
+ *
+ * First lets look at left hand column to understand the original
+ * mechanism. The virtual address of a symbol is stored in the GOT,
+ * when that symbol is referenced the following sequence occurs,
+ * instruction 1 loads the address of the GOT entry containing the
+ * virtural address of the symbol into t1. Instruction 2 loads the
+ * virtual address of the symbol into t2 by dereferencing t1. Finally
+ * the symbol is loaded in instruction 3 by dereferencing its virtual
+ * address in t2.
+ *
+ * The optimization that LTOFF22X/LDXMOV introduces is based on the
+ * observation we are doing an extra load (instruction 2) if we can
+ * generate the virtual address for the symbol without doing a lookup in
+ * the GOT. This is possible if the virtual address of the symbol can be
+ * computed via GP relative addressing. In other words the virtual
+ * address of the symbol is a fixed offset from the GP. This fixed offset
+ * must be within the limits of the signed 22 bit immediate offset in the
+ * ld8 instruction, otherwise the original indirect GOT lookup must be
+ * performed (LTOFF22).
+ *
+ * If we can use GP relative addressing for the symbol then the
+ * instruction that loaded the virtual address of the symbol into t2 must
+ * also be patched, hence the introduction of the LDXMOV relocation. The
+ * LDXMOV essentially turns the GOT lookup into a no-op by changing the
+ * ld8 into a register move that preserves the register location of the
+ * symbol's virtual address (e.g. t2).
+ *
+ * The important point to recognize when implementing the LTOFF22X/LDXMOV
+ * optimization is that relocations are interdependent, the LDXMOV is
+ * only applied if the LTOFF22X is applied. It is also worth noting that
+ * there is no relationship between LDXMOV relocations and LTOFF22X in
+ * the ELF relocation section other than they share the same
+ * symbol+addend value.
+ */
+
+#define IA64_LDX_OPTIMIZATION 1
+#endif
#ifndef UseMMAP
# if defined (__ia64__) || defined (__sparc__)
@@ -73,7 +137,7 @@
# if !defined(linux)
# error No MAP_ANON?
# endif
-# if !defined (__x86_64__)
+# if !defined (__AMD64__) || !defined(__linux__)
# define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON)
# else
# define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_32BIT)
@@ -91,7 +155,7 @@
#if defined (__alpha__) || \
defined (__ia64__) || \
- defined (__x86_64__) || \
+ defined (__AMD64__) || \
(defined (__sparc__) && \
(defined (__arch64__) || \
defined (__sparcv9)))
@@ -105,6 +169,7 @@ 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
@@ -117,17 +182,17 @@ typedef Elf64_Word Elf_Word;
*
*/
typedef struct _elf_GOT_Entry {
- Elf_Rela *rel;
- int offset;
- struct _elf_GOT_Entry *next;
+ 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];
+ unsigned int size;
+ unsigned int nuses;
+ unsigned char *freeptr;
+ struct _elf_GOT *next;
+ unsigned char section[1];
} ELFGotRec, *ELFGotPtr;
# ifdef MergeSectionAlloc
@@ -141,10 +206,10 @@ static ELFGotPtr ELFSharedGOTs;
* have already been added to the PLT.
*/
typedef struct _elf_PLT_Entry {
- Elf_Rela *rel;
- int offset;
- int gotoffset;
- struct _elf_PLT_Entry *next;
+ Elf_Rela *rel;
+ int offset;
+ int gotoffset;
+ struct _elf_PLT_Entry *next;
} ELFPltEntryRec, *ELFPltEntryPtr;
/*
@@ -152,10 +217,10 @@ typedef struct _elf_PLT_Entry {
* of entries that have already been added to the OPD.
*/
typedef struct _elf_OPD {
- LOOKUP *l;
- int index;
- int offset;
- struct _elf_OPD *next;
+ LOOKUP *l;
+ int index;
+ int offset;
+ struct _elf_OPD *next;
} ELFOpdRec, *ELFOpdPtr;
# endif
@@ -170,6 +235,7 @@ 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
@@ -181,10 +247,10 @@ typedef Elf32_Word Elf_Word;
defined(__alpha__) || \
defined(__sparc__) || \
defined(__ia64__) || \
- defined(__x86_64__)
+ defined(__AMD64__)
typedef Elf_Rela Elf_Rel_t;
#else
-typedef Elf_Rel Elf_Rel_t;
+typedef Elf_Rel Elf_Rel_t;
#endif
typedef struct {
@@ -203,57 +269,57 @@ typedef struct {
* 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 */
+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__)*/
+ 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 */
+ 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;
+ 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;
+ Elf_Rel_t *rel;
+ ELFModulePtr file;
+ Elf_Word secn;
+ struct _elf_reloc *next;
} ELFRelocRec;
/*
@@ -263,11 +329,11 @@ typedef struct _elf_reloc {
* are done.
*/
typedef struct _elf_COMMON {
- Elf_Sym *sym;
- struct _elf_COMMON *next;
+ Elf_Sym *sym;
+ struct _elf_COMMON *next;
} ELFCommonRec;
-static ELFCommonPtr listCOMMON=NULL;
+static ELFCommonPtr listCOMMON = NULL;
/* Prototypes for static functions */
static int ELFhashCleanOut(void *, itemPtr);
@@ -277,14 +343,16 @@ 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 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 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);
@@ -296,21 +364,19 @@ static void ElfAddPLT(ELFModulePtr, Elf_Rel_t *);
static void ELFCreatePLT(ELFModulePtr);
enum ia64_operand {
IA64_OPND_IMM22,
- IA64_OPND_TGT25C
+ IA64_OPND_TGT25C,
+ IA64_OPND_LDXMOV
};
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;
+ELFLoaderSectToMem(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);
@@ -319,17 +385,15 @@ char *label;
}
static void *
-ELFLoaderSectCalloc(elffile, align, size)
-ELFModulePtr elffile;
-int align;
-int size;
+ELFLoaderSectCalloc(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 */
+ memset(ret, 0, size); /* mmap() does this for us */
#endif
return ret;
}
@@ -343,13 +407,11 @@ _LoaderFileToMem((elffile)->fd,offset,size,label)
* Utility Functions
*/
-
static int
-ELFhashCleanOut(voidptr, item)
-void *voidptr;
-itemPtr item ;
+ELFhashCleanOut(void *voidptr, itemPtr item)
{
ELFModulePtr module = (ELFModulePtr) voidptr;
+
return (module->handle == item->handle);
}
@@ -357,31 +419,29 @@ itemPtr item ;
* Manage listResolv
*/
static ELFRelocPtr
-ElfDelayRelocation(elffile, secn, rel)
-ELFModulePtr elffile;
-Elf_Word secn;
-Elf_Rel_t *rel;
+ElfDelayRelocation(ELFModulePtr elffile, Elf_Word secn, Elf_Rel_t *rel)
{
- ELFRelocPtr reloc;
+ ELFRelocPtr reloc;
if ((reloc = xf86loadermalloc(sizeof(ELFRelocRec))) == NULL) {
- ErrorF( "ElfDelayRelocation() Unable to allocate memory!!!!\n" );
+ ErrorF("ElfDelayRelocation() Unable to allocate memory!!!!\n");
return 0;
}
- reloc->file=elffile;
- reloc->secn=secn;
- reloc->rel=rel;
- reloc->next=0;
+ reloc->file = elffile;
+ reloc->secn = secn;
+ reloc->rel = rel;
+ reloc->next = 0;
#ifdef ELFDEBUG
- ELFDEBUG("ElfDelayRelocation %lx: file %lx, sec %d,"
+ ELFDEBUG("ElfDelayRelocation %p: file %p, sec %d,"
" r_offset 0x%lx, r_info 0x%x",
- reloc, elffile, secn, rel->r_offset, rel->r_info);
+ (void *)reloc, (void *)elffile, secn,
+ (unsigned long)rel->r_offset, rel->r_info);
# if defined(__powerpc__) || \
defined(__mc68000__) || \
defined(__alpha__) || \
defined(__sparc__) || \
defined(__ia64__) || \
- defined(__x86_64__)
+ defined(__AMD64__)
ELFDEBUG(", r_addend 0x%lx", rel->r_addend);
# endif
ELFDEBUG("\n");
@@ -393,162 +453,146 @@ Elf_Rel_t *rel;
* Manage listCOMMON
*/
static ELFCommonPtr
-ElfAddCOMMON(sym)
-Elf_Sym *sym;
+ElfAddCOMMON(Elf_Sym *sym)
{
ELFCommonPtr common;
if ((common = xf86loadermalloc(sizeof(ELFCommonRec))) == NULL) {
- ErrorF( "ElfAddCOMMON() Unable to allocate memory!!!!\n" );
+ ErrorF("ElfAddCOMMON() Unable to allocate memory!!!!\n");
return 0;
}
- common->sym=sym;
- common->next=0;
+ common->sym = sym;
+ common->next = 0;
return common;
}
static int
ElfCOMMONSize(void)
{
- int size=0;
+ int size = 0;
ELFCommonPtr common;
for (common = listCOMMON; common; common = common->next) {
- size+=common->sym->st_size;
+ size += common->sym->st_size;
#if defined(__alpha__) || \
defined(__ia64__) || \
- defined(__x86_64__) || \
+ defined(__AMD64__) || \
(defined(__sparc__) && \
(defined(__arch64__) || \
defined(__sparcv9)))
- size = (size+7)&~0x7;
+ size = (size + 7) & ~0x7;
#endif
}
return size;
}
static int
-ElfCreateCOMMON(elffile,pLookup)
-ELFModulePtr elffile;
-LOOKUP *pLookup;
+ElfCreateCOMMON(ELFModulePtr elffile, LOOKUP *pLookup)
{
- int numsyms=0,size=0,l=0;
- int offset=0,firstcommon=0;
+ 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;
+ size += common->sym->st_size;
#if defined(__alpha__) || \
defined(__ia64__) || \
- defined(__x86_64__) || \
+ defined(__AMD64__) || \
(defined(__sparc__) && \
(defined(__arch64__) || \
defined(__sparcv9)))
- size = (size+7)&~0x7;
+ size = (size + 7) & ~0x7;
#endif
numsyms++;
}
#ifdef ELFDEBUG
ELFDEBUG("ElfCreateCOMMON() %d entries (%d bytes) of COMMON data\n",
- numsyms, size );
+ numsyms, size);
#endif
- elffile->comsize=size;
- if((elffile->common = ELFLoaderSectCalloc(elffile,8,size)) == NULL) {
- ErrorF( "ElfCreateCOMMON() Unable to allocate memory!!!!\n" );
+ 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));
+ if (DebuggerPresent) {
+ ldrCommons = xf86loadermalloc(numsyms * sizeof(LDRCommon));
nCommons = numsyms;
}
- for (l = 0; pLookup[l].symName; l++)
- ;
- firstcommon=l;
-
+ 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;
+ 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);
+ 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);
+ ELFDEBUG("Adding common %p %s\n",
+ (void *)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);
+ 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;
+ listCOMMON = common->next;
+ offset += common->sym->st_size;
#if defined(__alpha__) || \
defined(__ia64__) || \
- defined(__x86_64__) || \
+ defined(__AMD64__) || \
(defined(__sparc__) && \
(defined(__arch64__) || \
defined(__sparcv9)))
- offset = (offset+7)&~0x7;
+ offset = (offset + 7) & ~0x7;
#endif
xf86loaderfree(common);
l++;
}
/* listCOMMON == 0 */
- pLookup[l].symName=NULL; /* Terminate the list. */
+ pLookup[l].symName = NULL; /* Terminate the list. */
return TRUE;
}
-
/*
* String Table
*/
static char *
-ElfGetStringIndex(file, offset, index)
-ELFModulePtr file;
-int offset;
-int index;
+ElfGetStringIndex(ELFModulePtr file, int offset, int index)
{
- if( !offset || !index )
- return "";
+ if (!offset || !index)
+ return "";
- return (char *)(file->saddr[index]+offset);
+ return (char *)(file->saddr[index] + offset);
}
static char *
-ElfGetString(file, offset)
-ELFModulePtr file;
-int offset;
+ElfGetString(ELFModulePtr file, int offset)
{
- return ElfGetStringIndex( file, offset, file->strndx );
+ return ElfGetStringIndex(file, offset, file->strndx);
}
static char *
-ElfGetSectionName(file, offset)
-ELFModulePtr file;
-int offset;
+ElfGetSectionName(ELFModulePtr file, int offset)
{
- return (char *)(file->shstraddr+offset);
+ return (char *)(file->shstraddr + offset);
}
-
-
/*
* Symbol Table
*/
@@ -557,113 +601,105 @@ int offset;
* Get symbol name
*/
static char *
-ElfGetSymbolNameIndex(elffile, index, secndx)
-ELFModulePtr elffile;
-int index;
-int secndx;
+ElfGetSymbolNameIndex(ELFModulePtr elffile, int index, int secndx)
{
- Elf_Sym *syms;
+ Elf_Sym *syms;
#ifdef ELFDEBUG
- ELFDEBUG("ElfGetSymbolNameIndex(%x,%x) ",index, secndx );
+ ELFDEBUG("ElfGetSymbolNameIndex(%x,%x) ", index, secndx);
#endif
- syms=(Elf_Sym *)elffile->saddr[secndx];
+ 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),
+ 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);
+ ELFDEBUG("%lx\n", (unsigned long)syms[index].st_value);
#endif
- return ElfGetString(elffile,syms[index].st_name );
+ return ElfGetString(elffile, syms[index].st_name);
}
static char *
-ElfGetSymbolName(elffile, index)
-ELFModulePtr elffile;
-int index;
+ElfGetSymbolName(ELFModulePtr elffile, int index)
{
return ElfGetSymbolNameIndex(elffile, index, elffile->symndx);
}
static Elf_Addr
-ElfGetSymbolValue(elffile, index)
-ELFModulePtr elffile;
-int index;
+ElfGetSymbolValue(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 */
+ 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];
+ 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);
+ 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;
+ 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);
}
-#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
+ 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;
- 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) );
+ symval = 0;
+ ErrorF("ElfGetSymbolValue(), unhandled symbol scope %x\n",
+ ELF_ST_BIND(syms[index].st_info));
break;
}
+#ifdef ELFDEBUG
+ ELFDEBUG("%p\t", (void *)symbol);
+ ELFDEBUG("%lx\t", (unsigned long)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", (unsigned long)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;
}
@@ -676,30 +712,25 @@ int index;
* will be within a 24 bit offset (non-PIC code).
*/
static Elf_Addr
-ElfGetPltAddr(elffile, index)
-ELFModulePtr elffile;
-int index;
+ElfGetPltAddr(ELFModulePtr elffile, int index)
{
- Elf_Sym *syms;
- Elf_Addr symval=0; /* value of the indicated symbol */
+ 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];
+ 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;
+ 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
@@ -715,43 +746,43 @@ int index;
*/
- 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
+ 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;
- 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" );
+ 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__ */
@@ -761,34 +792,33 @@ int index;
* Manage GOT Entries
*/
static void
-ElfAddGOT(elffile,rel)
-ELFModulePtr elffile;
-Elf_Rel_t *rel;
+ElfAddGOT(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));
+ 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;
+ 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 ) {
+ if (gotent) {
# ifdef ELFDEBUG
ELFDEBUG("Entry already present in GOT\n");
# endif
@@ -796,25 +826,22 @@ Elf_Rel_t *rel;
}
if ((gotent = xf86loadermalloc(sizeof(ELFGotEntryRec))) == NULL) {
- ErrorF( "ElfAddGOT() Unable to allocate memory!!!!\n" );
+ ErrorF("ElfAddGOT() Unable to allocate memory!!!!\n");
return;
}
-
# ifdef ELFDEBUG
- ELFDEBUG("Entry added with offset %x\n",elffile->gotsize);
+ 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;
+ 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;
+ELFCreateGOT(ELFModulePtr elffile, int maxalign)
{
# ifdef MergeSectionAlloc
ELFGotPtr gots;
@@ -825,18 +852,19 @@ int maxalign;
* 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 );
+ 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) );
+ 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;
+ if (elffile->gotsize == 0)
+ elffile->gotsize = 8;
+ elffile->sections[elffile->gotndx].sh_size = elffile->gotsize;
gotsize = elffile->gotsize;
# ifdef MergeSectionAlloc
@@ -853,7 +881,8 @@ int maxalign;
if (gots->section + gots->size - elffile->base >= GOTDistance)
continue;
} else {
- if (elffile->base + elffile->basesize - gots->section >= GOTDistance)
+ if (elffile->base + elffile->basesize - gots->section >=
+ GOTDistance)
continue;
}
elffile->got = gots->freeptr;
@@ -861,20 +890,19 @@ int maxalign;
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 );
+ ELFDEBUG("ELFCreateGOT: GOT address %lx in shared GOT, nuses %d\n",
+ elffile->got, gots->nuses);
# endif
return TRUE;
}
gotsize += 16383 + sizeof(ELFGotRec);
-# endif /*MergeSectionAlloc*/
+# endif /*MergeSectionAlloc */
if ((elffile->got = xf86loadermalloc(gotsize)) == NULL) {
- ErrorF( "ELFCreateGOT() Unable to allocate memory!!!!\n" );
+ ErrorF("ELFCreateGOT() Unable to allocate memory!!!!\n");
return FALSE;
}
-
# ifdef MergeSectionAlloc
if (elffile->got > elffile->base) {
if (elffile->got + elffile->gotsize - elffile->base >= GOTDistance)
@@ -890,7 +918,7 @@ int maxalign;
elffile->basesize += 8 + elffile->gotsize;
elffile->base = xf86loaderrealloc(elffile->base, elffile->basesize);
if (elffile->base == NULL) {
- ErrorF( "ELFCreateGOT() Unable to reallocate memory!!!!\n" );
+ ErrorF("ELFCreateGOT() Unable to reallocate memory!!!!\n");
return FALSE;
}
# if defined(linux) && defined(__ia64__) || defined(__OpenBSD__)
@@ -898,29 +926,36 @@ int maxalign;
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);
+ 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);
+ elffile->base = mremap(elffile->base, oldbasesize,
+ elffile->basesize, MREMAP_MAYMOVE);
if (elffile->base == NULL) {
- ErrorF( "ELFCreateGOT() Unable to remap memory!!!!\n" );
+ 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);
+ 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;
+ gots = (ELFGotPtr) elffile->got;
elffile->got = gots->section;
gots->size = gotsize - sizeof(ELFGotRec) + 1;
gots->nuses = 1;
@@ -929,28 +964,26 @@ int maxalign;
ELFSharedGOTs = gots;
elffile->shared_got = gots;
# ifdef ELFDEBUG
- ELFDEBUG( "ELFCreateGOT: Created a shareable GOT with size %d\n", gots->size);
+ ELFDEBUG("ELFCreateGOT: Created a shareable GOT with size %d\n",
+ gots->size);
# endif
}
-# endif/*MergeSectionAlloc*/
+# endif /*MergeSectionAlloc */
# ifdef ELFDEBUG
- ELFDEBUG( "ELFCreateGOT: GOT address %lx\n", elffile->got );
+ ELFDEBUG("ELFCreateGOT: GOT address %lx\n", elffile->got);
# endif
return TRUE;
}
-#endif /* defined(__alpha__) || defined(__ia64__)*/
+#endif /* defined(__alpha__) || defined(__ia64__) */
#if defined(__ia64__)
/*
* Manage OPD Entries
*/
static void
-ElfAddOPD(elffile,index,l)
-ELFModulePtr elffile;
-int index;
-LOOKUP *l;
+ElfAddOPD(ELFModulePtr elffile, int index, LOOKUP *l)
{
ELFOpdPtr opdent;
@@ -961,37 +994,37 @@ LOOKUP *l;
}
if ((opdent = xf86loadermalloc(sizeof(ELFOpdRec))) == NULL) {
- ErrorF( "ElfAddOPD() Unable to allocate memory!!!!\n" );
+ 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 ;
+ 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;
+ELFCreateOPD(ELFModulePtr elffile)
{
ELFOpdPtr opdent;
if (elffile->got == NULL)
- ErrorF( "ELFCreateOPD() Unallocated GOT!!!!\n" );
+ 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);
+ ((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);
}
}
@@ -999,35 +1032,32 @@ ELFModulePtr elffile;
* Manage PLT Entries
*/
static void
-ElfAddPLT(elffile,rel)
-ELFModulePtr elffile;
-Elf_Rel_t *rel;
+ElfAddPLT(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");
+ 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;
+ 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 ) {
+ if (pltent) {
# ifdef ELFDEBUG
ELFDEBUG("Entry already present in PLT\n");
# endif
@@ -1035,68 +1065,73 @@ Elf_Rel_t *rel;
}
if ((pltent = xf86loadermalloc(sizeof(ELFPltEntryRec))) == NULL) {
- ErrorF( "ElfAddPLT() Unable to allocate memory!!!!\n" );
+ 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 ;
+ 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;
+ELFCreatePLT(ELFModulePtr elffile)
{
# ifdef ELFDEBUG
- ELFDEBUG( "ELFCreatePLT: %x entries in the PLT\n", elffile->pltsize/8 );
+ ELFDEBUG("ELFCreatePLT: %x entries in the PLT\n", elffile->pltsize / 8);
# endif
- if( elffile->pltsize == 0 ) return;
+ if (elffile->pltsize == 0)
+ return;
- if ((elffile->plt = ELFLoaderSectCalloc(elffile,32,elffile->pltsize)) == NULL) {
- ErrorF( "ELFCreatePLT() Unable to allocate memory!!!!\n" );
+ 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;
+ elffile->sections[elffile->pltndx].sh_size = elffile->pltsize;
# ifdef ELFDEBUG
- ELFDEBUG( "ELFCreatePLT: PLT address %lx\n", elffile->plt );
+ 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;
+IA64InstallReloc(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]);
+ 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");
+ 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 & 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 */
@@ -1110,18 +1145,44 @@ long value;
if (value << 39 >> 39 != value || (value & 0xf))
ErrorF("Relocation %016lx truncated to fit into TGT25C\n", value);
break;
+#ifdef IA64_LDX_OPTIMIZATION
+ case IA64_OPND_LDXMOV:
+ /*
+ * Convert "ld8 t2=[t1]" to "mov t2=t1" which is really "add t2=0,t1"
+ * Mask all but the r3,r1,qp fields,
+ * then OR in the ALU opcode = 8 into the opcode field [40:37]
+ *
+ * Mask for the r3,r1,qp bit fields [26:20][12:6][5:0] = 0x7f01fff,
+ * This mask negated only within the 41 bit wide instruction and
+ * shifted left by 5 for the bundle template is 0x3FFF01FC0000
+ *
+ * opcode field [40:37] with a value of 8 is 0x10000000000
+ * shifted left by 5 for the bundle template is 0x200000000000
+ *
+ */
+ data &= ~(0x3FFF01FC0000 << slot);
+ data |= (0x200000000000 << slot);
+ break;
+#endif
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");
+ 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]);
+ ELFDEBUG("After [%016lx%016lx]\n", data128[1], data128[0]);
# endif
}
@@ -1135,13 +1196,11 @@ long value;
*/
static ELFRelocPtr
-Elf_RelocateEntry(elffile, secn, rel, force)
-ELFModulePtr elffile;
-Elf_Word secn;
-Elf_Rel_t *rel;
-int force;
+Elf_RelocateEntry(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
@@ -1150,13 +1209,14 @@ int force;
#endif
#if defined(__sparc__)
unsigned char *dest8; /* address of the 8 bit place being modified */
+ unsigned long *dest64;
#endif
-#if defined(__alpha__)
+#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__)
+#if defined(__AMD64__)
unsigned long *dest64;
int *dest32s;
#endif
@@ -1167,28 +1227,29 @@ int force;
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) );
+ ELFDEBUG("%lx %d %d\n", (unsigned long)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 );
+ defined(__AMD64__)
+ 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)
+ if (ELF_R_SYM(rel->r_info)
+ && ELF_R_TYPE(rel->r_info) != R_ALPHA_GPDISP)
#else
- if (ELF_R_SYM(rel->r_info))
+ 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;
+ symval = (Elf_Addr) & LoaderDefaultFunc;
} else {
#ifdef ELFDEBUG
ELFDEBUG("***Unable to resolve symbol %s\n",
@@ -1199,942 +1260,982 @@ int force;
}
}
- switch( ELF_R_TYPE(rel->r_info) )
- {
+ switch (ELF_R_TYPE(rel->r_info)) {
#if defined(i386)
- case R_386_32:
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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 );
+ ELFDEBUG("R_386_32\t");
+ ELFDEBUG("dest32=%p\t", (void *)dest32);
+ ELFDEBUG("*dest32=%8.8x\t", (unsigned int)*dest32);
# endif
- *dest32=symval+(*dest32); /* S + A */
+ *dest32 = symval + (*dest32); /* S + A */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", (unsigned int)*dest32);
# endif
- break;
- case R_386_PC32:
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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 );
+ ELFDEBUG("R_386_PC32 %s\t",
+ ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
+ ELFDEBUG("secp=%p\t", secp);
+ ELFDEBUG("symval=%lx\t", (unsigned long)symval);
+ ELFDEBUG("dest32=%p\t", (void *)dest32);
+ ELFDEBUG("*dest32=%8.8x\t", (unsigned int)*dest32);
# endif
- *dest32=symval+(*dest32)-(Elf_Addr)dest32; /* S + A - P */
+ *dest32 = symval + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", (unsigned int)*dest32);
# endif
- break;
+ break;
#endif /* i386 */
-#if defined(__x86_64__)
- case R_X86_64_32:
- dest32=(unsigned int *)(secp+rel->r_offset );
+#if defined(__AMD64__)
+ 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);
+ 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 */
+ *dest32 = symval + rel->r_addend + (*dest32); /* S + A */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8lx\n", *dest32);
# endif
- break;
- case R_X86_64_32S:
- dest32s=(int *)(secp+rel->r_offset);
+ 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);
+ 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 */
+ *dest32s = symval + rel->r_addend + (*dest32s); /* S + A */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32s=%8.8lx\n", *dest32s );
+ ELFDEBUG("*dest32s=%8.8lx\n", *dest32s);
# endif
- break;
- case R_X86_64_PC32:
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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);
+ 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 */
+ *dest32 = symval + rel->r_addend + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8lx\n", *dest32);
# endif
- break;
- case R_X86_64_64:
- dest64=(unsigned long *)(secp+rel->r_offset);
+ 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);
+ ELFDEBUG("R_AMD64_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 */
+ *dest64 = symval + rel->r_addend + (*dest64); /* S + A */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest64=%8.8lx\n", *dest64 );
+ ELFDEBUG("*dest64=%8.8lx\n", *dest64);
# endif
- break;
-#endif /* __x86_64__ */
+ break;
+#endif /* __AMD64__ */
#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 );
+ 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);
+ symval = ((unsigned char *)symval) -
+ ((unsigned char *)elffile->got);
# ifdef ELFDEBUG
- ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG("symval=%lx\t", symval);
# endif
- if( (symval&0xffffffff00000000) != 0x0000000000000000 &&
- (symval&0xffffffff00000000) != 0xffffffff00000000 ) {
+ 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)));
+ ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
}
- *dest32=symval;
+ *dest32 = symval;
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%x\n", *dest32 );
+ ELFDEBUG("*dest32=%x\n", *dest32);
# endif
break;
- }
+ }
- case R_ALPHA_GPRELLOW:
- {
- dest64=(unsigned long *)(secp+rel->r_offset);
- dest16=(unsigned short *)dest64;
+ 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);
+ symval = ((unsigned char *)symval) -
+ ((unsigned char *)elffile->got);
- *dest16=symval;
+ *dest16 = symval;
break;
- }
+ }
- case R_ALPHA_GPRELHIGH:
- {
- dest64=(unsigned long *)(secp+rel->r_offset);
- dest16=(unsigned short *)dest64;
+ 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 = ((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);
+ 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;
+ *dest16 = symval;
break;
- }
+ }
- case R_ALPHA_LITERAL:
- {
+ case R_ALPHA_LITERAL:
+ {
ELFGotEntryPtr gotent;
- dest32=(unsigned int *)(secp+rel->r_offset);
+
+ 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 );
+ 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;
+ 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;
+ 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);
+ 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 {
+ (*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));
+ val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
# ifdef ELFDEBUG
- ELFDEBUG("S+A-P=%x\t",val);
+ ELFDEBUG("S+A-P=%x\t", val);
# endif
- if( (val & 0xffff0000) != 0xffff0000 &&
- (val & 0xffff0000) != 0x00000000 ) {
+ if ((val & 0xffff0000) != 0xffff0000 &&
+ (val & 0xffff0000) != 0x00000000) {
ErrorF("\nR_ALPHA_LITERAL offset %x too large\n", val);
- break;
+ break;
}
val &= 0x0000ffff;
- (*dest32)|=(val); /* The address part is always 0 */
+ (*dest32) |= (val); /* The address part is always 0 */
}
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
break;
- }
-
- case R_ALPHA_GPDISP:
- {
+ }
+
+ case R_ALPHA_GPDISP:
+ {
long offset;
- dest32h=(unsigned int *)(secp+rel->r_offset);
- dest32=(unsigned int *)((secp+rel->r_offset)+rel->r_addend);
+ 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 );
+ 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)) );
+ 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);
+
+ offset = ((unsigned char *)elffile->got -
+ (unsigned char *)dest32h);
# ifdef ELFDEBUG
- ELFDEBUG( "symval=%lx\t", symval );
- ELFDEBUG( "got-dest32=%lx\t", offset );
+ 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");
+ if ((offset >= 0x7fff8000L) || (offset < -0x80000000L)) {
+ FatalError("Offset overflow for R_ALPHA_GPDISP\n");
}
symval += (unsigned long)offset;
# ifdef ELFDEBUG
- ELFDEBUG( "symval=%lx\t", symval );
+ 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
- *dest32=(*dest32&0xffff0000) | (symval&0xffff);
- *dest32h=(*dest32h&0xffff0000)|
- (((symval>>16)+((symval>>15)&1))&0xffff);
+ break;
+ }
+
+ case R_ALPHA_HINT:
+ dest32 = (unsigned int *)((secp + rel->r_offset) + rel->r_addend);
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
- ELFDEBUG( "*dest32h=%8.8x\n", *dest32h );
+ 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
- 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 );
+ 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 );
+ 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;
+ if (symval & 0xffff8000) {
# ifdef ELFDEBUG
- ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG("R_ALPHA_HINT symval too large\n");
# endif
+ }
+
+ *dest32 = (*dest32 & ~0x3fff) | (symval & 0x3fff);
- if( symval & 0xffff8000 ) {
# ifdef ELFDEBUG
- ELFDEBUG("R_ALPHA_HINT symval too large\n" );
+ 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);
}
- *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;
- }
-
+ *dest16 = symval;
+ break;
+ }
+
#endif /* alpha */
#if defined(__mc68000__)
- case R_68K_32:
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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 );
+ 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);
+ {
+ unsigned long val;
+
+ /* S + A */
+ val = symval + (rel->r_addend);
# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t",val);
+ ELFDEBUG("S+A=%x\t", val);
# endif
- *dest32=val; /* S + A */
- }
+ *dest32 = val; /* S + A */
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
- case R_68K_PC32:
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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 );
+ 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;
+ {
+ 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);
+ 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 */
- }
+ *dest32 = val + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
+ break;
#endif /* __mc68000__ */
#if defined(__powerpc__)
# if defined(PowerMAX_OS)
- case R_PPC_DISP24: /* 11 */
- dest32=(unsigned long *)(secp+rel->r_offset);
+ 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 );
+ 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));
+ {
+ unsigned long val;
+
+ /* S + A - P >> 2 */
+ val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
# ifdef ELFDEBUG
- ELFDEBUG("S+A-P=%x\t",val);
+ ELFDEBUG("S+A-P=%x\t", val);
# endif
- val = val>>2;
- if( (val & 0x3f000000) != 0x3f000000 &&
- (val & 0x3f000000) != 0x00000000 ) {
+ val = val >> 2;
+ if ((val & 0x3f000000) != 0x3f000000 &&
+ (val & 0x3f000000) != 0x00000000) {
# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_DISP24 offset %x too large\n", val<<2);
+ 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));
+ 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);
+ 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);
+ 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 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
- case R_PPC_16HU: /* 31 */
- dest16=(unsigned short *)(secp+rel->r_offset);
+ break;
+ case R_PPC_16HU: /* 31 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
# ifdef ELFDEBUG
- dest32=(unsigned long *)(dest16-1);
+ 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 );
+ 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;
+ {
+ unsigned short val;
+
+ /* S + A */
+ val = ((symval + (rel->r_addend)) & 0xffff0000) >> 16;
# ifdef ELFDEBUG
- ELFDEBUG("uhi16(S+A)=%x\t",val);
+ ELFDEBUG("uhi16(S+A)=%x\t", val);
# endif
- *dest16=val; /* S + A */
- ppc_flush_icache(dest16);
- }
+ *dest16 = val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ 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);
+ 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 );
+ 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);
+ {
+ unsigned long val;
+
+ /* S + A */
+ val = symval + (rel->r_addend);
# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t",val);
+ ELFDEBUG("S+A=%x\t", val);
# endif
- *dest32=val; /* S + A */
- ppc_flush_icache(dest32);
- }
+ *dest32 = val; /* S + A */
+ ppc_flush_icache(dest32);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
- case R_PPC_32UA: /* 33 */
- dest32=(unsigned long *)(secp+rel->r_offset);
+ 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 );
+ 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);
+ {
+ unsigned long val;
+ unsigned char *dest8 = (unsigned char *)dest32;
+
+ /* S + A */
+ val = symval + (rel->r_addend);
# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t",val);
+ 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);
- }
+ *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 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
- case R_PPC_16H: /* 34 */
- dest16=(unsigned short *)(secp+rel->r_offset);
+ break;
+ case R_PPC_16H: /* 34 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
# ifdef ELFDEBUG
- dest32=(unsigned long *)(dest16-1);
+ 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 );
+ 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++;
- }
+ {
+ 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);
+ ELFDEBUG("hi16(S+A)=%x\t", val);
# endif
- *dest16=val; /* S + A */
- ppc_flush_icache(dest16);
- }
+ *dest16 = val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ 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);
+ break;
+ case R_PPC_16L: /* 35 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
# ifdef ELFDEBUG
- dest32=(unsigned long *)(dest16-1);
+ 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 );
+ 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;
+ {
+ unsigned short val;
+
+ /* S + A */
+ val = (symval + (rel->r_addend)) & 0xffff;
# ifdef ELFDEBUG
- ELFDEBUG("lo16(S+A)=%x\t",val);
+ ELFDEBUG("lo16(S+A)=%x\t", val);
# endif
- *dest16=val; /* S + A */
- ppc_flush_icache(dest16);
- }
+ *dest16 = val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ ELFDEBUG("*dest16=%8.8x\t", *dest16);
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
+ 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));
+ /* 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 );
+ 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);
+ {
+ unsigned long val;
+
+ /* S + A */
+ val = symval + (rel->r_addend);
# ifdef ELFDEBUG
- ELFDEBUG("S+A=%x\t",val);
+ ELFDEBUG("S+A=%x\t", val);
# endif
- *dest32=val; /* S + A */
- ppc_flush_icache(dest32);
- }
+ *dest32 = val; /* S + A */
+ ppc_flush_icache(dest32);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
- case R_PPC_ADDR16_LO: /* 4 */
- dest16=(unsigned short *)(secp+rel->r_offset);
+ break;
+ case R_PPC_ADDR16_LO: /* 4 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
# ifdef ELFDEBUG
- dest32=(unsigned long *)(dest16-1);
+ 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 );
+ 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;
+ {
+ unsigned short val;
+
+ /* S + A */
+ val = (symval + (rel->r_addend)) & 0xffff;
# ifdef ELFDEBUG
- ELFDEBUG("lo16(S+A)=%x\t",val);
+ ELFDEBUG("lo16(S+A)=%x\t", val);
# endif
- *dest16=val; /* S + A */
- ppc_flush_icache(dest16);
- }
+ *dest16 = val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ 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);
+ break;
+ case R_PPC_ADDR16_HA: /* 6 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
# ifdef ELFDEBUG
- dest32=(unsigned long *)(dest16-1);
+ 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 );
+ 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++;
- }
+ {
+ 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);
+ ELFDEBUG("hi16(S+A)=%x\t", val);
# endif
- *dest16=val; /* S + A */
- ppc_flush_icache(dest16);
- }
+ *dest16 = val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ 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);
+ 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 );
+ 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));
+ {
+ unsigned long val;
+
+ /* S + A - P >> 2 */
+ val = ((symval + (rel->r_addend) - (Elf_Addr) dest32));
# ifdef ELFDEBUG
- ELFDEBUG("S+A-P=%x\t",val);
+ ELFDEBUG("S+A-P=%x\t", val);
# endif
- val = val>>2;
- if( (val & 0x3f000000) != 0x3f000000 &&
- (val & 0x3f000000) != 0x00000000 ) {
+ val = val >> 2;
+ if ((val & 0x3f000000) != 0x3f000000 &&
+ (val & 0x3f000000) != 0x00000000) {
# ifdef ELFDEBUG
- ELFDEBUG("R_PPC_REL24 offset %x too large\n", val<<2);
+ 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));
+ 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);
+ 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);
+ 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 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
- case R_PPC_REL32: /* 26 */
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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 );
+ 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;
+ {
+ 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);
+ 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);
- }
+ *dest32 = val + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
+ ppc_flush_icache(dest32);
+ }
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8x\n", *dest32);
# endif
- break;
-# endif /* PowerMAX_OS */
+ break;
+# endif /* PowerMAX_OS */
#endif /* __powerpc__ */
#ifdef __sparc__
- case R_SPARC_NONE: /* 0 */
- break;
+ 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_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_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_32: /* 3 */
+ 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_GLOB_DAT: /* 20 */
+ case R_SPARC_64: /* 32 */
+ dest64 = (unsigned long *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest64 = symval;
+ 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_DISP8: /* 4 */
+ dest8 = (unsigned char *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest8 = (symval - (Elf_Addr) dest8);
+ 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_DISP16: /* 5 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest16 = (symval - (Elf_Addr) dest16);
+ 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_DISP32: /* 6 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = (symval - (Elf_Addr) dest32);
+ 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_WDISP30: /* 7 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = ((*dest32 & 0xc0000000) |
+ (((symval - (Elf_Addr) dest32) >> 2) & 0x3fffffff));
+ 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_HI22: /* 9 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = (*dest32 & 0xffc00000) | (symval >> 10);
+ 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_LO10: /* 12 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff);
+ 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_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_RELATIVE: /* 22 */
- dest32 = (unsigned int *)(secp + rel->r_offset);
- *dest32 += (unsigned int)secp + rel->r_addend;
- 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 */
+ dest64 = (unsigned long *)(secp + rel->r_offset);
+ *dest64 = (unsigned long)secp + rel->r_addend;
+ break;
#endif /*__sparc__*/
#ifdef __ia64__
- case R_IA64_NONE:
- break;
+ case R_IA64_NONE:
+ break;
- case R_IA64_LTOFF_FPTR22:
- if (rel->r_addend)
- FatalError("\nAddend for R_IA64_LTOFF_FPTR22 not supported\n");
+ 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] );
+ ELFDEBUG("opd=%016lx.%016lx\n",
+ ((long *)symval)[0], ((long *)symval)[1]);
# endif
- /* FALLTHROUGH */
- case R_IA64_LTOFF22:
- {
+ /* FALLTHROUGH */
+ case R_IA64_LTOFF22:
+#ifndef IA64_LDX_OPTIMIZATION
+ case R_IA64_LTOFF22X: /* If not implementing LDXMOV optimization treat LTOFF22X as LTOFF22 */
+#endif
+ {
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;
+ 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;
+ 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);
+ 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
+ IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22,
+ gotent->offset);
+ } else
FatalError("\nCould not find GOT entry\n");
- }
- break;
+ }
+ break;
- case R_IA64_PCREL21B:
- {
+ case R_IA64_PCREL21B:
+ {
ELFPltEntryPtr pltent;
- dest128=(unsigned long *)(secp+(rel->r_offset&~3));
+
+ 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]);
+ 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)) {
+ && (((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);
+ ((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;
+ 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;
+ 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);
+ /* 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;; */
@@ -2147,162 +2248,262 @@ int force;
IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_TGT25C,
(unsigned long)p - (unsigned long)dest128);
}
- }
- break;
+ }
+ 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;
+
+#ifdef IA64_LDX_OPTIMIZATION
+ case R_IA64_LTOFF22X:
+ {
+ ELFGotEntryPtr gotent;
+ long gp_offset = symval + rel->r_addend - (long)elffile->got;
+
+ dest128 = (unsigned long *)(secp + (rel->r_offset & ~3));
- 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] );
+ ELFDEBUG("R_IA64_LTOFF22X %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);
# endif
- if (rel->r_addend)
- FatalError("\nAddend not supported for R_IA64_FPTR64LSB\n");
- *dest64 = symval;
- ia64_flush_cache(dest64);
- break;
+ if (gp_offset << 42 >> 42 != gp_offset) {
+ /* Offset is too large for LTOFF22X,
+ * fallback to using GOT lookup, e.g. LTOFF22.
+ * Note: LDXMOV will fail the same test and will be ignored. */
- 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 );
+ ELFDEBUG("gp_offset=%ld too large, using GOT instead (LTOFF22)\n", gp_offset);
# 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;
+ 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;
+ }
- case R_IA64_GPREL22:
- dest128=(unsigned long *)(secp+(rel->r_offset&~3));
+ /* 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);
+ } else {
+ FatalError("\nCould not find GOT entry\n");
+ }
+ gp_offset = gotent->offset; /* Use GOT lookup */
+ } else {
# 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]);
+ ELFDEBUG("using gp_offset=%ld (LTOFF22X)", gp_offset);
# endif
+ }
IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22,
- symval + rel->r_addend - (long)elffile->got);
- break;
+ gp_offset);
+ }
+ break;
+#endif
+
+ case R_IA64_LDXMOV:
+# ifdef ELFDEBUG
+ ELFDEBUG("R_IA64_LDXMOV %s\t",
+ ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
+# endif
+
+#ifdef IA64_LDX_OPTIMIZATION
+ {
+ long gp_offset = symval + rel->r_addend - (long)elffile->got;
+
+ dest128 = (unsigned long *)(secp + (rel->r_offset & ~3));
+
+ if (gp_offset << 42 >> 42 != gp_offset) {
+ /* Offset is too large for LTOFF22X, ignore this relocation */
+# ifdef ELFDEBUG
+ ELFDEBUG("offset = %ld too large, ignoring\n", gp_offset);
+# endif
+ } else {
+
+# ifdef ELFDEBUG
+ ELFDEBUG("secp=%lx\t", secp);
+ ELFDEBUG("symval=%lx\t", symval);
+ ELFDEBUG("dest128=%lx\t", dest128);
+ ELFDEBUG("slot=%d\n", rel->r_offset & 3);
+ ELFDEBUG("offset=%ld\n", gp_offset);
+ ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
+# endif
+
+ IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_LDXMOV,
+ 0);
+ }
+ }
+#endif
+ break;
#endif /*__ia64__*/
#if defined(__arm__)
- case R_ARM_ABS32:
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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 );
+ ELFDEBUG("R_ARM_ABS32\t");
+ ELFDEBUG("dest32=%x\t", dest32);
+ ELFDEBUG("*dest32=%8.8lx\t", *dest32);
# endif
- *dest32=symval+(*dest32); /* S + A */
+ *dest32 = symval + (*dest32); /* S + A */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8lx\n", *dest32);
# endif
- break;
+ break;
- case R_ARM_REL32:
- dest32=(unsigned int *)(secp+rel->r_offset);
+ 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)) );
+
+ 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 );
- }
+ 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 */
+ *dest32 = symval + (*dest32) - (Elf_Addr) dest32; /* S + A - P */
# ifdef ELFDEBUG
- ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+ ELFDEBUG("*dest32=%8.8lx\n", *dest32);
# endif
- break;
+ break;
- case R_ARM_PC24:
- {
+ case R_ARM_PC24:
+ {
unsigned long val;
- dest32=(unsigned int *)(secp+rel->r_offset);
+
+ dest32 = (unsigned int *)(secp + rel->r_offset);
val = (*dest32 & 0x00ffffff) << 2;
- val = symval - (unsigned long)dest32 + val;
- val >>= 2;
- *dest32 = (*dest32 & 0xff000000) | (val & 0x00ffffff);
+ val = symval - (unsigned long)dest32 + val;
+ val >>= 2;
+ *dest32 = (*dest32 & 0xff000000) | (val & 0x00ffffff);
#ifdef NOTYET
arm_flush_cache(dest32);
#endif
- }
- break;
+ }
+ break;
#endif /* (__arm__) */
- default:
- ErrorF("Elf_RelocateEntry() Unsupported relocation type %d\n",
- ELF_R_TYPE(rel->r_info));
- break;
- }
+ default:
+ ErrorF("Elf_RelocateEntry() Unsupported relocation type %d\n",
+ (int)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 */
+ 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;
+ int i, numrel;
+ Elf_Shdr *sect = &(elffile->sections[index]);
+ Elf_Rel_t *rel = (Elf_Rel_t *) elffile->saddr[index];
ELFRelocPtr reloc_head = NULL;
ELFRelocPtr tmp;
- syms = (Elf_Sym *) elffile->saddr[elffile->symndx];
+ numrel = sect->sh_size / sect->sh_entsize;
- numrel=sect->sh_size/sect->sh_entsize;
-
- for(i=0; i<numrel; i++ ) {
+ for (i = 0; i < numrel; i++) {
#if defined(__alpha__)
- if( ELF_R_TYPE(rel[i].r_info) == R_ALPHA_LITERAL) {
- ElfAddGOT(elffile,&rel[i]);
- }
+ 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_LTOFF22X
|| ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF_FPTR22) {
- ElfAddGOT(elffile,&rel[i]);
+ ElfAddGOT(elffile, &rel[i]);
}
if (ELF_R_TYPE(rel[i].r_info) == R_IA64_PCREL21B) {
- ElfAddPLT(elffile,&rel[i]);
+ 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) {
+ Elf_Sym *syms = (Elf_Sym *) elffile->saddr[elffile->symndx];
+
+ 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);
}
}
@@ -2322,110 +2523,109 @@ int index; /* The section to use as relocation data */
*/
static LOOKUP *
-ELF_GetSymbols(elffile, psecttable)
-ELFModulePtr elffile;
-unsigned short **psecttable;
+ELF_GetSymbols(ELFModulePtr elffile, unsigned short **psecttable)
{
- Elf_Sym *syms;
- Elf_Shdr *sect;
- int i, l, numsyms;
- LOOKUP *lookup, *p;
+ 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;
+ syms = elffile->symtab;
+ sect = &(elffile->sections[elffile->symndx]);
+ numsyms = sect->sh_size / sect->sh_entsize;
- if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL)
+ if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL)
return 0;
- if ((secttable = xf86loadercalloc(sizeof(unsigned short),(numsyms+1))) == NULL) {
+ if ((secttable =
+ xf86loadercalloc(sizeof(unsigned short), (numsyms + 1))) == NULL) {
xf86loaderfree(lookup);
return 0;
}
*psecttable = secttable;
- for(i=0,l=0; i<numsyms; i++)
- {
+ 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) );
+ ELFDEBUG("value=%lx\tsize=%lx\tBIND=%x\tTYPE=%x\tndx=%x\t%s\n",
+ (unsigned long)syms[i].st_value,
+ (unsigned long)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;
+ 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:
+ 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;
+ 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 );
+ ELFDEBUG("Adding symbol %lx(%d) %s\n",
+ (unsigned long)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]);
- }
+ 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 */
+ 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));
+ 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;
- }
+ 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 */
+ lookup[l].symName = NULL; /* Terminate the list */
/*
* Remove the ELF symbols that will show up in every object module.
@@ -2436,8 +2636,10 @@ unsigned short **psecttable;
|| !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));
+ ) {
+ memmove(&(lookup[i]), &(lookup[i + 1]), (l - i) * sizeof(LOOKUP));
+ memmove(&(secttable[i]), &(secttable[i + 1]),
+ (l-- - i) * sizeof(unsigned short));
}
}
return lookup;
@@ -2466,105 +2668,106 @@ unsigned short **psecttable;
* 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;
+ELFCollectSections(ELFModulePtr elffile, int pass, int *totalsize,
+ int *maxalign)
{
- int i;
+ int i;
int j;
+
/*
* Find and identify all of the Sections
*/
j = elffile->lsectidx;
- for( i=1; i<elffile->numsh; i++) {
+ 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 (!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")
+ || !strcmp(name, ".plt") || !strcmp(name, ".IA_64.unwind_info")
# endif
- ) continue;
+ )
+ continue;
#endif
switch (SecType(i)) {
case SHT_STRTAB:
- if (!strcmp(name,".shstrtab")) /* already loaded */
+ if (!strcmp(name, ".shstrtab")) /* already loaded */
continue;
- if (!strcmp(name,".stabstr")) /* ignore debug info */
+ if (!strcmp(name, ".stabstr")) /* ignore debug info */
continue;
case SHT_SYMTAB:
- if (pass) continue;
+ 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;
+ if (pass)
+ continue;
+ if (!(SecFlags(SecInfo(i)) & SHF_ALLOC))
+ continue;
#ifdef __ia64__
if (SecType(SecInfo(i)) == SHT_IA_64_UNWIND)
- continue;
+ continue;
#endif
- flags = LOADED_SECTION;
- flags |= RELOC_SECTION;
- break;
+ flags = LOADED_SECTION;
+ flags |= RELOC_SECTION;
+ break;
case SHT_PROGBITS:
flags |= LOADED_SECTION;
case SHT_NOBITS:
- if (! (elffile->sections[i].sh_flags & SHF_ALLOC))
+ if (!(elffile->sections[i].sh_flags & SHF_ALLOC))
continue;
AdjustSize(i);
break;
default:
#ifdef ELFDEBUG
if (pass)
- ELFDEBUG("ELF: Not loading %s\n",name);
+ ELFDEBUG("ELF: Not loading %s\n", name);
#endif
continue;
}
-
+
elffile->lsection = xf86loaderrealloc(elffile->lsection,
- (j + 1) * sizeof (LoadSection));
+ (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);
+ 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
+ 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);
+ (Elf_Sym *) _LoaderFileToMem(elffile->fd, SecOffset(i),
+ SecSize(i), name);
}
- elffile->saddr[i]=elffile->lsection[j].saddr;
+ 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;
+ ELFDEBUG("%s starts at %p size: %lx\n",
+ name, elffile->saddr[i], (unsigned long)SecSize(i));
+#endif
+ elffile->lsection[j].name = name;
elffile->lsection[j].ndx = i;
- elffile->lsection[j].size=SecSize(i);
- elffile->lsection[j].flags=flags;
+ 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);
+ 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->symtab = (Elf_Sym *) elffile->saddr[i];
elffile->symndx = i;
break;
case SHT_STRTAB:
@@ -2583,20 +2786,17 @@ int *maxalign;
* Public API for the ELF implementation of the loader.
*/
void *
-ELFLoadModule(modrec, elffd, ppLookup)
-loaderPtr modrec;
-int elffd;
-LOOKUP **ppLookup;
+ELFLoadModule(loaderPtr modrec, int elffd, LOOKUP **ppLookup)
{
ELFModulePtr elffile;
- Elf_Ehdr *header;
- ELFRelocPtr elf_reloc, tail;
- void *v;
+ Elf_Ehdr *header;
+ ELFRelocPtr elf_reloc, tail;
+ void *v;
LDRModulePtr elfmod;
- int totalsize, maxalign, i;
+ int totalsize, maxalign, i;
unsigned short *secttable;
- LOOKUP *pLookup;
-
+ LOOKUP *pLookup;
+
ldrCommons = 0;
nCommons = 0;
@@ -2604,72 +2804,77 @@ LOOKUP **ppLookup;
ELFDEBUG("Loading %s %s\n", modrec->name, modrec->cname);
#endif
if ((elffile = xf86loadercalloc(1, sizeof(ELFModuleRec))) == NULL) {
- ErrorF( "Unable to allocate ELFModuleRec\n" );
+ ErrorF("Unable to allocate ELFModuleRec\n");
return NULL;
}
- elffile->handle=modrec->handle;
- elffile->module=modrec->module;
- elffile->fd=elffd;
- v=elffile->funcs=modrec->funcs;
+ 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;
+ 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");
+ 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;
+ elffile->gotndx = header->e_shnum;
header->e_shnum++;
# if defined(__ia64__)
- elffile->pltndx=header->e_shnum;
+ 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 *));
+ 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;
+ 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;
+ 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;
+ 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;
+ SecSize(header->e_shstrndx) += 32;
#endif
/*
@@ -2677,22 +2882,22 @@ LOOKUP **ppLookup;
*/
elffile->shstrsize = SecSize(header->e_shstrndx);
elffile->shstraddr =
- _LoaderFileToMem(elffd, SecOffset(header->e_shstrndx),
- SecSize(header->e_shstrndx), ".shstrtab");
+ _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");
+ 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");
+ strcpy((char *)(elffile->shstraddr +
+ elffile->sections[elffile->pltndx].sh_name), ".plt");
#endif
/*
@@ -2701,12 +2906,12 @@ LOOKUP **ppLookup;
totalsize = 0;
maxalign = 0;
ELFCollectSections(elffile, 0, &totalsize, &maxalign);
- if( elffile->straddr == NULL || elffile->strsize == 0 ) {
+ if (elffile->straddr == NULL || elffile->strsize == 0) {
#if 0
ErrorF("No symbols found in this module\n");
#endif
ELFUnloadModule(elffile);
- return (void *) -1L;
+ return (void *)-1L;
}
/*
* add symbols
@@ -2724,10 +2929,9 @@ LOOKUP **ppLookup;
default:
continue;
}
- elf_reloc = ELFCollectRelocations(elffile,elffile->lsection[i].ndx);
+ elf_reloc = ELFCollectRelocations(elffile, elffile->lsection[i].ndx);
if (elf_reloc) {
- for (tail = elf_reloc; tail->next; tail = tail->next)
- ;
+ for (tail = elf_reloc; tail->next; tail = tail->next) ;
tail->next = _LoaderGetRelocations(v)->elf_reloc;
_LoaderGetRelocations(v)->elf_reloc = elf_reloc;
}
@@ -2747,11 +2951,11 @@ LOOKUP **ppLookup;
#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" );
+ ErrorF("Unable to allocate ELF sections\n");
return NULL;
}
# if defined(linux) && defined(__ia64__) || defined(__OpenBSD__)
@@ -2759,25 +2963,28 @@ LOOKUP **ppLookup;
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);
+ 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
+# else
MMAP_ALIGN(elffile->basesize);
- elffile->base = mmap( 0,elffile->basesize,MMAP_PROT,MMAP_FLAGS,-1,
- (off_t)0);
+ 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" );
+ ErrorF("Unable to mmap ELF sections\n");
return NULL;
}
# endif
- elffile->baseptr = ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1);
+ elffile->baseptr =
+ ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1);
#endif
#if defined(__alpha__) || defined(__ia64__)
- if (! ELFCreateGOT(elffile, maxalign))
+ if (!ELFCreateGOT(elffile, maxalign))
return NULL;
#endif
#if defined(__ia64__)
@@ -2788,10 +2995,12 @@ LOOKUP **ppLookup;
for (i = 0; pLookup[i].symName; i++)
if (secttable[i]) {
- pLookup[i].offset = (funcptr)((long)pLookup[i].offset + (long)elffile->saddr[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);
+ ELFDEBUG("Finalizing symbol %p %s\n",
+ (void *)pLookup[i].offset, pLookup[i].symName);
#endif
}
xf86loaderfree(secttable);
@@ -2800,24 +3009,25 @@ LOOKUP **ppLookup;
ELFCreateOPD(elffile);
#endif
- if (! ElfCreateCOMMON(elffile, *ppLookup))
+ 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 */
+ * 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++) {
+ for (i = 0; i < elffile->lsectidx; i++) {
char *name = elffile->lsection[i].name;
- if (!strcmp(name,".text"))
+
+ if (!strcmp(name, ".text"))
elfmod->text = elffile->lsection[i].saddr;
- else if (!strcmp(name,".data"))
+ else if (!strcmp(name, ".data"))
elfmod->data = elffile->lsection[i].saddr;
- else if (!strcmp(name,".rodata"))
+ else if (!strcmp(name, ".rodata"))
elfmod->rodata = elffile->lsection[i].saddr;
- else if (!strcmp(name,".bss"))
+ else if (!strcmp(name, ".bss"))
elfmod->bss = elffile->lsection[i].saddr;
}
elfmod->next = ModList;
@@ -2833,8 +3043,7 @@ LOOKUP **ppLookup;
}
void
-ELFResolveSymbols(mod)
-void *mod;
+ELFResolveSymbols(void *mod)
{
ELFRelocPtr newlist, p, tmp;
@@ -2842,10 +3051,12 @@ void *mod;
* which we failed to relocate. Destroy the old list in the process.
*/
newlist = 0;
- for (p = _LoaderGetRelocations(mod)->elf_reloc; p; ) {
+ 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);
+ ELFDEBUG("ResolveSymbols: "
+ "file %p, sec %d, r_offset 0x%x, r_info 0x%p\n",
+ (void *)p->file, p->secn, p->rel->r_offset,
+ (void *)p->rel->r_info);
#endif
tmp = Elf_RelocateEntry(p->file, p->secn, p->rel, FALSE);
if (tmp) {
@@ -2857,57 +3068,56 @@ void *mod;
p = p->next;
xf86loaderfree(tmp);
}
- _LoaderGetRelocations(mod)->elf_reloc=newlist;
+ _LoaderGetRelocations(mod)->elf_reloc = newlist;
}
int
-ELFCheckForUnresolved(mod)
-void *mod;
+ELFCheckForUnresolved(void *mod)
{
- ELFRelocPtr erel;
- char *name;
- int flag, fatalsym=0;
+ ELFRelocPtr erel;
+ char *name;
+ int flag, fatalsym = 0;
if ((erel = _LoaderGetRelocations(mod)->elf_reloc) == NULL)
return 0;
- while( erel ) {
+ 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;
+ flag = _LoaderHandleUnresolved(name,
+ _LoaderHandleToName(erel->file->
+ handle));
+ if (flag)
+ fatalsym = 1;
+ erel = erel->next;
}
return fatalsym;
}
void
-ELFUnloadModule(modptr)
-void *modptr;
+ELFUnloadModule(void *modptr)
{
- ELFModulePtr elffile = (ELFModulePtr)modptr;
- ELFRelocPtr relptr, reltptr, *brelptr;
+ 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);
+ 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 */
+ 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 */
}
- else {
- brelptr=&(relptr->next);
- relptr=relptr->next; /* advance the pointer */
- }
}
/*
@@ -2921,18 +3131,19 @@ void *modptr;
*/
#if !defined (DoMMAPedMerge)
# define CheckandFree(ptr,size) if(ptr) xf86loaderfree(ptr)
-#else
+#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);
+ 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)
@@ -2941,19 +3152,20 @@ void *modptr;
}
}
# endif
-#else /*MergeSectionAlloc*/
- CheckandFree(elffile->common,elffile->comsize);
+#else /*MergeSectionAlloc */
+ CheckandFree(elffile->common, elffile->comsize);
# if defined(__alpha__) || defined(__ia64__)
- CheckandFree(elffile->got,elffile->gotsize);
+ CheckandFree(elffile->got, elffile->gotsize);
# endif
# if defined(__ia64__)
- CheckandFree(elffile->plt,elffile->pltsize);
+ CheckandFree(elffile->plt, elffile->pltsize);
# endif
#endif
#if defined(__alpha__) || defined(__ia64__)
{
ELFGotEntryPtr gotent;
- while((gotent = elffile->got_entries)) {
+
+ while ((gotent = elffile->got_entries)) {
elffile->got_entries = gotent->next;
xf86loaderfree(gotent);
}
@@ -2962,6 +3174,7 @@ void *modptr;
#if defined(__ia64__)
{
ELFPltEntryPtr pltent;
+
while ((pltent = elffile->plt_entries)) {
elffile->plt_entries = pltent->next;
xf86loaderfree(pltent);
@@ -2969,6 +3182,7 @@ void *modptr;
}
{
ELFOpdPtr opdent;
+
while ((opdent = elffile->opd_entries)) {
elffile->opd_entries = opdent->next;
xf86loaderfree(opdent);
@@ -2994,12 +3208,11 @@ void *modptr;
/*
* Free the section table, section pointer array, and section names
*/
- _LoaderFreeFileMem(elffile->sections,elffile->secsize);
+ _LoaderFreeFileMem(elffile->sections, elffile->secsize);
xf86loaderfree(elffile->saddr);
- _LoaderFreeFileMem(elffile->header,sizeof(Elf_Ehdr));
- _LoaderFreeFileMem(elffile->shstraddr,elffile->shstrsize);
-
-
+ _LoaderFreeFileMem(elffile->header, sizeof(Elf_Ehdr));
+ _LoaderFreeFileMem(elffile->shstraddr, elffile->shstrsize);
+
/*
* Free the ELFModuleRec
*/
@@ -3011,14 +3224,14 @@ void *modptr;
char *
ELFAddressToSection(void *modptr, unsigned long address)
{
- ELFModulePtr elffile = (ELFModulePtr)modptr;
+ 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);
- }
+ 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
index cbd5f118a..e4693411b 100644
--- a/hw/xfree86/loader/elfloader.h
+++ b/hw/xfree86/loader/elfloader.h
@@ -21,7 +21,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.h,v 1.3 1998/09/20 14:41:05 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.h,v 1.4 2003/10/15 16:29:03 dawes Exp $ */
#ifndef _ELFLOADER_H
#define _ELFLOADER_H
@@ -29,6 +29,6 @@
extern void *ELFLoadModule(loaderPtr, int, LOOKUP **);
extern void ELFResolveSymbols(void *);
extern int ELFCheckForUnresolved(void *);
-extern char *ELFAddressToSection(void *,unsigned long);
+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
index 62a5ea98a..8da5089bc 100644
--- a/hw/xfree86/loader/extsym.c
+++ b/hw/xfree86/loader/extsym.c
@@ -1,8 +1,8 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.6 2001/11/17 16:05:59 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.9 2003/10/15 16:29:03 dawes Exp $ */
/*
*
- * Copyright 1999 by The XFree86 Project, Inc.
+ * Copyright 1999-2003 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
@@ -42,38 +42,39 @@ extern RESTYPE ShmSegType, ShmPixType;
extern Bool noPanoramiXExtension;
extern int PanoramiXNumScreens;
extern PanoramiXData *panoramiXdataPtr;
+extern XID *PanoramiXVisualTable;
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 Bool XineramaRegisterConnectionBlockCallback(void (*func) (void));
extern int XineramaDeleteResource(pointer, XID);
#endif
LOOKUP extLookupTab[] = {
- SYMFUNC(ClientSleepUntil)
+ SYMFUNC(ClientSleepUntil)
#ifdef HAS_SHM
- SYMVAR(ShmCompletionCode)
- SYMVAR(BadShmSegCode)
- SYMVAR(ShmSegType)
+ 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)
+ SYMFUNC(XineramaRegisterConnectionBlockCallback)
+ SYMFUNC(XineramaDeleteResource)
+ SYMVAR(noPanoramiXExtension)
+ SYMVAR(PanoramiXNumScreens)
+ SYMVAR(panoramiXdataPtr)
+ SYMVAR(PanoramiXVisualTable)
+ SYMVAR(XRT_WINDOW)
+ SYMVAR(XRT_PIXMAP)
+ SYMVAR(XRT_GC)
+ SYMVAR(XRT_COLORMAP)
+ SYMVAR(XRC_DRAWABLE)
#endif
- { 0, 0 },
-
+ {0, 0}
};
diff --git a/hw/xfree86/loader/fontsym.c b/hw/xfree86/loader/fontsym.c
index 50def63ea..d91a2e216 100644
--- a/hw/xfree86/loader/fontsym.c
+++ b/hw/xfree86/loader/fontsym.c
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/fontsym.c,v 1.11 2002/12/09 17:30:12 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/fontsym.c,v 1.13 2003/10/15 16:29:04 dawes Exp $ */
+/*
+ * Copyright (c) 1998-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "font.h"
#include "sym.h"
@@ -16,64 +42,63 @@
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)
+ 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)
+ /* 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 },
+ /* 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
index 22996f217..f8ddd45a4 100644
--- a/hw/xfree86/loader/hash.c
+++ b/hw/xfree86/loader/hash.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.19 2001/07/25 15:05:07 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.24 2003/11/17 22:20:40 dawes Exp $ */
/*
*
@@ -42,58 +42,54 @@
/* Prototypes for static functions. */
static unsigned int hashFunc(const char *);
static itemPtr LoaderHashFindNearest(
-#if NeedFunctionPrototypes
-unsigned long
-#endif
-);
+ unsigned long
+ );
-static itemPtr LoaderhashTable[ HASHSIZE ] ;
+static itemPtr LoaderhashTable[HASHSIZE];
#ifdef DEBUG
-static int hashhits[ HASHSIZE ] ;
+static int hashhits[HASHSIZE];
void
DumpHashHits(void)
{
- int i;
- int depth=0;
- int dev=0;
+ int i;
+ int depth = 0;
+ int dev = 0;
- for(i=0;i<HASHSIZE;i++) {
- ErrorF("hashhits[%d]=%d\n", i, hashhits[i] );
+ 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 );
+ ErrorF("Average hash depth=%d\n", depth);
- for(i=0;i<HASHSIZE;i++) {
- if( hashhits[i] < depth )
- dev += depth-hashhits[i];
+ for (i = 0; i < HASHSIZE; i++) {
+ if (hashhits[i] < depth)
+ dev += depth - hashhits[i];
else
- dev += hashhits[i]-depth;
+ dev += hashhits[i] - depth;
}
- dev /=HASHSIZE;
- ErrorF("Average hash deviation=%d\n", dev );
+ dev /= HASHSIZE;
+ ErrorF("Average hash deviation=%d\n", dev);
}
#endif
-
static unsigned int
-hashFunc(string)
-const char *string;
+hashFunc(const char *string)
{
- int i=0;
+ int i = 0;
- while ( i < 10 && string[i] )
- i ++ ;
+ while (i < 10 && string[i])
+ i++;
- if ( i < 5 ) {
+ if (i < 5) {
#ifdef DEBUG
hashhits[i]++;
#endif
- return i ;
+ return i;
}
/*
@@ -111,29 +107,25 @@ const char *string;
}
void
-LoaderHashAdd( entry )
- itemPtr entry ;
+LoaderHashAdd(itemPtr entry)
{
- int bucket = hashFunc( entry->name ) ;
- itemPtr oentry;
+ int bucket = hashFunc(entry->name);
+ itemPtr oentry;
- if ((oentry = LoaderHashFind(entry->name)) != NULL)
+ if ((oentry = LoaderHashFind(entry->name)) != NULL)
LoaderDuplicateSymbol(entry->name, oentry->handle);
- entry->next = LoaderhashTable[ bucket ] ;
- LoaderhashTable[ bucket ] = entry ;
- return;
+ entry->next = LoaderhashTable[bucket];
+ LoaderhashTable[bucket] = entry;
+ return;
}
void
-LoaderAddSymbols(handle, module, list)
-int handle;
-int module;
-LOOKUP *list ;
+LoaderAddSymbols(int handle, int module, LOOKUP *list)
{
- LOOKUP *l = list, *exports = NULL;
- itemPtr i, exportsItem = NULL;
- char *modname;
+ LOOKUP *l = list, *exports = NULL;
+ itemPtr i, exportsItem = NULL;
+ char *modname;
if (!list)
return;
@@ -148,7 +140,7 @@ LOOKUP *list ;
char *exportname;
exportname = xf86loadermalloc(strlen("ExportedSymbols") +
- strlen(modname) + 1);
+ strlen(modname) + 1);
if (exportname) {
sprintf(exportname, "%sExportedSymbols", modname);
while (l->symName) {
@@ -160,6 +152,7 @@ LOOKUP *list ;
}
l++;
}
+ xf86loaderfree(exportname);
}
}
@@ -167,13 +160,13 @@ LOOKUP *list ;
* 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 = xf86loadermalloc(sizeof(itemRec));
+ exportsItem->name = exports->symName;
+ exportsItem->address = (char *)exports->offset;
+ exportsItem->handle = handle;
+ exportsItem->module = module;
exportsItem->exports = NULL;
- LoaderHashAdd( exportsItem );
+ LoaderHashAdd(exportsItem);
}
/*
@@ -181,107 +174,106 @@ LOOKUP *list ;
* reference to the export list, if present.
*/
l = list;
- while ( l->symName ) {
+ 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 = xf86loadermalloc(sizeof(itemRec));
+ i->name = l->symName;
+ i->address = (char *)l->offset;
+ i->handle = handle;
+ i->module = module;
i->exports = exportsItem;
- LoaderHashAdd( i );
+ LoaderHashAdd(i);
}
- l ++ ;
+ l++;
}
}
itemPtr
-LoaderHashDelete(string)
-const char *string;
+LoaderHashDelete(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 ;
+ 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;
}
- entry2 = &(entry->next) ;
- entry = entry->next ;
- }
- return 0 ;
+ return 0;
}
itemPtr
-LoaderHashFind(string)
-const char *string;
+LoaderHashFind(const char *string)
{
- int bucket = hashFunc( string ) ;
- itemPtr entry ;
- entry = LoaderhashTable[ bucket ] ;
- while ( entry ) {
- if (!strcmp(entry->name, string)) {
- return entry;
- }
- entry = entry->next;
+ 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;
+LoaderHashFindNearest(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 ;
+ 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;
}
- }
- entry = entry->next ;
}
- }
- return best_entry ;
+ return best_entry;
}
void
-LoaderPrintSymbol(address)
-unsigned long address;
+LoaderPrintSymbol(unsigned long address)
{
- itemPtr entry;
- entry=LoaderHashFindNearest(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);
+ ErrorF("0x%016lx %s+%lx\n", (unsigned long)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);
+ ErrorF("0x%lx %s+%lx\n", (unsigned long)entry->address, entry->name,
+ address - (unsigned long)entry->address);
#endif
- if ( _LoaderAddressToSection(address, &module, &section) )
- ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n",module, section );
+ if (_LoaderAddressToSection(address, &module, &section))
+ ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n", module, section);
} else {
ErrorF("(null)\n");
}
@@ -292,73 +284,70 @@ LoaderPrintItem(itemPtr pItem)
{
if (pItem) {
const char *module, *section;
+
#if defined(__alpha__) || defined(__ia64__)
- ErrorF("0x%016lx %s\n", pItem->address, pItem->name);
+ ErrorF("0x%016lx %s\n", (unsigned long)pItem->address, pItem->name);
#else
- ErrorF("0x%lx %s\n", pItem->address, pItem->name);
+ ErrorF("0x%lx %s\n", (unsigned long)pItem->address, pItem->name);
#endif
- if ( _LoaderAddressToSection((unsigned long)pItem->address,
- &module, &section) )
- ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n",module, section );
+ 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;
+LoaderPrintAddress(const char *symbol)
{
- itemPtr entry;
+ itemPtr entry;
+
entry = LoaderHashFind(symbol);
LoaderPrintItem(entry);
}
void
-LoaderHashTraverse(card, fnp)
- void *card;
- int (*fnp)(void *, itemPtr);
+LoaderHashTraverse(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 ] ;
+ 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;
+ }
}
- }
- 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;
- }
+ 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/loader.c b/hw/xfree86/loader/loader.c
index e09fa50b0..39ba510a1 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -1,7 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.63 2002/11/25 14:05:03 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.71 2003/11/06 18:38:13 tsi Exp $ */
/*
- *
* Copyright 1995-1998 by Metro Link, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -22,6 +21,33 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,7 +61,7 @@
#include <string.h>
#if defined(linux) && \
(defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
- || defined(__x86_64__))
+ || defined(__AMD64__))
#include <malloc.h>
#endif
#include <stdarg.h>
@@ -73,7 +99,7 @@ int check_unresolved_sema = 0;
#endif
#ifdef __UNIXOS2__
-void * os2ldcalloc(size_t,size_t);
+void *os2ldcalloc(size_t, size_t);
#endif
#ifdef HANDLE_IN_HASH_ENTRY
@@ -84,11 +110,11 @@ void * os2ldcalloc(size_t,size_t);
#define MAX_HANDLE 256
#define HANDLE_FREE 0
#define HANDLE_USED 1
-static char freeHandles[MAX_HANDLE] ;
-static int refCount[MAX_HANDLE] ;
+static char freeHandles[MAX_HANDLE];
+static int refCount[MAX_HANDLE];
#endif
-#if defined(__sparc__) && defined(__GNUC__)
+#if defined(__sparc__) && defined(__GNUC__) && !defined(__FreeBSD__)
# define SYMFUNCDOT(func) { "." #func, (funcptr)&__sparc_dot_ ## func },
# if !defined(__OpenBSD__)
# define SYMFUNCDOT89(func) { "." #func, (funcptr)&func ## _sparcv89 },
@@ -108,24 +134,25 @@ DEFFUNCDOT(div)
DEFFUNCDOT(udiv)
#ifdef linux
static LOOKUP SparcV89LookupTab[] = {
- SYMFUNCDOT89(rem)
- SYMFUNCDOT89(urem)
- SYMFUNCDOT89(mul)
- SYMFUNCDOT89(umul)
- SYMFUNCDOT89(div)
- SYMFUNCDOT89(udiv)
- { 0, 0 }
+ 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 }
+ 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
@@ -138,29 +165,32 @@ 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));
+ __asm("": "=r"(hwcap):"0"(hwcap));
if (hwcap) {
- if (*hwcap & HWCAP_SPARC_MULDIV)
- return 1;
- else
- return 0;
+ if (*hwcap & HWCAP_SPARC_MULDIV)
+ return 1;
+ else
+ return 0;
}
#endif
- f = fopen("/proc/cpuinfo","r");
- if (!f) return 0;
+ 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;
- }
- }
+ 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;
@@ -191,8 +221,8 @@ LDRCommonPtr ldrCommons;
int nCommons;
typedef struct {
- int num;
- const char ** list;
+ int num;
+ const char **list;
} symlist;
/*
@@ -210,119 +240,127 @@ static int fatalReqSym = 0;
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) {}
+ /*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 */
+ /* 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}},
+ {DLLoadModule,
+ DLResolveSymbols,
+ DLCheckForUnresolved,
+ ARCHIVEAddressToSection,
+ DLUnloadModule, {0, 0, 0, 0, 0}},
#else
- {AOUTLoadModule,
- AOUTResolveSymbols,
- AOUTCheckForUnresolved,
- AOUTAddressToSection,
- AOUTUnloadModule, {0,0,0,0,0}},
+ {AOUTLoadModule,
+ AOUTResolveSymbols,
+ AOUTCheckForUnresolved,
+ AOUTAddressToSection,
+ AOUTUnloadModule, {0, 0, 0, 0, 0}},
#endif
- /* LD_ELFDLOBJECT */
+ /* LD_ELFDLOBJECT */
#ifdef DLOPEN_SUPPORT
- {DLLoadModule,
- DLResolveSymbols,
- DLCheckForUnresolved,
- ARCHIVEAddressToSection,
- DLUnloadModule, {0,0,0,0,0}},
+ {DLLoadModule,
+ DLResolveSymbols,
+ DLCheckForUnresolved,
+ ARCHIVEAddressToSection,
+ DLUnloadModule, {0, 0, 0, 0, 0}},
#else
- {ELFLoadModule,
- ELFResolveSymbols,
- ELFCheckForUnresolved,
- ELFAddressToSection,
- ELFUnloadModule, {0,0,0,0,0}},
+ {ELFLoadModule,
+ ELFResolveSymbols,
+ ELFCheckForUnresolved,
+ ELFAddressToSection,
+ ELFUnloadModule, {0, 0, 0, 0, 0}},
#endif
- };
-
-int numloaders=sizeof(funcs)/sizeof(loader_funcs);
+};
+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__
+ LoaderAddSymbols(-1, -1, miLookupTab);
+ LoaderAddSymbols(-1, -1, xfree86LookupTab);
+ LoaderAddSymbols(-1, -1, dixLookupTab);
+ LoaderAddSymbols(-1, -1, fontLookupTab);
+ LoaderAddSymbols(-1, -1, extLookupTab);
+#if defined(__sparc__) && !defined(__FreeBSD__)
#ifdef linux
if (sparcUseHWMulDiv())
- LoaderAddSymbols(-1, -1, SparcV89LookupTab ) ;
+ LoaderAddSymbols(-1, -1, SparcV89LookupTab);
else
#endif
- LoaderAddSymbols(-1, -1, SparcLookupTab ) ;
-#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));
+ 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));
+ 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));
+ 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));
+ 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));
+ GET_ABI_MAJOR(LoaderVersionInfo.fontVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.fontVersion));
LoaderGetOS(&osname, NULL, NULL, NULL);
if (osname)
@@ -330,13 +368,13 @@ LoaderInit(void)
#if defined(linux) && \
(defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
- || ( defined __x86_64__ && ! defined UseMMAP && ! defined DoMMAPedMerge))
+ || ( defined __AMD64__ && ! 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);
+ mallopt(M_MMAP_MAX, 0);
#endif
}
@@ -350,84 +388,83 @@ LoaderInit(void)
static int
_GetModuleType(int fd, long offset)
{
- unsigned char buf[256]; /* long enough for the largest magic type */
+ unsigned char buf[256]; /* long enough for the largest magic type */
- if( read(fd,buf,sizeof(buf)) < 0 ) {
+ 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] );
+ 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);
+ lseek(fd, offset, SEEK_SET);
- if (strncmp((char *) buf, ARMAG, SARMAG) == 0) {
+ if (strncmp((char *)buf, ARMAG, SARMAG) == 0) {
return LD_ARCHIVE;
}
-
#if defined(AIAMAG)
/* LynxOS PPC style archives */
- if (strncmp((char *) buf, AIAMAG, SAIAMAG) == 0) {
+ if (strncmp((char *)buf, AIAMAG, SAIAMAG) == 0) {
return LD_ARCHIVE;
}
#endif
- if (strncmp((char *) buf, ELFMAG, SELFMAG) == 0) {
- if( *((Elf32_Half *)(buf + ELFDLOFF)) == ELFDLMAG ) {
+ 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 ) {
+ if (buf[0] == 0x4c && buf[1] == 0x01) {
/* I386MAGIC */
return LD_COFFOBJECT;
}
- if( buf[0] == 0x01 && buf[1] == 0xdf ) {
+ if (buf[0] == 0x01 && buf[1] == 0xdf) {
/* XCOFFMAGIC */
return LD_COFFOBJECT;
- }
- if( buf[0] == 0x0d && buf[1] == 0x01 ) {
+ }
+ 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] == 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] == 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] == 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;
+ 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 */
-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)
+_LoaderFileToMem(int fd, unsigned long offset, int size, char *label)
{
#ifdef UseMMAP
- unsigned long ret;
+ unsigned long ret;
+
# ifdef MmapPageAlign
unsigned long pagesize;
unsigned long new_size;
@@ -437,7 +474,8 @@ _LoaderFileToMem(int fd, unsigned long offset,int size, char *label)
# define MMAP_PROT (PROT_READ|PROT_WRITE|PROT_EXEC)
# ifdef DEBUGMEM
- ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)",fd,offset,offsetbias,size,label);
+ ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size,
+ label);
# endif
# ifdef MmapPageAlign
pagesize = getpagesize();
@@ -446,81 +484,84 @@ _LoaderFileToMem(int fd, unsigned long offset,int size, char *label)
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
+ if ((new_off_bias + size) > new_size)
+ new_size += pagesize;
+ ret = (unsigned long)mmap(0, new_size, MMAP_PROT, MAP_PRIVATE
+# ifdef __AMD64__
+ | MAP_32BIT
# endif
- ,
- fd,new_off);
- if(ret == -1)
- FatalError("mmap() failed: %s\n", strerror(errno) );
+ , 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
+ ret = (unsigned long)mmap(0, size, MMAP_PROT, MAP_PRIVATE
+# ifdef __AMD64__
+ | MAP_32BIT
# endif
- ,
- fd,offset + offsetbias);
- if(ret == -1)
- FatalError("mmap() failed: %s\n", strerror(errno) );
+ , 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);
+ ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size,
+ label);
# endif
- if(size == 0){
+ if (size == 0) {
# ifdef DEBUGMEM
- ErrorF("=NULL\n",ptr);
+ ErrorF("=NULL\n", ptr);
# endif
return NULL;
}
-
# ifndef __UNIXOS2__
- if( (ptr=xf86loadercalloc(size,1)) == NULL )
- FatalError("_LoaderFileToMem() malloc failed\n" );
+ if ((ptr = xf86loadercalloc(size, 1)) == NULL)
+ FatalError("_LoaderFileToMem() malloc failed\n");
# else
- if( (ptr=os2ldcalloc(size,1)) == NULL )
- FatalError("_LoaderFileToMem() malloc failed\n" );
+ 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);
+ 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 (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 (read(fd, ptr, size) != size)
+ FatalError("\n_LoaderFileToMem() read() failed: %s\n",
+ strerror(errno));
# if (defined(linux) || defined(__NetBSD__) || defined(__OpenBSD__)) \
- && defined(__powerpc__)
+ && 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);
- }
+ {
+ 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);
+ ErrorF("=%lx\n", ptr);
# endif
return (void *)ptr;
@@ -535,25 +576,26 @@ _LoaderFreeFileMem(void *addr, int size)
{
#if defined (UseMMAP) && defined (MmapPageAlign)
unsigned long pagesize = getpagesize();
- memType i_addr = (memType)addr;
+ memType i_addr = (memType) addr;
unsigned long new_size;
#endif
#ifdef DEBUGMEM
- ErrorF("_LoaderFreeFileMem(%x,%d)\n",addr,size);
+ ErrorF("_LoaderFreeFileMem(%x,%d)\n", addr, size);
#endif
#ifdef UseMMAP
# if defined (MmapPageAlign)
- i_addr /= pagesize;
- i_addr *= pagesize;
+ 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);
+ if (((memType) addr - i_addr + size) > new_size)
+ new_size += pagesize;
+ munmap((void *)i_addr, new_size);
# else
- munmap((void *)addr,size);
+ munmap((void *)addr, size);
# endif
#else
- if(size == 0)
+ if (size == 0)
return;
xf86loaderfree(addr);
@@ -565,43 +607,44 @@ _LoaderFreeFileMem(void *addr, int size)
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 (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) );
+ if (read(fd, buf, size) != size)
+ FatalError("_LoaderFileRead() read() failed: %s\n", strerror(errno));
return size;
}
-static loaderPtr listHead = (loaderPtr) 0 ;
+static loaderPtr listHead = (loaderPtr) 0;
static loaderPtr
_LoaderListPush()
{
- loaderPtr item = xf86loadercalloc(1, sizeof (struct _loader));
- item->next = listHead ;
- listHead = item;
+ loaderPtr item = xf86loadercalloc(1, sizeof(struct _loader));
- return item;
+ item->next = listHead;
+ listHead = item;
+
+ return item;
}
static loaderPtr
_LoaderListPop(int handle)
{
- loaderPtr item=listHead;
- loaderPtr *bptr=&listHead; /* pointer to previous node */
+ loaderPtr item = listHead;
+ loaderPtr *bptr = &listHead; /* pointer to previous node */
- while(item) {
- if( item->handle == handle ) {
- *bptr=item->next; /* remove this from the list */
+ while (item) {
+ if (item->handle == handle) {
+ *bptr = item->next; /* remove this from the list */
return item;
- }
- bptr=&(item->next);
- item=item->next;
}
+ bptr = &(item->next);
+ item = item->next;
+ }
- return 0;
+ return 0;
}
/*
@@ -612,30 +655,30 @@ _LoaderListPop(int handle)
char *
_LoaderHandleToName(int handle)
{
- loaderPtr item=listHead;
- loaderPtr aritem=NULL;
- loaderPtr lastitem=NULL;
+ loaderPtr item = listHead;
+ loaderPtr aritem = NULL;
+ loaderPtr lastitem = NULL;
- if ( handle < 0 ) {
+ if (handle < 0) {
return "(built-in)";
- }
- while(item) {
- if( item->handle == handle ) {
- if( strchr(item->name,':') == NULL )
- aritem=item;
+ }
+ while (item) {
+ if (item->handle == handle) {
+ if (strchr(item->name, ':') == NULL)
+ aritem = item;
else
- lastitem=item;
- }
- item=item->next;
+ lastitem = item;
}
+ item = item->next;
+ }
- if( aritem )
- return aritem->name;
+ if (aritem)
+ return aritem->name;
- if( lastitem )
- return lastitem->name;
+ if (lastitem)
+ return lastitem->name;
- return 0;
+ return 0;
}
/*
@@ -646,23 +689,23 @@ _LoaderHandleToName(int handle)
char *
_LoaderHandleToCanonicalName(int handle)
{
- loaderPtr item=listHead;
- loaderPtr lastitem=NULL;
+ loaderPtr item = listHead;
+ loaderPtr lastitem = NULL;
- if ( handle < 0 ) {
+ if (handle < 0) {
return "(built-in)";
- }
- while(item) {
- if( item->handle == handle ) {
- lastitem=item;
+ }
+ while (item) {
+ if (item->handle == handle) {
+ lastitem = item;
}
- item=item->next;
- }
+ item = item->next;
+ }
- if( lastitem )
- return lastitem->cname;
+ if (lastitem)
+ return lastitem->cname;
- return NULL;
+ return NULL;
}
/*
@@ -673,30 +716,30 @@ _LoaderHandleToCanonicalName(int handle)
char *
_LoaderModuleToName(int module)
{
- loaderPtr item=listHead;
- loaderPtr aritem=NULL;
- loaderPtr lastitem=NULL;
+ loaderPtr item = listHead;
+ loaderPtr aritem = NULL;
+ loaderPtr lastitem = NULL;
- if ( module < 0 ) {
+ if (module < 0) {
return "(built-in)";
- }
- while(item) {
- if( item->module == module ) {
- if( strchr(item->name,':') == NULL )
- aritem=item;
+ }
+ while (item) {
+ if (item->module == module) {
+ if (strchr(item->name, ':') == NULL)
+ aritem = item;
else
- lastitem=item;
+ lastitem = item;
}
- item=item->next;
- }
+ item = item->next;
+ }
- if( aritem )
- return aritem->name;
+ if (aritem)
+ return aritem->name;
- if( lastitem )
- return lastitem->name;
+ if (lastitem)
+ return lastitem->name;
- return 0;
+ return 0;
}
/*
@@ -705,28 +748,28 @@ _LoaderModuleToName(int module)
*/
int
_LoaderAddressToSection(const unsigned long address, const char **module,
- const char ** section)
+ const char **section)
{
- loaderPtr item=listHead;
+ loaderPtr item = listHead;
- while(item) {
- if( (*section=item->funcs->AddressToSection(item->private, address)) != NULL ) {
- *module=_LoaderModuleToName(item->module);
- return 1;
+ while (item) {
+ if ((*section =
+ item->funcs->AddressToSection(item->private, address)) != NULL) {
+ *module = _LoaderModuleToName(item->module);
+ return 1;
}
- item=item->next;
- }
+ item = item->next;
+ }
- return 0;
+ return 0;
}
-
/*
* Add a list of symbols to the referenced list.
*/
static void
-AppendSymbol(symlist *list, const char *sym)
+AppendSymbol(symlist * list, const char *sym)
{
list->list = xnfrealloc(list->list, (list->num + 1) * sizeof(char **));
list->list[list->num] = sym;
@@ -734,7 +777,7 @@ AppendSymbol(symlist *list, const char *sym)
}
static void
-AppendSymList(symlist *list, const char **syms)
+AppendSymList(symlist * list, const char **syms)
{
while (*syms) {
AppendSymbol(list, *syms);
@@ -743,7 +786,7 @@ AppendSymList(symlist *list, const char **syms)
}
static int
-SymInList(symlist *list, char *sym)
+SymInList(symlist * list, char *sym)
{
int i;
@@ -760,12 +803,12 @@ LoaderVRefSymbols(const char *sym0, va_list args)
const char *s;
if (sym0 == NULL)
- return;
+ return;
s = sym0;
do {
- AppendSymbol(&refList, s);
- s = va_arg(args, const char *);
+ AppendSymbol(&refList, s);
+ s = va_arg(args, const char *);
} while (s != NULL);
}
@@ -877,112 +920,110 @@ _LoaderHandleUnresolved(char *symbol, char *module)
symbol, module);
}
}
- return(fatalsym);
+ return (fatalsym);
}
/*
* Handle an archive.
*/
void *
-ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup)
+ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP ** ppLookup)
{
loaderPtr tmp = NULL;
void *ret = NULL;
- unsigned char magic[SARMAG];
- struct ar_hdr hdr;
+ unsigned char magic[SARMAG];
+ struct ar_hdr hdr;
+
#if defined(__powerpc__) && defined(Lynx)
- struct fl_hdr fhdr;
- char name[255];
- int namlen;
+ 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;
+ 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? */
+ 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);
+ arnamesize = strlen(modrec->name);
#if !(defined(__powerpc__) && defined(Lynx))
- read(arfd,magic,SARMAG);
+ read(arfd, magic, SARMAG);
- if(strncmp((const char *)magic,ARMAG,SARMAG) != 0 ) {
- ErrorF("ARCHIVELoadModule: wrong magic!!\n" );
+ if (strncmp((const char *)magic, ARMAG, SARMAG) != 0) {
+ ErrorF("ARCHIVELoadModule: wrong magic!!\n");
return NULL;
}
- resetoff=SARMAG;
#else
- read(arfd,&fhdr,FL_HSZ);
+ read(arfd, &fhdr, FL_HSZ);
- if(strncmp(fhdr.fl_magic,AIAMAG,SAIAMAG) != 0 ) {
- ErrorF("ARCHIVELoadModule: wrong magic!!\n" );
+ 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 );
+ ErrorF("Looking for archive members starting at offset %o\n", offset);
#endif
- while( read(arfd,&hdr,sizeof(struct ar_hdr)) ) {
+ while (read(arfd, &hdr, sizeof(struct ar_hdr))) {
longname = NULL;
- sscanf(hdr.ar_size,"%d",&size);
+ sscanf(hdr.ar_size, "%u", &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 */
+ 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);
+ offset = lseek(arfd, 0, SEEK_CUR);
/* Check for a Symbol Table */
- if( (hdr.ar_name[0] == '/' && hdr.ar_name[1] == ' ') ||
+ if ((hdr.ar_name[0] == '/' && hdr.ar_name[1] == ' ') ||
#if defined(__powerpc__) && defined(Lynx)
namlen == 0 ||
#endif
- strncmp(hdr.ar_name, "__.SYMDEF", 9) == 0 ) {
+ 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 );
+ 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 */
+ 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 (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 );
+ hdr.ar_name, size, offset);
+ ErrorF("String table size %d\n", size);
#endif
nametablelen = size;
- nametable=(char *)xf86loadermalloc(nametablelen);
+ nametable = (char *)xf86loadermalloc(nametablelen);
read(arfd, nametable, size);
- offset=lseek(arfd,0,SEEK_CUR);
+ 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 */
+ if (offset & 0x1) /* odd value */
+ offset = lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */
continue;
}
@@ -990,50 +1031,50 @@ ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup)
/* 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 ) ;
+ 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 ) ;
+ 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,'/');
+ slash = strchr(membername, '/');
if (slash)
*slash = '\0';
longname = xf86loadermalloc(arnamesize + strlen(membername) + 2);
- strcpy(longname,modrec->name);
- strcat(longname,":");
- strcat(longname,membername);
+ 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) {
+ 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);
+ 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);
+ ErrorF("Bad archive member %s\n", hdr.ar_name);
xf86loaderfree(longname);
offsetbias = 0;
return NULL;
- }
+ }
longname[i] = '\0';
offset += i;
size -= i;
- } else {
+ } else {
/* Regular archive member */
#ifdef DEBUGAR
ErrorF("Member '%16.16s', size %d, offset %x\n",
@@ -1042,87 +1083,85 @@ ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup)
#else
name,
#endif
- size, offset );
+ size, offset);
#endif
- slash=strchr(hdr.ar_name,'/');
+ slash = strchr(hdr.ar_name, '/');
if (slash == NULL) {
/* BSD format without trailing slash */
- slash = strchr(hdr.ar_name,' ');
- }
+ 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 ((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 ((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 = _LoaderListPush();
tmp->handle = modrec->handle;
tmp->module = moduleseq++;
tmp->cname = xf86loadermalloc(strlen(modrec->cname) + 1);
strcpy(tmp->cname, modrec->cname);
- tmp->funcs=&funcs[modtype];
+ 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);
-
+ 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;
+ 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 ((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 */
+ 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) {
+ if (tmp->private == (void *)-1L) {
ErrorF("Skipping \"%s\": No symbols found\n", tmp->name);
continue;
- }
- else
+ } 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++)
- ;
+ for (i = 0, p = lookup_ret; p && p->symName; i++, p++) ;
if (i) {
myLookup = xf86loaderrealloc(myLookup, (numsyms + i + 1)
- * sizeof (LOOKUP));
+ * sizeof(LOOKUP));
if (!myLookup)
- continue; /* Oh well! */
+ continue; /* Oh well! */
- memcpy(&(myLookup[numsyms]), lookup_ret, i * sizeof (LOOKUP));
+ memcpy(&(myLookup[numsyms]), lookup_ret, i * sizeof(LOOKUP));
numsyms += i;
myLookup[numsyms].symName = 0;
}
xf86loaderfree(lookup_ret);
}
/* xf86loaderfree(lookup_ret); */
- offsetbias=0;
+ offsetbias = 0;
*ppLookup = myLookup;
if (nametable)
@@ -1141,9 +1180,9 @@ ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup)
LoaderRelocPtr
_LoaderGetRelocations(void *mod)
{
- loader_funcs *formatrec = (loader_funcs *)mod;
+ loader_funcs *formatrec = (loader_funcs *) mod;
- return &(formatrec->pRelocs);
+ return &(formatrec->pRelocs);
}
/*
@@ -1154,13 +1193,13 @@ int
LoaderOpen(const char *module, const char *cname, int handle,
int *errmaj, int *errmin, int *wasLoaded)
{
- loaderPtr tmp ;
- int new_handle, modtype ;
+ loaderPtr tmp;
+ int new_handle, modtype;
int fd;
LOOKUP *pLookup;
#if defined(DEBUG)
- ErrorF("LoaderOpen(%s)\n", module );
+ ErrorF("LoaderOpen(%s)\n", module);
#endif
/*
@@ -1171,26 +1210,26 @@ LoaderOpen(const char *module, const char *cname, int handle,
*/
if (handle >= 0) {
tmp = listHead;
- while ( tmp ) {
+ while (tmp) {
#ifdef DEBUGLIST
- ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module,module,&(tmp->name),
- tmp->name,tmp->name );
+ ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module, module,
+ &(tmp->name), tmp->name, tmp->name);
#endif
- if ( ! strcmp( module, tmp->name )) {
+ 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 ;
+ tmp = tmp->next;
}
}
/*
* OK, it's a new one. Add it.
*/
- xf86Msg(X_INFO, "Loading %s\n", module ) ;
+ xf86Msg(X_INFO, "Loading %s\n", module);
if (wasLoaded)
*wasLoaded = 0;
@@ -1198,54 +1237,62 @@ LoaderOpen(const char *module, const char *cname, int handle,
* 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 ;
+ 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 ;
+ 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 ((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;
+ 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 = _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];
+ tmp->funcs = &funcs[modtype];
- if((tmp->private = funcs[modtype].LoadModule(tmp,fd, &pLookup)) == NULL) {
- xf86Msg(X_ERROR, "Failed to load %s\n", module ) ;
+ 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;
+ freeHandles[new_handle] = HANDLE_FREE;
+ if (errmaj)
+ *errmaj = LDR_NOLOAD;
+ if (errmin)
+ *errmin = LDR_NOLOAD;
return -1;
}
- if (tmp->private != (void *) -1L) {
+ if (tmp->private != (void *)-1L) {
LoaderAddSymbols(new_handle, tmp->module, pLookup);
xf86loaderfree(pLookup);
}
@@ -1273,16 +1320,17 @@ 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 ;
+ if (item)
+ return item->address;
else
#ifdef DLOPEN_SUPPORT
- return(DLFindSymbol(sym));
+ return (DLFindSymbol(sym));
#else
return NULL;
#endif
@@ -1292,36 +1340,37 @@ int
LoaderResolveSymbols(void)
{
int i;
- for(i=0;i<numloaders;i++)
+
+ for (i = 0; i < numloaders; i++)
funcs[i].ResolveSymbols(&funcs[i]);
return 0;
}
int
-LoaderCheckUnresolved(int delay_flag )
+LoaderCheckUnresolved(int delay_flag)
{
- int i,ret=0;
- LoaderResolveOptions delayFlag = delay_flag;
+ int i, ret = 0;
+ LoaderResolveOptions delayFlag = (LoaderResolveOptions)delay_flag;
- LoaderResolveSymbols();
+ 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 (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 (!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");
+ if (fatalReqSym)
+ FatalError("Some required symbols were unresolved\n");
- return ret;
+ return ret;
}
void xf86LoaderTrap(void);
@@ -1334,59 +1383,60 @@ xf86LoaderTrap(void)
void
LoaderDefaultFunc(void)
{
- ErrorF("\n\n\tThis should not happen!\n"
- "\tAn unresolved function was called!\n");
+ ErrorF("\n\n\tThis should not happen!\n"
+ "\tAn unresolved function was called!\n");
- xf86LoaderTrap();
-
- FatalError("\n");
+ xf86LoaderTrap();
+
+ FatalError("\n");
}
int
LoaderUnload(int handle)
{
- loaderRec fakeHead ;
- loaderPtr tmp = & fakeHead ;
+ loaderRec fakeHead;
+ loaderPtr tmp = &fakeHead;
- if ( handle < 0 || handle > MAX_HANDLE )
+ if (handle < 0 || handle > MAX_HANDLE)
return -1;
- /*
- * check the reference count, only free it if it goes to zero
- */
- if (--refCount[handle])
+ /*
+ * 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 ) ;
+ /*
+ * 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 ;
+ }
+
+ freeHandles[handle] = HANDLE_FREE;
-return 0;
+ return 0;
}
void
LoaderDuplicateSymbol(const char *symbol, const int handle)
{
ErrorF("Duplicate symbol %s in %s\n", symbol,
- listHead ? listHead->name : "(built-in)");
+ 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()
+void
+_loader_debug_state()
{
}
@@ -1395,18 +1445,17 @@ unsigned long LoaderOptions = 0;
void
LoaderResetOptions(void)
{
- LoaderOptions = 0;
+ LoaderOptions = 0;
}
void
LoaderSetOptions(unsigned long opts)
{
- LoaderOptions |= opts;
+ LoaderOptions |= opts;
}
void
LoaderClearOptions(unsigned long opts)
{
- LoaderOptions &= ~opts;
+ LoaderOptions &= ~opts;
}
-
diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h
index a814544b8..f48aadb02 100644
--- a/hw/xfree86/loader/loader.h
+++ b/hw/xfree86/loader/loader.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.h,v 1.25 2001/02/22 23:17:09 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.h,v 1.28 2003/11/06 18:38:14 tsi Exp $ */
/*
*
@@ -22,6 +22,33 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright (c) 1997-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
#ifndef _LOADER_H
#define _LOADER_H
@@ -30,18 +57,14 @@
#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
@@ -50,12 +73,9 @@
#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
*/
@@ -63,18 +83,15 @@
#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 _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 AOUT_RELOC *AOUTRelocPtr;
+typedef struct AOUT_COMMON *AOUTCommonPtr;
typedef struct _LoaderReloc {
int modtype;
@@ -86,52 +103,52 @@ typedef struct _LoaderReloc {
typedef struct _loader_item *itemPtr;
typedef struct _loader_item {
- char *name ;
- void *address ;
- itemPtr next ;
- int handle ;
- int module ;
- itemPtr exports;
+ 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 ;
+ /*
+ * 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 ;
+} 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 */
+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 */
+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;
+extern char DebuggerPresent;
+extern LDRModulePtr ModList;
+extern LDRCommonPtr ldrCommons;
+extern int nCommons;
/*
* The loader uses loader specific alloc/calloc/free functions that
@@ -172,41 +189,41 @@ 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 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 */
+ 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;
+ 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;
+ int xf86Version;
+ int ansicVersion;
+ int videodrvVersion;
+ int xinputVersion;
+ int extensionVersion;
+ int fontVersion;
} ModuleVersions;
extern ModuleVersions LoaderVersionInfo;
@@ -217,6 +234,7 @@ extern unsigned long LoaderOptions;
void LoaderAddSymbols(int, int, LOOKUP *);
void LoaderDefaultFunc(void);
void LoaderDuplicateSymbol(const char *, const int);
+
#if 0
void LoaderFixups(void);
#endif
@@ -232,7 +250,8 @@ void LoaderPrintItem(itemPtr);
void LoaderPrintSymbol(unsigned long);
void LoaderDumpSymbols(void);
char *_LoaderModuleToName(int);
-int _LoaderAddressToSection(const unsigned long, const char **, const char **);
+int _LoaderAddressToSection(const unsigned long, const char **,
+ const char **);
int LoaderOpen(const char *, const char *, int, int *, int *, int *);
int LoaderHandleOpen(int);
@@ -251,8 +270,8 @@ LoaderRelocPtr _LoaderGetRelocations(void *);
/*
* object to name lookup routines
*/
-char * _LoaderHandleToName(int handle);
-char * _LoaderHandleToCanonicalName(int handle);
+char *_LoaderHandleToName(int handle);
+char *_LoaderHandleToCanonicalName(int handle);
/*
* Entry points for the different loader types
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index ff6c64b07..d2779812f 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loaderProcs.h,v 1.19 2002/07/30 18:36:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loaderProcs.h,v 1.21 2003/10/15 16:29:04 dawes Exp $ */
/*
*
@@ -22,6 +22,32 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright (c) 1997-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _LOADERPROCS_H
#define _LOADERPROCS_H
@@ -31,24 +57,23 @@
#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;
+ 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
*/
@@ -64,17 +89,16 @@ 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 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);
@@ -92,5 +116,4 @@ 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
index 206c8296a..ffc98b243 100644
--- a/hw/xfree86/loader/loadext.c
+++ b/hw/xfree86/loader/loadext.c
@@ -1,6 +1,30 @@
-/* $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 */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadext.c,v 1.8 2003/10/15 16:29:04 dawes Exp $ */
+/*
+ * Copyright (c) 2000 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/* Maybe this file belongs elsewhere? */
@@ -12,58 +36,56 @@
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);
- }
+ 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)
+LoadExtension(ExtensionModule * e, Bool builtin)
{
- ExtensionModule *newext;
+ ExtensionModule *newext;
- if (e == NULL || e->name == NULL)
- return;
+ if (e == NULL || e->name == NULL)
+ return;
- if (!(newext = NewExtensionModule()))
- 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);
+ 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;
+ 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();
+ if (e->setupFunc != NULL)
+ e->setupFunc();
}
-
/*
* Sort ExtensionModuleList according to the initialisation order
* dependencies. The code for this is taken from BSD's tsort,
@@ -105,21 +127,20 @@ LoadExtension(ExtensionModule *e, Bool builtin)
* SUCH DAMAGE.
*/
-
-#define NF_MARK 0x1 /* marker for cycle detection */
-#define NF_ACYCLIC 0x2 /* this node is cycle free */
-#define NF_NODEST 0x4 /* Unreachable */
+#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 */
+ 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;
@@ -130,32 +151,31 @@ static NODE *sorted = NULL, *last = NULL;
static NODE *
get_node(const char *name)
{
- NODE *n;
+ NODE *n;
- for (n = graph; n && n->n_name && strcmp(n->n_name, name); n = n->n_next)
- ;
- if (n)
- return (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 = 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;
+ 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;
+ /* Add to linked list. */
+ if ((n->n_next = graph) != NULL)
+ graph->n_prevp = &n->n_next;
+ n->n_prevp = &graph;
+ graph = n;
- return (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.
@@ -163,35 +183,35 @@ get_node(const char *name)
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;
+ 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;
}
/*
@@ -200,220 +220,214 @@ add_arc(const char *s1, const char *s2)
static void
clear_cycle(void)
{
- NODE *n;
+ NODE *n;
- for (n = graph; n != NULL; n = n->n_next)
- n->n_flags &= ~NF_NODEST;
+ 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)
+remove_node(NODE * n)
{
- NODE **np;
- NODE *newnode;
- int i;
+ NODE **np;
+ NODE *newnode;
+ int i;
#ifdef DEBUG
- ErrorF("%s\n", n->n_name);
+ 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;
+ 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)
+free_nodes(NODE * nodelist)
{
- NODE *n, *nextnode;
+ NODE *n, *nextnode;
- for (n = nodelist; n;) {
- nextnode = n->n_next;
- xfree(n);
- 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)
+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);
+ 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);
+ 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 == 0)
+ (*np)->n_flags |= NF_NODEST;
- if (len > longest_len)
- longest_len = len;
+ if (len > longest_len)
+ longest_len = len;
- if (len > 0 && !longest)
- break;
- }
+ if (len > 0 && !longest)
+ break;
}
- from->n_flags &= ~NF_MARK;
- return (longest_len);
+ }
+ 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;
+ 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;
}
- 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");
+ }
+ } 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;
}
- if (cycle_buf)
- xfree(cycle_buf);
- if (longest_cycle)
- xfree(longest_cycle);
- if (graph)
- free_nodes(graph);
+ 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);
+ 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);
+ ErrorF("Extension %s:\n", ext->name);
#endif
- if (ext->initDependencies)
- for (j = 0; ext->initDependencies[j]; j++) {
- add_arc(ext->initDependencies[j], ext->name);
+ 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]);
+ 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;
+ }
+ }
+ 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);
+ 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
index 8ab5d0d6e..6886692da 100644
--- a/hw/xfree86/loader/loadfont.c
+++ b/hw/xfree86/loader/loadfont.c
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadfont.c,v 1.2 1998/12/13 12:42:41 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadfont.c,v 1.4 2003/10/15 16:29:04 dawes Exp $ */
+/*
+ * Copyright (c) 1998 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/* Maybe this file belongs in lib/font/fontfile/module/ ? */
@@ -10,44 +36,42 @@
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);
- }
+ 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)
+LoadFont(FontModule * f)
{
- FontModule *newfont;
+ FontModule *newfont;
- if (f == NULL)
- return;
+ if (f == NULL)
+ return;
- if (!(newfont = NewFontModule()))
- return;
+ if (!(newfont = NewFontModule()))
+ return;
- xf86MsgVerb(X_INFO, 2, "Loading font %s\n", f->name);
+ xf86MsgVerb(X_INFO, 2, "Loading font %s\n", f->name);
- newfont->name = f->name;
- newfont->initFunc = f->initFunc;
- newfont->module = f->module;
+ 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
index deba80643..733f6feb1 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.68 2002/07/30 18:36:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.73 2003/11/03 05:11:51 tsi Exp $ */
/*
*
@@ -22,8 +22,32 @@
* 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 */
+/*
+ * Copyright (c) 1997-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "os.h"
/* For stat() and related stuff */
@@ -48,50 +72,51 @@
extern int check_unresolved_sema;
typedef struct _pattern {
- const char * pattern;
- regex_t rex;
+ 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 *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
+ XF86_VERSION_CURRENT,
+ ABI_ANSIC_VERSION,
+ ABI_VIDEODRV_VERSION,
+ ABI_XINPUT_VERSION,
+ ABI_EXTENSION_VERSION,
+ ABI_FONT_VERSION
};
#if 0
void
-LoaderFixups (void)
+LoaderFixups(void)
{
- /* Need to call LRS here because the frame buffers get loaded last,
- * and the drivers depend on them. */
+ /* Need to call LRS here because the frame buffers get loaded last,
+ * and the drivers depend on them. */
- LoaderResolveSymbols ();
+ LoaderResolveSymbols();
}
#endif
static void
FreeStringList(char **paths)
{
- char **p;
+ char **p;
- if (!paths)
- return;
+ if (!paths)
+ return;
- for (p = paths; *p; p++)
- xfree(*p);
+ for (p = paths; *p; p++)
+ xfree(*p);
- xfree(paths);
+ xfree(paths);
}
static char **defaultPathList = NULL;
@@ -104,90 +129,89 @@ static char **defaultPathList = NULL;
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 */
+ 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 == '/')
+ if (*elem == '/')
#else
- if (*elem == '/' || (strlen(elem) > 2 && isalpha(elem[0]) &&
- elem[1] == ':' && elem[2] == '/'))
+ 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++;
+ {
+ 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);
}
- elem = strtok(NULL, ",");
+ 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++;
}
- if (list)
- list[n] = NULL;
- return list;
+ elem = strtok(NULL, ",");
+ }
+ if (list)
+ list[n] = NULL;
+ return list;
}
static void
FreePathList(char **pathlist)
{
- if (pathlist && pathlist != defaultPathList)
- FreeStringList(pathlist);
+ if (pathlist && pathlist != defaultPathList)
+ FreeStringList(pathlist);
}
void
LoaderSetPath(const char *path)
{
- if (!path)
- return;
+ if (!path)
+ return;
- defaultPathList = InitPathList(path);
+ 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
+static const char *stdSubdirs[] = {
+ "drivers/",
+ "input/",
+ "multimedia/",
+ "extensions/",
+ "fonts/",
+ "internal/",
+ "",
+ NULL
};
/*
@@ -195,519 +219,529 @@ static const char *stdSubdirs[] =
* 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, }
+ {"^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);
- }
+ 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;
}
-
- 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--;
}
- 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;
+ } 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);
+ if (patterns && patterns != stdPatterns)
+ xfree(patterns);
}
static const char **
InitSubdirs(const char **subdirlist)
{
- int i;
- char **subdirs = NULL;
- const char **s, **stmp = NULL;
+ int i;
+ const char **tmp_subdirlist = NULL;
+ 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;
- }
-
+ subdirlist = tmp_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;
- }
- }
+ /* 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);
+ if (tmp_subdirlist)
+ xfree(tmp_subdirlist);
+ return NULL;
}
- subdirs = xalloc((i * 2 + 1) * sizeof(char *));
- if (!subdirs)
- return NULL;
- i = 0;
- s = subdirlist;
+ }
+ }
+ subdirs = xalloc((i * 2 + 1) * sizeof(char *));
+ if (!subdirs) {
+ if (tmp_subdirlist)
+ xfree(tmp_subdirlist);
+ 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))) {
+ while (--i >= 0)
+ xfree(subdirs[i]);
+ xfree(subdirs);
+ if (tmp_subdirlist)
+ xfree(tmp_subdirlist);
+ 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;
- 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;
+ s = stmp;
+ }
}
- return (const char **)subdirs;
+ subdirs[i] = NULL;
+ }
+ if (tmp_subdirlist)
+ xfree(tmp_subdirlist);
+ return (const char **)subdirs;
}
static void
FreeSubdirs(const char **subdirs)
{
- const char **s;
+ const char **s;
- if (subdirs) {
- for (s = subdirs; *s; s++)
- xfree(*s);
- xfree(subdirs);
- }
+ 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)
+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;
+ 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;
+ dirpath = (char *)dir;
#else
- dirpath = xalloc(strlen(dir) + 10);
- strcpy(dirpath, (char *) __XOS2RedirRoot (dir));
+ 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;
+ 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;
}
- closedir(d);
- if (name)
- break;
+ }
}
+ if (name)
+ break;
+ }
+ closedir(d);
+ if (name)
+ break;
}
- FreeSubdirs(subdirs);
- if (dirpath != dir)
- xfree(dirpath);
-
- if (name) {
- return xstrdup(name);
- }
- return NULL;
+ }
+ 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;
- }
+ 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;
- }
- }
+ 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);
}
- closedir(d);
+ 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;
+ }
+ if (listing)
+ listing[n] = NULL;
+ return listing;
}
void
LoaderFreeDirList(char **list)
{
- FreeStringList(list);
+ FreeStringList(list);
}
-
static Bool
-CheckVersion (const char *module, XF86ModuleVersionInfo *data,
- const XF86ModReqInfo *req)
+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);
- }
+ int vercode[4];
+ char verstr[4];
+ long ver = data->xf86version;
+ MessageType errtype;
+
+ 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;
- }
- }
+ 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;
- }
+ }
+
+ /* 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;
+ }
}
+ }
}
-
-#ifdef NOTYET
- if (data->checksum)
- {
- /* verify the checksum field */
- /* TO BE DONE */
+ 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;
+ }
}
- else
- {
- ErrorF ("\t*** Checksum field is 0 - this module is untrusted!\n");
+ 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;
}
@@ -715,69 +749,69 @@ CheckVersion (const char *module, XF86ModuleVersionInfo *data,
ModuleDescPtr
LoadSubModule(ModuleDescPtr parent, const char *module,
const char **subdirlist, const char **patternlist,
- pointer options, const XF86ModReqInfo *modreq,
+ pointer options, const XF86ModReqInfo * modreq,
int *errmaj, int *errmin)
{
- ModuleDescPtr submod;
+ ModuleDescPtr submod;
- xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module);
+ xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module);
- /* Absolute module paths are not allowed here */
+ /* Absolute module paths are not allowed here */
#ifndef __UNIXOS2__
- if (module[0] == '/')
+ if (module[0] == '/')
#else
- if (isalpha (module[0]) && module[1] == ':' && module[2] == '/')
+ 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;
+ {
+ 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;
+ ModuleDescPtr ret;
- if (!mod)
- return NULL;
+ if (!mod)
+ return NULL;
- ret = NewModuleDesc(mod->name);
- if (ret == NULL)
- return NULL;
+ ret = NewModuleDesc(mod->name);
+ if (ret == NULL)
+ return NULL;
- if (LoaderHandleOpen(mod->handle) == -1)
- 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;
+ 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;
}
/*
@@ -819,241 +853,227 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
*/
ModuleDescPtr
-LoadModule (const char *module, const char *path, const char **subdirlist,
- const char **patternlist, pointer options,
- const XF86ModReqInfo * modreq,
- int *errmaj, int *errmin)
+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
- */
+ 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);
+ if (module[0] == '/')
+ found = xstrdup(module);
#else
- /* accept a drive name here */
- if (isalpha (module[0]) && module[1] == ':' && module[2] == '/')
- found = xstrdup(module);
+ /* 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);
-
+ path_elem = pathlist;
+ while (!found && *path_elem != NULL) {
+ found = FindModule(m, *path_elem, subdirlist, patterns);
+ path_elem++;
/*
- * now check if the special data object <modulename>ModuleData is
- * present.
+ * When the module name isn't the canonical name, search for the
+ * former if no match was found for the latter.
*/
- p = xalloc (strlen (name) + strlen ("ModuleData") + 1);
- if (!p) {
- if (errmaj)
- *errmaj = LDR_NOMEM;
- if (errmin)
- *errmin = 0;
- goto LoadModule_fail;
+ if (!*path_elem && m == name) {
+ path_elem = pathlist;
+ m = (char *)module;
}
- 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;
- }
+ }
+
+ /*
+ * 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;
}
- 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);
+ } else {
+ xf86Msg(X_ERROR,
+ "LoadModule: Module %s does not supply"
+ " version information\n", module);
if (errmaj)
- *errmaj = LDR_INVALID;
+ *errmaj = LDR_INVALID;
if (errmin)
- *errmin = 0;
+ *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);
+ 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;
}
- goto LoadModule_exit;
+ } 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;
+ 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.
- */
+ 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();
+ istream_mem_barrier();
#endif
- return ret;
+ return ret;
}
ModuleDescPtr
-LoadDriver (const char *module, const char *path, int handle, pointer options,
- int *errmaj, int *errmin)
+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);
+ return LoadModule(module, path, NULL, NULL, options, NULL, errmaj,
+ errmin);
}
void
-UnloadModule (ModuleDescPtr mod)
+UnloadModule(ModuleDescPtr mod)
{
- UnloadModuleOrDriver (mod);
+ UnloadModuleOrDriver(mod);
}
void
-UnloadDriver (ModuleDescPtr mod)
+UnloadDriver(ModuleDescPtr mod)
{
- UnloadModuleOrDriver (mod);
+ UnloadModuleOrDriver(mod);
}
static void
-UnloadModuleOrDriver (ModuleDescPtr mod)
+UnloadModuleOrDriver(ModuleDescPtr mod)
{
if (mod == NULL || mod->name == NULL)
return;
@@ -1061,18 +1081,18 @@ UnloadModuleOrDriver (ModuleDescPtr mod)
xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
if ((mod->TearDownProc) && (mod->TearDownData))
- mod->TearDownProc (mod->TearDownData);
- LoaderUnload (mod->handle);
+ mod->TearDownProc(mod->TearDownData);
+ LoaderUnload(mod->handle);
if (mod->child)
- UnloadModuleOrDriver (mod->child);
+ UnloadModuleOrDriver(mod->child);
if (mod->sib)
- UnloadModuleOrDriver (mod->sib);
- TestFree (mod->name);
- TestFree (mod->filename);
- xfree (mod);
+ UnloadModuleOrDriver(mod->sib);
+ TestFree(mod->name);
+ TestFree(mod->filename);
+ xfree(mod);
#ifdef __alpha__
- istream_mem_barrier();
+ istream_mem_barrier();
#endif
}
@@ -1085,69 +1105,67 @@ UnloadSubModule(ModuleDescPtr mod)
xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name);
if ((mod->TearDownProc) && (mod->TearDownData))
- mod->TearDownProc (mod->TearDownData);
- LoaderUnload (mod->handle);
+ mod->TearDownProc(mod->TearDownData);
+ LoaderUnload(mod->handle);
RemoveChild(mod);
if (mod->child)
- UnloadModuleOrDriver (mod->child);
+ UnloadModuleOrDriver(mod->child);
- TestFree (mod->name);
- TestFree (mod->filename);
- xfree (mod);
+ TestFree(mod->name);
+ TestFree(mod->filename);
+ xfree(mod);
}
void
-FreeModuleDesc (ModuleDescPtr head)
+FreeModuleDesc(ModuleDescPtr head)
{
- ModuleDescPtr sibs, prev;
+ 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);
- }
+ /*
+ * 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)
+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 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)
+AddSibling(ModuleDescPtr head, ModuleDescPtr new)
{
new->sib = head;
return (new);
@@ -1155,142 +1173,140 @@ AddSibling (ModuleDescPtr head, ModuleDescPtr new)
}
static void
-RemoveChild (ModuleDescPtr child)
+RemoveChild(ModuleDescPtr child)
{
- ModuleDescPtr mdp;
- ModuleDescPtr prevsib;
- ModuleDescPtr parent;
+ ModuleDescPtr mdp;
+ ModuleDescPtr prevsib;
+ ModuleDescPtr parent;
- if (!child->parent)
- return;
-
- parent = child->parent;
- if (parent->child == child) {
- parent->child = child->sib;
- return;
- }
+ if (!child->parent)
+ return;
- prevsib = parent->child;
- mdp = prevsib->sib;
- while (mdp && mdp != child) {
- prevsib = mdp;
- mdp = mdp->sib;
- }
- if (mdp == child)
- prevsib->sib = child->sib;
+ 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);
+ 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;
- }
+ 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);
+ /* 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)
+LoaderGetModuleVersion(ModuleDescPtr mod)
{
if (!mod || !mod->VersionInfo)
- return 0;
+ return 0;
return MODULE_VERSION_NUMERIC(mod->VersionInfo->majorversion,
- mod->VersionInfo->minorversion,
- mod->VersionInfo->patchlevel);
+ mod->VersionInfo->minorversion,
+ mod->VersionInfo->patchlevel);
}
diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
index 989978330..c2bf47587 100644
--- a/hw/xfree86/loader/misym.c
+++ b/hw/xfree86/loader/misym.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.35 2002/09/16 18:06:11 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.38 2003/10/15 16:29:04 dawes Exp $ */
/*
*
@@ -22,6 +22,34 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
#include "sym.h"
#include "misc.h"
#include "mi.h"
@@ -49,132 +77,133 @@
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)
+ 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(miRegionEqual)
+ 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)
+ SYMVAR(miGlyphExtents)
#endif
- { 0, 0 },
+ {0, 0}
};
diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c
index e2e710077..49f9c0d84 100644
--- a/hw/xfree86/loader/os.c
+++ b/hw/xfree86/loader/os.c
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/os.c,v 1.2 2002/05/31 18:46:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/os.c,v 1.4 2003/10/15 16:29:04 dawes Exp $ */
+
+/*
+ * Copyright (c) 1999-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "loaderProcs.h"
@@ -35,15 +62,13 @@
#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 */
-}
+ 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
index 6ad38aa49..e937b9f08 100644
--- a/hw/xfree86/loader/sym.h
+++ b/hw/xfree86/loader/sym.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/sym.h,v 1.6 2000/10/24 00:06:55 anderson Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/sym.h,v 1.7 2003/10/15 16:29:04 dawes Exp $ */
/*
*
@@ -31,11 +31,11 @@
* added to the symbol table.
*/
-typedef void (*funcptr)(void);
+typedef void (*funcptr) (void);
typedef struct {
- char *symName;
- funcptr offset;
+ char *symName;
+ funcptr offset;
} LOOKUP;
#define SYMFUNC( func ) { #func, (funcptr)&func },
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 8e8bdadfc..b2823c2e5 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.227.2.1 2003/03/13 04:10:47 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.242 2003/10/27 20:51:16 herrb Exp $ */
/*
*
@@ -22,6 +22,32 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#define INCLUDE_DEPRECATED 1
@@ -70,12 +96,6 @@
#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);
@@ -87,7 +107,7 @@ extern unsigned int _inw(unsigned short port);
extern unsigned int _inl(unsigned short port);
# endif
-# ifdef __FreeBSD__
+# 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);
@@ -97,25 +117,38 @@ 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);
+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(__sparc__) && defined(__FreeBSD__)
+extern float _Qp_qtos(unsigned int *);
+extern double _Qp_qtod(unsigned int *);
+extern unsigned long long _Qp_qtoux(unsigned int *);
+extern void _Qp_dtoq(unsigned int *, double);
+extern void _Qp_uitoq(unsigned int *, unsigned int);
#endif
#if defined(__GNUC__)
+#ifndef __UNIXOS2__
extern long __div64(long, long);
+#endif
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);
+
+#ifndef __UNIXOS2__
extern long __mul64(long, long);
+#endif
extern long __muldf3(long, long);
extern long __muldi3(long, long);
extern long __mulsf3(long, long);
@@ -124,14 +157,19 @@ extern long __udivdi3(long, long);
extern long __udivsi3(long, long);
extern long __umoddi3(long, long);
extern long __umodsi3(long, long);
+
+#ifndef __UNIXOS2__
#pragma weak __div64
+#endif
#pragma weak __divdf3
#pragma weak __divdi3
#pragma weak __divsf3
#pragma weak __divsi3
#pragma weak __moddi3
#pragma weak __modsi3
+#ifndef __UNIXOS2__
#pragma weak __mul64
+#endif
#pragma weak __muldf3
#pragma weak __muldi3
#pragma weak __mulsf3
@@ -199,935 +237,912 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
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)
+ /* 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)
+ 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)
+ 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)
+ /* 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)
+ /* 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)
+ SYMFUNC(xf86EnablePciBusMaster)
#endif
- SYMFUNC(xf86RegisterStateChangeNotificationCallback)
- SYMFUNC(xf86DeregisterStateChangeNotificationCallback)
- SYMFUNC(xf86NoSharedResources)
+ SYMFUNC(xf86RegisterStateChangeNotificationCallback)
+ SYMFUNC(xf86DeregisterStateChangeNotificationCallback)
+ SYMFUNC(xf86NoSharedResources)
#ifdef async
- SYMFUNC(xf86QueueAsyncEvent)
+ 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)
+ /* 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)
+ /* 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)
+ /* xf86DPMS.c */
+ SYMFUNC(xf86DPMSInit)
- /* xf86Events.c */
- SYMFUNC(SetTimeSinceLastInputEvent)
- SYMFUNC(xf86AddInputHandler)
- SYMFUNC(xf86RemoveInputHandler)
- SYMFUNC(xf86DisableInputHandler)
- SYMFUNC(xf86EnableInputHandler)
- SYMFUNC(xf86AddEnabledDevice)
- SYMFUNC(xf86RemoveEnabledDevice)
- SYMFUNC(xf86InterceptSignals)
- SYMFUNC(xf86EnableVTSwitch)
+ /* 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)
+ /* 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)
+ /* 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)
+ /* 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)
+ /* 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)
-
+ /* xf86Option.c */
+ SYMFUNC(xf86CollectOptions)
+ SYMFUNC(xf86CollectInputOptions)
+ /* Merging of XInput stuff */
+ SYMFUNC(xf86AddNewOption)
+ SYMFUNC(xf86NewOption)
+ SYMFUNC(xf86NextOption)
+ SYMFUNC(xf86OptionListCreate)
+ SYMFUNC(xf86OptionListMerge)
+ SYMFUNC(xf86OptionListFree)
+ SYMFUNC(xf86OptionName)
+ SYMFUNC(xf86OptionValue)
+ SYMFUNC(xf86OptionListReport)
+ SYMFUNC(xf86SetIntOption)
+ SYMFUNC(xf86SetRealOption)
+ SYMFUNC(xf86SetStrOption)
+ SYMFUNC(xf86SetBoolOption)
+ SYMFUNC(xf86CheckIntOption)
+ SYMFUNC(xf86CheckRealOption)
+ SYMFUNC(xf86CheckStrOption)
+ SYMFUNC(xf86CheckBoolOption)
+ SYMFUNC(xf86ReplaceIntOption)
+ SYMFUNC(xf86ReplaceRealOption)
+ 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)
+ /* xf86fbman.c */
+ SYMFUNC(xf86InitFBManager)
+ SYMFUNC(xf86InitFBManagerArea)
+ SYMFUNC(xf86InitFBManagerRegion)
+ SYMFUNC(xf86InitFBManagerLinear)
+ 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)
- /* xf86cmap.c */
- SYMFUNC(xf86HandleColormaps)
+ /* xf86xv.c */
+ SYMFUNC(xf86XVScreenInit)
+ SYMFUNC(xf86XVRegisterGenericAdaptorDriver)
+ SYMFUNC(xf86XVListGenericAdaptors)
+ SYMFUNC(xf86XVRegisterOffscreenImages)
+ SYMFUNC(xf86XVQueryOffscreenImages)
+ SYMFUNC(xf86XVAllocateVideoAdaptorRec)
+ SYMFUNC(xf86XVFreeVideoAdaptorRec)
+ SYMFUNC(xf86XVFillKeyHelper)
+ SYMFUNC(xf86XVClipVideoHelper)
+ SYMFUNC(xf86XVCopyYUV12ToPacked)
+ SYMFUNC(xf86XVCopyPacked)
- /* xf86xv.c */
- SYMFUNC(xf86XVScreenInit)
- SYMFUNC(xf86XVRegisterGenericAdaptorDriver)
- SYMFUNC(xf86XVListGenericAdaptors)
- SYMFUNC(xf86XVRegisterOffscreenImages)
- SYMFUNC(xf86XVQueryOffscreenImages)
- SYMFUNC(xf86XVAllocateVideoAdaptorRec)
- SYMFUNC(xf86XVFreeVideoAdaptorRec)
- SYMFUNC(xf86XVFillKeyHelper)
- SYMFUNC(xf86XVClipVideoHelper)
+ /* xf86xvmc.c */
+ SYMFUNC(xf86XvMCScreenInit)
+ SYMFUNC(xf86XvMCCreateAdaptorRec)
+ SYMFUNC(xf86XvMCDestroyAdaptorRec)
- /* xf86xvmc.c */
- SYMFUNC(xf86XvMCScreenInit)
-
- /* xf86VidMode.c */
- SYMFUNC(VidModeExtensionInit)
+ /* 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)
+ 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 */
+ /* xf86Versions.c */
+ SYMFUNC(xf86GetBuiltinInterfaceVersion)
+ SYMFUNC(xf86RegisterBuiltinInterfaceVersion)
+
+ /* 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)
+ SYMFUNC(MiscExtGetMouseSettings)
+ SYMFUNC(MiscExtGetMouseValue)
+ SYMFUNC(MiscExtSetMouseValue)
+ SYMFUNC(MiscExtSetMouseDevice)
+ SYMFUNC(MiscExtGetKbdSettings)
+ SYMFUNC(MiscExtGetKbdValue)
+ SYMFUNC(MiscExtSetKbdValue)
+ SYMFUNC(MiscExtSetGrabKeysState)
+ SYMFUNC(MiscExtCreateStruct)
+ SYMFUNC(MiscExtDestroyStruct)
+ SYMFUNC(MiscExtApply)
+ SYMFUNC(MiscExtGetFilePaths)
+ SYMFUNC(MiscExtPassMessage)
#endif
- /* Misc */
- SYMFUNC(GetTimeInMillis)
+ /* Misc */
+ SYMFUNC(GetTimeInMillis)
- /* xf86Xinput.c */
+ /* 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)
+ 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)
+ SYMFUNC(xf86XInputSetScreen)
+ SYMFUNC(xf86ScaleAxis)
+ SYMFUNC(xf86XInputSetSendCoreEvents)
/* End merged segment */
#endif
- SYMFUNC(DPMSGet)
- SYMFUNC(DPMSSet)
- SYMFUNC(DPMSSupported)
+ SYMFUNC(DPMSGet)
+ SYMFUNC(DPMSSet)
+ SYMFUNC(DPMSSupported)
/* xf86Debug.c */
#ifdef BUILDDEBUG
- SYMFUNC(xf86Break1)
- SYMFUNC(xf86Break2)
- SYMFUNC(xf86Break3)
- SYMFUNC(xf86SPTimestamp)
- SYMFUNC(xf86STimestamp)
+ 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)
+ 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)
- /* 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)
+ /* 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)
+ /*
+ * These 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(xf86strlcat)
+ SYMFUNC(xf86strlcpy)
+ 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)
- SYMFUNC(xf86getsecs)
- SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */
+ /* non-ANSI C functions */
+ SYMFUNC(xf86opendir)
+ SYMFUNC(xf86closedir)
+ SYMFUNC(xf86readdir)
+ SYMFUNC(xf86rewinddir)
+ SYMFUNC(xf86ffs)
+ SYMFUNC(xf86strdup)
+ SYMFUNC(xf86bzero)
+ SYMFUNC(xf86usleep)
+ SYMFUNC(xf86execl)
- /* 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)
+ SYMFUNC(xf86getsecs)
+ SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */
+
+ /* Some of these were added 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)
+ SYMFUNC(xf86setjmp)
+ SYMFUNC(xf86setjmp0)
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
- SYMFUNCALIAS("xf86setjmp1",__sigsetjmp)
+ SYMFUNCALIAS("xf86setjmp1", __sigsetjmp)
#else
- SYMFUNC(xf86setjmp1) /* For libc5 */
+ SYMFUNC(xf86setjmp1) /* For libc5 */
#endif
#else
- SYMFUNCALIAS("xf86setjmp",setjmp)
- SYMFUNCALIAS("xf86setjmp0",setjmp)
- SYMFUNC(xf86setjmp1)
+ SYMFUNCALIAS("xf86setjmp", setjmp)
+ SYMFUNCALIAS("xf86setjmp0", setjmp)
+ SYMFUNC(xf86setjmp1)
#endif
- SYMFUNCALIAS("xf86longjmp",longjmp)
- SYMFUNC(xf86getjmptype)
- SYMFUNC(xf86setjmp1_arg2)
- SYMFUNC(xf86setjmperror)
+ 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)
+ /*
+ * 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)
+ SYMFUNC(_bus_base)
# endif
#endif
- SYMFUNC(xf86BlockSIGIO)
- SYMFUNC(xf86UnblockSIGIO)
-
+ SYMFUNC(xf86BlockSIGIO)
+ SYMFUNC(xf86UnblockSIGIO)
+
#if defined(__alpha__)
- SYMFUNC(__divl)
- SYMFUNC(__reml)
- SYMFUNC(__divlu)
- SYMFUNC(__remlu)
- SYMFUNC(__divq)
- SYMFUNC(__divqu)
- SYMFUNC(__remq)
- SYMFUNC(__remqu)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+#ifndef __UNIXOS2__
+ SYMFUNC(__div64)
+#endif
+ SYMFUNC(__divdf3)
+ SYMFUNC(__divdi3)
+ SYMFUNC(__divsf3)
+ SYMFUNC(__divsi3)
+ SYMFUNC(__moddi3)
+ SYMFUNC(__modsi3)
+#ifndef __UNIXOS2__
+ SYMFUNC(__mul64)
+#endif
+ 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)
+ 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)
+ SYMFUNC(outw)
+ SYMFUNC(outb)
+ SYMFUNC(outl)
+ SYMFUNC(inb)
+ SYMFUNC(inw)
+ SYMFUNC(inl)
#endif
#ifdef __FreeBSD__
- SYMFUNC(sysctlbyname)
+#if defined(__sparc__)
+ SYMFUNC(_Qp_qtos)
+ SYMFUNC(_Qp_qtod)
+ SYMFUNC(_Qp_qtoux)
+ SYMFUNC(_Qp_uitoq)
+ SYMFUNC(_Qp_dtoq)
+#endif
#endif
-/*
- * and now some variables
- */
+ /* Some variables. */
- SYMVAR(xf86stdin)
- SYMVAR(xf86stdout)
- SYMVAR(xf86stderr)
- SYMVAR(xf86errno)
- SYMVAR(xf86HUGE_VAL)
+ 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 */
+ /* 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)
+ SYMVAR(xf86p8bit)
+ SYMVAR(xf86DummyVar1)
+ SYMVAR(xf86DummyVar2)
+ SYMVAR(xf86DummyVar3)
#endif
#ifdef async
- SYMVAR(xf86CurrentScreen)
+ 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)
+ /* 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)
+ SYMVAR(ioBase)
#endif
- /* Globals from xf86Globals.c and xf86Priv.h */
- SYMVAR(xf86ConfigDRI)
+ /* Globals from xf86Globals.c and xf86Priv.h */
+ SYMVAR(xf86ConfigDRI)
- /* Globals from xf86Configure.c */
- SYMVAR(ConfiguredMonitor)
+ /* Globals from xf86Configure.c */
+ SYMVAR(ConfiguredMonitor)
- /* Pci.c */
- SYMVAR(pciNumBuses)
-
- { 0, 0 },
+ /* Pci.c */
+ SYMVAR(pciNumBuses)
+ {0, 0}
};
diff --git a/hw/xfree86/os-support/assyntax.h b/hw/xfree86/os-support/assyntax.h
index 3ae8a7940..191c7e49e 100644
--- a/hw/xfree86/os-support/assyntax.h
+++ b/hw/xfree86/os-support/assyntax.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.12 1999/12/27 00:39:46 robin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.13 2003/08/24 17:37:03 dawes Exp $ */
#ifndef __ASSYNTAX_H__
#define __ASSYNTAX_H__
@@ -23,6 +23,33 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * Copyright (c) 1993-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* $XConsortium: assyntax.h /main/5 1996/02/21 17:50:49 kaleb $ */
/*
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index d3aa25961..aa3313dc3 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -1,4 +1,4 @@
-/* $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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.5 2003/04/03 16:50:04 dawes Exp $ */
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -215,7 +215,7 @@ checkDevMem(Bool warn)
/* 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,
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
if (base != MAP_FAILED) {
@@ -235,7 +235,7 @@ checkDevMem(Bool warn)
#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,
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
if (base != MAP_FAILED) {
@@ -308,8 +308,10 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
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);
+ base = mmap((caddr_t)0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (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",
@@ -325,9 +327,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
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);
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (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",
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index 96abe2ea4..36943add1 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/arm_video.c,v 1.1 2002/08/06 13:08:38 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/arm_video.c,v 1.2 2003/03/14 13:46:03 tsi Exp $ */
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -135,7 +135,7 @@ checkDevMem(Bool warn)
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,
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
if (base != MAP_FAILED)
@@ -190,8 +190,10 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
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);
+ base = mmap((caddr_t)0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (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",
@@ -207,9 +209,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
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);
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (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",
@@ -353,7 +357,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
if((memInfoP->regionVirtBase =
mmap((caddr_t)0,
Size,
- PROT_READ|PROT_WRITE,
+ PROT_READ | PROT_WRITE,
MAP_SHARED,
xf86Info.screenFd,
(unsigned long)mapInfoP->u.map_info_mmap.map_offset))
@@ -485,7 +489,7 @@ xf86EnableIO()
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,
+ base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0x0000);
if (base != (pointer)-1) {
@@ -571,7 +575,7 @@ int ScreenNum;
#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,
+ base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0x0000);
if (base != (pointer)-1) {
@@ -613,7 +617,7 @@ int ScreenNum;
if (devMemFd >= 0 && useDevMem)
{
- base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ|PROT_WRITE,
+ base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ | PROT_WRITE,
MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE);
if (base != (pointer)-1)
diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c
index f999561cf..6c675b5da 100644
--- a/hw/xfree86/os-support/bsd/bsdResource.c
+++ b/hw/xfree86/os-support/bsd/bsdResource.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.8 2002/05/22 21:38:29 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.9 2003/10/02 13:30:06 eich Exp $ */
/* Resource information code */
@@ -18,7 +18,7 @@ resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
#ifdef INCLUDE_XF86_NO_DOMAIN
-#if defined(__alpha__) || defined(__sparc64__)
+#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__)
resPtr
xf86BusAccWindowsFromOS(void)
diff --git a/hw/xfree86/os-support/bsd/bsd_axp.c b/hw/xfree86/os-support/bsd/bsd_axp.c
index c38ac073c..91367078e 100644
--- a/hw/xfree86/os-support/bsd/bsd_axp.c
+++ b/hw/xfree86/os-support/bsd/bsd_axp.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c,v 1.2 2002/10/29 23:19:13 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c,v 1.3 2003/10/07 22:33:37 herrb Exp $ */
#include "X.h"
#include "os.h"
@@ -23,9 +23,9 @@ axpDevice bsdGetAXP(void);
typedef struct {
char *name;
int type;
-} AXP;
+} _AXP;
-static AXP axpList[] = {
+static _AXP axpList[] = {
{"apecs",APECS},
{"pyxis",PYXIS},
{"cia",CIA},
diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c
index 236b6ffbb..e4927d91a 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c,v 3.19 2002/05/05 18:54:02 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c,v 3.22 2003/10/07 23:14:55 herrb Exp $ */
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -38,8 +38,10 @@
static Bool KeepTty = FALSE;
static int devConsoleFd = -1;
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
static int VTnum = -1;
static int initialVT = -1;
+#endif
#ifdef PCCONS_SUPPORT
/* Stock 0.1 386bsd pccons console driver interface */
@@ -146,10 +148,10 @@ void
xf86OpenConsole()
{
int i, fd = -1;
- int result;
- struct utsname uts;
xf86ConsOpen_t *driver;
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ int result;
+ struct utsname uts;
vtmode_t vtmode;
#endif
@@ -158,7 +160,7 @@ xf86OpenConsole()
/* check if we are run with euid==0 */
if (geteuid() != 0)
{
- FatalError("xf86OpenConsole: Server must be suid root\n");
+ FatalError("xf86OpenConsole: Server must be suid root");
}
if (!KeepTty)
@@ -196,7 +198,7 @@ xf86OpenConsole()
strcat(cons_drivers, supported_drivers[i]);
}
FatalError(
- "%s: No console driver found\n\tSupported drivers: %s\n\t%s\n",
+ "%s: No console driver found\n\tSupported drivers: %s\n\t%s",
"xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG);
}
#if 0 /* stdin is already closed in OsInit() */
@@ -211,7 +213,7 @@ xf86OpenConsole()
case PCCONS:
if (ioctl (xf86Info.consoleFd, CONSOLE_X_MODE_ON, 0) < 0)
{
- FatalError("%s: CONSOLE_X_MODE_ON failed (%s)\n%s\n",
+ FatalError("%s: CONSOLE_X_MODE_ON failed (%s)\n%s",
"xf86OpenConsole", strerror(errno),
CHECK_DRIVER_MSG);
}
@@ -280,18 +282,18 @@ acquire_vt:
vtmode.frsig = SIGUSR1;
if (ioctl(xf86Info.consoleFd, VT_SETMODE, &vtmode) < 0)
{
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed");
}
#if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
if (ioctl(xf86Info.consoleFd, KDENABIO, 0) < 0)
{
- FatalError("xf86OpenConsole: KDENABIO failed (%s)\n",
+ FatalError("xf86OpenConsole: KDENABIO failed (%s)",
strerror(errno));
}
#endif
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
{
- FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
+ FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
}
break;
#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
@@ -335,7 +337,7 @@ xf86OpenPccons()
if (ioctl(fd, CONSOLE_X_MODE_OFF, 0) < 0)
{
FatalError(
- "%s: CONSOLE_X_MODE_OFF failed (%s)\n%s\n%s\n",
+ "%s: CONSOLE_X_MODE_OFF failed (%s)\n%s\n%s",
"xf86OpenPccons",
strerror(errno),
"Was expecting pccons driver with X support",
@@ -425,11 +427,11 @@ xf86OpenSyscons()
{
if (syscons_version >= 0x100)
{
- FatalError("%s: Cannot find a free VT\n",
+ FatalError("%s: Cannot find a free VT",
"xf86OpenSyscons");
}
/* Should no longer reach here */
- FatalError("%s: %s %s\n\t%s %s\n",
+ FatalError("%s: %s %s\n\t%s %s",
"xf86OpenSyscons",
"syscons versions prior to 1.0 require",
"either the",
@@ -448,18 +450,18 @@ xf86OpenSyscons()
#endif
if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0)
{
- FatalError("xf86OpenSyscons: Cannot open %s (%s)\n",
+ FatalError("xf86OpenSyscons: Cannot open %s (%s)",
vtname, strerror(errno));
}
if (ioctl(fd, VT_GETMODE, &vtmode) < 0)
{
- FatalError("xf86OpenSyscons: VT_GETMODE failed\n");
+ FatalError("xf86OpenSyscons: VT_GETMODE failed");
}
xf86Info.consType = SYSCONS;
xf86Msg(X_PROBED, "Using syscons driver with X support");
if (syscons_version >= 0x100)
{
- xf86ErrorF(" (version %d.%d)\n", syscons_version >> 8,
+ xf86ErrorF(" (version %ld.%ld)\n", syscons_version >> 8,
syscons_version & 0xFF);
}
else
@@ -513,7 +515,7 @@ xf86OpenPcvt()
{
if(ioctl(fd, VT_GETMODE, &vtmode) < 0)
{
- FatalError("%s: VT_GETMODE failed\n%s%s\n%s\n",
+ FatalError("%s: VT_GETMODE failed\n%s%s\n%s",
"xf86OpenPcvt",
"Found pcvt driver but X11 seems to be",
" not supported.", CHECK_DRIVER_MSG);
@@ -552,7 +554,7 @@ xf86OpenPcvt()
}
else
{
- FatalError("%s: Cannot find a free VT\n",
+ FatalError("%s: Cannot find a free VT",
"xf86OpenPcvt");
}
}
@@ -562,12 +564,12 @@ xf86OpenPcvt()
sprintf(vtname, "%s%01x", vtprefix, xf86Info.vtno - 1);
if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0)
{
- FatalError("xf86OpenPcvt: Cannot open %s (%s)\n",
+ FatalError("xf86OpenPcvt: Cannot open %s (%s)",
vtname, strerror(errno));
}
if (ioctl(fd, VT_GETMODE, &vtmode) < 0)
{
- FatalError("xf86OpenPcvt: VT_GETMODE failed\n");
+ FatalError("xf86OpenPcvt: VT_GETMODE failed");
}
xf86Info.consType = PCVT;
#ifdef WSCONS_SUPPORT
@@ -614,7 +616,7 @@ xf86OpenWScons()
}
if (fd != -1) {
if (ioctl(fd, WSDISPLAYIO_SMODE, &mode) < 0) {
- FatalError("%s: WSDISPLAYIO_MODE_MAPPED failed (%s)\n%s\n",
+ FatalError("%s: WSDISPLAYIO_MODE_MAPPED failed (%s)\n%s",
"xf86OpenConsole", strerror(errno),
CHECK_DRIVER_MSG);
}
@@ -652,7 +654,7 @@ xf86CloseConsole()
#if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0)
{
- xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)\n",
+ xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
strerror(errno));
}
#endif
@@ -676,7 +678,7 @@ xf86CloseConsole()
close(xf86Info.consoleFd);
if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0)
{
- xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)\n",
+ xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)",
strerror(errno));
}
}
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.c b/hw/xfree86/os-support/bsd/bsd_kbd.c
index 20d8b04d4..0d586ef72 100644
--- a/hw/xfree86/os-support/bsd/bsd_kbd.c
+++ b/hw/xfree86/os-support/bsd/bsd_kbd.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.5 2003/02/17 15:11:56 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.8 2003/11/04 03:16:58 tsi Exp $ */
/*
* Copyright (c) 2002 by The XFree86 Project, Inc.
@@ -33,7 +33,7 @@ static KbdProtocolRec protocols[] = {
#ifdef WSCONS_SUPPORT
{"wskbd", PROT_WSCONS },
#endif
- { NULL, PROT_UNKNOWN }
+ { NULL, PROT_UNKNOWN_KBD }
};
typedef struct {
@@ -143,8 +143,10 @@ static int
KbdOn(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
struct termios nTty;
+#endif
#ifdef WSCONS_SUPPORT
int option;
#endif
@@ -406,7 +408,7 @@ OpenKeyboard(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
int i;
- KbdProtocolId prot = PROT_UNKNOWN;
+ KbdProtocolId prot = PROT_UNKNOWN_KBD;
char *s;
s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c
index f681d90d9..943bb9855 100644
--- a/hw/xfree86/os-support/bsd/bsd_mouse.c
+++ b/hw/xfree86/os-support/bsd/bsd_mouse.c
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.24 2003/02/15 05:37:59 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.26 2003/10/10 20:56:05 herrb Exp $ */
/*
- * Copyright 1999 by The XFree86 Project, Inc.
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
#include "X.h"
@@ -45,6 +68,20 @@
static void usbSigioReadInput (int fd, void *closure);
#endif
+#if defined(__FreeBSD__)
+/* These are for FreeBSD */
+#define DEFAULT_MOUSE_DEV "/dev/mouse"
+#define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse"
+#define DEFAULT_PS2_DEV "/dev/psm0"
+
+static const char *mouseDevs[] = {
+ DEFAULT_MOUSE_DEV,
+ DEFAULT_SYSMOUSE_DEV,
+ DEFAULT_PS2_DEV,
+ NULL
+};
+#endif
+
static int
SupportedInterfaces(void)
{
@@ -196,6 +233,98 @@ SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
}
#endif
+#if defined(__FreeBSD__)
+
+#define MOUSED_PID_FILE "/var/run/moused.pid"
+
+/*
+ * Try to check if moused is running. DEFAULT_SYSMOUSE_DEV is useless without
+ * it. There doesn't seem to be a better way of checking.
+ */
+static Bool
+MousedRunning(void)
+{
+ FILE *f = NULL;
+ unsigned int pid;
+
+ if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) {
+ if (fscanf(f, "%u", &pid) == 1 && pid > 0) {
+ if (kill(pid, 0) == 0) {
+ fclose(f);
+ return TRUE;
+ }
+ }
+ fclose(f);
+ }
+ return FALSE;
+}
+
+static const char *
+FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ int fd = -1;
+ const char **pdev, *dev = NULL;
+ Bool devMouse = FALSE;
+ struct stat devMouseStat;
+ struct stat sb;
+
+ for (pdev = mouseDevs; *pdev; pdev++) {
+ SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK));
+ if (fd == -1) {
+#ifdef DEBUG
+ ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
+#endif
+ } else {
+ /*
+ * /dev/mouse is held until checks for matches with other devices
+ * are done. This is so that when it points to /dev/sysmouse,
+ * the test for whether /dev/sysmouse is usable can be made.
+ */
+ if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
+ if (fstat(fd, &devMouseStat) == 0)
+ devMouse = TRUE;
+ close(fd);
+ continue;
+ } else if (!strcmp(*pdev, DEFAULT_SYSMOUSE_DEV)) {
+ /* Check if /dev/mouse is the same as /dev/sysmouse. */
+ if (devMouse && fstat(fd, &sb) == 0 &&
+ devMouseStat.st_dev == sb.st_dev &&
+ devMouseStat.st_ino == sb.st_ino) {
+ /* If the same, use /dev/sysmouse. */
+ devMouse = FALSE;
+ }
+ close(fd);
+ if (MousedRunning())
+ break;
+ else {
+#ifdef DEBUG
+ ErrorF("moused isn't running\n");
+#endif
+ }
+ } else {
+ close(fd);
+ break;
+ }
+ }
+ }
+
+ if (*pdev)
+ dev = *pdev;
+ else if (devMouse)
+ dev = DEFAULT_MOUSE_DEV;
+
+ if (dev) {
+ /* Set the Device option. */
+ pInfo->conf_idev->commonOptions =
+ xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", dev);
+ xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
+ pInfo->name, dev);
+ }
+
+ return *pdev;
+}
+#endif
+
#if defined(WSCONS_SUPPORT)
#define NUMEVENTS 64
@@ -502,11 +631,11 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
#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");
+ xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
}
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");
+ xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
}
if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
@@ -514,11 +643,11 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
#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");
+ xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
}
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");
+ xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
}
if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
hid_input, &pUsbMse->loc_z) < 0) {
@@ -589,6 +718,9 @@ xf86OSMouseInit(int flags)
p->SetBMRes = SetSysMouseRes;
p->SetMiscRes = SetSysMouseRes;
#endif
+#if defined(__FreeBSD__)
+ p->FindDevice = FindDevice;
+#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
index 3c056ce55..75c8f8200 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c,v 1.2 2002/09/10 15:53:31 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c,v 1.5 2003/10/07 23:14:55 herrb Exp $ */
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -62,11 +62,11 @@
#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"
+ "\trefer to xf86(4) for details"
#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"
+ "\trefer to xf86(4) for details"
#endif
/***************************************************************************/
@@ -114,7 +114,7 @@ checkDevMem(Bool warn)
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,
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0xA0000);
if (base != MAP_FAILED)
@@ -147,7 +147,7 @@ checkDevMem(Bool warn)
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,
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
MAP_FLAGS, fd, (off_t)0xA0000);
if (base != MAP_FAILED)
@@ -220,14 +220,16 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
if (devMemFd < 0)
{
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ FatalError("xf86MapVidMem: failed to open %s (%s)",
DEV_MEM, strerror(errno));
}
- base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE,
- MAP_FLAGS, devMemFd, (off_t)Base);
+ base = mmap((caddr_t)0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (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",
+ FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)",
"xf86MapVidMem", DEV_MEM, Size, Base,
strerror(errno));
}
@@ -237,16 +239,18 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
/* else, mmap /dev/vga */
if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
{
- FatalError("%s: Address 0x%x outside allowable range\n",
+ FatalError("%s: Address 0x%lx outside allowable range",
"xf86MapVidMem", Base);
}
- base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS,
- xf86Info.screenFd,
- (unsigned long)Base - 0xA0000
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (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",
+ FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)",
strerror(errno));
}
return(base);
@@ -284,7 +288,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
if ((long)ptr == -1)
{
xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
+ "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
DEV_MEM, Len, Base, Offset, strerror(errno));
#ifdef __OpenBSD__
if (Base < 0xa0000) {
@@ -324,7 +328,7 @@ xf86EnableIO()
if (i386_iopl(TRUE) < 0)
{
#ifndef __OpenBSD__
- FatalError("%s: Failed to set IOPL for extended I/O\n",
+ FatalError("%s: Failed to set IOPL for extended I/O",
"xf86EnableIO");
#else
FatalError("%s: Failed to set IOPL for extended I/O\n%s",
@@ -362,7 +366,7 @@ xf86EnableIO()
if ((IoFd = open("/dev/io", O_RDWR)) == -1)
{
FatalError("xf86EnableIO: "
- "Failed to open /dev/io for extended I/O\n");
+ "Failed to open /dev/io for extended I/O");
}
return;
}
@@ -435,7 +439,7 @@ xf86SetTVOut(int mode)
#endif /* PCCONS_SUPPORT */
default:
- FatalError("Xf86SetTVOut: Unsupported console\n");
+ FatalError("Xf86SetTVOut: Unsupported console");
break;
}
return;
@@ -460,7 +464,7 @@ xf86SetRGBOut()
#endif /* PCCONS_SUPPORT */
default:
- FatalError("Xf86SetTVOut: Unsupported console\n");
+ FatalError("Xf86SetTVOut: Unsupported console");
break;
}
return;
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index 4ec7045e8..3e4ff9ee7 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.3 2002/11/09 17:28:08 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.6 2003/10/07 23:14:55 herrb Exp $ */
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -44,7 +44,11 @@
/* Video Memory Mapping section */
/***************************************************************************/
+#ifndef __OpenBSD__
#define DEV_MEM "/dev/mem"
+#else
+#define DEV_MEM "/dev/xf86"
+#endif
static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags);
static void ppcUnmapVidMem(int, pointer, unsigned long);
@@ -71,9 +75,12 @@ ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
Base, Size, fd);
#endif
- base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, Base);
if (base == MAP_FAILED)
- FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)\n",
+ FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
"xf86MapVidMem", Size, Base, strerror(errno));
return base;
@@ -93,9 +100,9 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
static int kmem = -1;
if (kmem == -1) {
- kmem = open("/dev/xf86", 2);
+ kmem = open(DEV_MEM, 2);
if (kmem == -1) {
- FatalError("xf86ReadBIOS: open /dev/xf86\n");
+ FatalError("xf86ReadBIOS: open %s", DEV_MEM);
}
}
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
index 877550154..fe301acf5 100644
--- a/hw/xfree86/os-support/bsd/sparc64_video.c
+++ b/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/sparc64_video.c,v 1.1 2002/08/06 13:08:39 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/sparc64_video.c,v 1.3 2003/10/07 23:14:55 herrb Exp $ */
/*
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -66,9 +66,12 @@ sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
Base, Size, fd);
#endif
- base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, Base);
if (base == MAP_FAILED)
- FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)\n",
+ FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
"xf86MapVidMem", Size, Base, strerror(errno));
return base;
}
diff --git a/hw/xfree86/os-support/bus/460gxPCI.c b/hw/xfree86/os-support/bus/460gxPCI.c
index 4840fd144..3b16f401a 100644
--- a/hw/xfree86/os-support/bus/460gxPCI.c
+++ b/hw/xfree86/os-support/bus/460gxPCI.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v 1.2 2003/01/10 22:05:45 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v 1.4 2003/08/29 21:08:06 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -122,7 +122,7 @@ Control460GXBridge(int bus, CARD16 mask, CARD16 value)
* host bridges.
*/
static void
-Get460GXBridgeBusses(int bus, int *primary, int *secondary, int *subordinate)
+Get460GXBridgeBuses(int bus, int *primary, int *secondary, int *subordinate)
{
pciConfigPtr pPCI = Verify460GXBus(bus);
int i;
@@ -217,7 +217,7 @@ xf86PreScan460GX(void)
/* 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)) {
+ if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
cbn_460gx = -1;
return FALSE;
}
@@ -239,7 +239,7 @@ xf86PreScan460GX(void)
}
tag = PCI_MAKE_TAG(cbn_460gx, 0, 0);
- if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 460GX_SAC)) {
+ if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
/* Sanity check failed */
cbn_460gx = -1;
return TRUE;
@@ -253,7 +253,8 @@ xf86PreScan460GX(void)
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)) {
+ if (pciReadLong(tag, PCI_ID_REG) !=
+ DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) {
/* Sanity check failed */
cbn_460gx = -1;
return TRUE;
@@ -272,8 +273,8 @@ xf86PreScan460GX(void)
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):
+ case DEVID(VENDOR_INTEL, CHIP_460GX_PXB):
+ case DEVID(VENDOR_INTEL, CHIP_460GX_WXB):
if (cbdevs_460gx & (1 << devno)) {
/* Sanity check failed */
cbn_460gx = -1;
@@ -289,7 +290,7 @@ xf86PreScan460GX(void)
has_err_460gx[i] = 1;
break;
- case DEVID(INTEL, 460GX_GXB_1):
+ case DEVID(VENDOR_INTEL, CHIP_460GX_GXB_1):
if (cbdevs_460gx & (1 << devno)) {
/* Sanity check failed */
cbn_460gx = -1;
@@ -323,7 +324,7 @@ xf86PreScan460GX(void)
}
/*
- * The 460GX spec says that any access to busses higher than CBN will be
+ * The 460GX spec says that any access to buses 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.
@@ -353,7 +354,7 @@ xf86PostScan460GX(void)
/* Set up our extra bus functions */
BusFuncs_460gx = *(pciBusInfo[0]->funcs);
BusFuncs_460gx.pciControlBridge = Control460GXBridge;
- BusFuncs_460gx.pciGetBridgeBusses = Get460GXBridgeBusses;
+ BusFuncs_460gx.pciGetBridgeBuses = Get460GXBridgeBuses;
BusFuncs_460gx.pciGetBridgeResources = Get460GXBridgeResources;
/*
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index c7777827d..a0b639143 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.71.2.2 2003/05/06 17:00:45 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.81 2003/09/24 02:43:34 dawes Exp $ */
/*
* Pci.c - New server PCI access functions
*
@@ -19,8 +19,6 @@
* 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
@@ -170,6 +168,33 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
#include <errno.h>
#include <signal.h>
#include "Xarch.h"
@@ -376,7 +401,7 @@ pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val)
pciInit();
if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
- pciBusInfo[bus]->funcs->pciReadLong) {
+ pciBusInfo[bus]->funcs->pciSetBitsLong) {
(*pciBusInfo[bus]->funcs->pciSetBitsLong)(tag, offset, mask, val);
}
}
@@ -393,27 +418,6 @@ pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val)
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)
{
@@ -551,11 +555,7 @@ pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min)
}
/* 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)
@@ -569,6 +569,8 @@ pciTag(int busnum, int devnum, int funcnum)
return(PCI_MAKE_TAG(busnum,devnum,funcnum));
}
+#if defined(PCI_MFDEV_SUPPORT) || defined(PowerMAX_OS)
+
Bool
pciMfDev(int busnum, int devnum)
{
@@ -579,7 +581,7 @@ pciMfDev(int busnum, int devnum)
tag0 = PCI_MAKE_TAG(busnum, devnum, 0);
id0 = pciReadLong(tag0, PCI_ID_REG);
- if (id0 == 0xffffffff)
+ if ((CARD16)(id0 + 1) <= (CARD16)1UL)
return FALSE;
val = pciReadLong(tag0, PCI_HEADER_MISC) & 0x00ff0000;
@@ -594,10 +596,15 @@ pciMfDev(int busnum, int devnum)
*/
tag1 = PCI_MAKE_TAG(busnum, devnum, 1);
id1 = pciReadLong(tag1, PCI_ID_REG);
- if (id1 == 0xffffffff || id1 == 0x00000000)
+ if ((CARD16)(id1 + 1) <= (CARD16)1UL)
+ return FALSE;
+
+ /* Vendor IDs should match */
+ if ((id0 ^ id1) & 0x0000ffff)
return FALSE;
if ((id0 != id1) ||
+ /* Note the following test is valid for header types 0, 1 and 2 */
(pciReadLong(tag0, PCI_MAP_REG_START) !=
pciReadLong(tag1, PCI_MAP_REG_START)))
return TRUE;
@@ -605,6 +612,8 @@ pciMfDev(int busnum, int devnum)
return FALSE;
}
+#endif
+
/*
* Generic find/read/write functions
*/
@@ -678,6 +687,7 @@ pciGenFindNext(void)
* No more devices for this bus. Next bus please
*/
if (speculativeProbe) {
+ NextSpeculativeBus:
xfree(pciBusInfo[pciBusNum]);
pciBusInfo[pciBusNum] = NULL;
speculativeProbe = FALSE;
@@ -715,7 +725,7 @@ pciGenFindNext(void)
#endif
pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum);
inProbe = TRUE;
- devid = pciReadLong(pciDeviceTag, 0);
+ devid = pciReadLong(pciDeviceTag, PCI_ID_REG);
inProbe = FALSE;
#ifdef DEBUGPCI
ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid);
@@ -723,18 +733,36 @@ pciGenFindNext(void)
if ((CARD16)(devid + 1U) <= (CARD16)1UL)
continue; /* Nobody home. Next device please */
+ /*
+ * Some devices mis-decode configuration cycles in such a way as to
+ * create phantom buses.
+ */
+ if (speculativeProbe && (pciDevNum == 0) && (pciFuncNum == 0) &&
+ (PCI_BUS_NO_DOMAIN(pciBusNum) > 0)) {
+ for (;;) {
+ if (++pciDevNum >= pciBusInfo[pciBusNum]->numDevices)
+ goto NextSpeculativeBus;
+ if (devid !=
+ pciReadLong(PCI_MAKE_TAG(pciBusNum, pciDevNum, 0),
+ PCI_ID_REG))
+ break;
+ }
+
+ pciDevNum = 0;
+ }
+
if (pciNumBuses <= pciBusNum)
pciNumBuses = pciBusNum + 1;
speculativeProbe = FALSE;
previousBus = pciBusNum;
+#ifdef PCI_BRIDGE_SUPPORT
/*
* 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);
@@ -754,7 +782,7 @@ pciGenFindNext(void)
(sub_class != PCI_SUBCLASS_BRIDGE_CARDBUS))
xf86Msg(X_WARNING,
"pciGenFindNext: primary bus mismatch on PCI"
- " bridge 0x%08x (0x%02x, 0x%02x)\n",
+ " bridge 0x%08lx (0x%02x, 0x%02x)\n",
pciDeviceTag, pciBusNum, pri_bus);
pri_bus = pciBusNum;
}
@@ -970,12 +998,6 @@ xf86scanpci(int flags)
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;
@@ -1115,7 +1137,7 @@ xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag, ADDRESS Base,
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=0x%lx,hostbase=0x%lx,size=%lx] (%s)\n",
Base, hostbase, Size, strerror(errno));
}
/*
@@ -1165,8 +1187,8 @@ handlePciBIOS(PCITAG Tag, int basereg,
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));
+ (int)PCI_BUS_FROM_TAG(Tag), (int)PCI_DEV_FROM_TAG(Tag),
+ (int)PCI_FUNC_FROM_TAG(Tag));
pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
(CARD32)~0);
}
@@ -1275,7 +1297,7 @@ readPciBios(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer args)
}
if ((rd->Offset) > (image_length)) {
xf86Msg(X_WARNING,"xf86ReadPciBios: requesting data past "
- "end of BIOS %i > %i\n",(rd->Offset) , (image_length));
+ "end of BIOS %li > %i\n",(rd->Offset) , (image_length));
} else {
if ((rd->Offset + rd->Len) > (image_length)) {
rd->Len = (image_length) - rd->Offset;
@@ -1299,7 +1321,7 @@ getPciBIOSTypes(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer 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 char data[0x16];
unsigned int i_length;
if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data)
@@ -1359,22 +1381,20 @@ HandlePciBios(PCITAG Tag, int basereg,
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));
+ Acc1 = pciReadLong(Tag, PCI_CMD_STAT_REG);
+ pciWriteLong(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));
+ Acc2 = pciReadLong(pTag[i], PCI_CMD_STAT_REG);
+ pciWriteLong(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);
+ pciWriteLong(pTag[i], PCI_CMD_STAT_REG, Acc2);
if (n)
break;
}
- ((WriteProcPtr)(pciLongFunc(Tag,WRITE)))(Tag,PCI_CMD_STAT_REG,Acc1);
+ pciWriteLong(Tag, PCI_CMD_STAT_REG, Acc1);
return n;
}
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index 8fb421b34..74ca95baf 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.36.2.1 2003/03/21 22:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.44 2003/11/07 23:57:47 dawes Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
@@ -69,6 +69,33 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/*
* This file has the private Pci definitions. The public ones are imported
@@ -98,7 +125,7 @@
#endif
#define DEVID(vendor, device) \
- ((CARD32)((PCI_CHIP_##device << 16) | PCI_VENDOR_##vendor))
+ ((CARD32)((PCI_##device << 16) | PCI_##vendor))
#ifndef PCI_DOM_MASK
# define PCI_DOM_MASK 0x0ffu
@@ -228,11 +255,14 @@
# define ARCH_PCI_INIT linuxPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
+# elif defined(FreeBSD)
+# define ARCH_PCI_INIT freebsdPciInit
+# 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)
@@ -289,14 +319,20 @@
# elif defined(sun)
# define ARCH_PCI_INIT sparcPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
-# elif defined(__OpenBSD__) && defined(__sparc64__)
+# elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && 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
+# if !defined(__FreeBSD__)
+# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
+# endif
+#elif defined(__AMD64__)
+# if defined(__FreeBSD__)
+# define ARCH_PCI_INIT freebsdPciInit
+# else
+# define ARCH_PCI_INIT ix86PciInit
+# endif
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
# if defined(linux)
@@ -313,10 +349,6 @@ extern void ARCH_PCI_INIT(void);
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
@@ -344,7 +376,7 @@ typedef struct pci_bus_funcs {
* to be performed generically.
*/
CARD16 (*pciControlBridge)(int, CARD16, CARD16);
- void (*pciGetBridgeBusses)(int, int *, int *, int *);
+ void (*pciGetBridgeBuses)(int, int *, int *, int *);
/* Use pointer's to avoid #include recursion */
void (*pciGetBridgeResources)(int, pointer *, pointer *, pointer *);
} pciBusFuncs_t, *pciBusFuncs_p;
diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
index c730c1559..57262efa2 100644
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -20,7 +20,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c,v 1.4 2003/10/02 13:30:06 eich Exp $ */
#include <fcntl.h>
#include <stdio.h>
@@ -170,6 +170,8 @@ promIsP1275(void)
promP1275 = TRUE;
else
promP1275 = FALSE;
+#elif defined(__FreeBSD__)
+ promP1275 = TRUE;
#else
#error Missing promIsP1275() function for this OS
#endif
@@ -554,6 +556,9 @@ pointer
xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
{
pointer ret;
+ unsigned long pagemask = xf86getpagesize() - 1;
+ unsigned long off = offset & ~pagemask;
+ unsigned long len = ((offset + size + pagemask) & ~pagemask) - off;
if (psdp->fd == -1) {
psdp->fd = open(psdp->device, O_RDWR);
@@ -562,22 +567,26 @@ xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
} else if (psdp->fd < 0)
return NULL;
- ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
- psdp->fd, offset);
+ ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ psdp->fd, off);
if (ret == (pointer) -1) {
- ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
- psdp->fd, offset);
+ ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED,
+ psdp->fd, off);
}
if (ret == (pointer) -1)
return NULL;
- return ret;
+ return (char *)ret + (offset - off);
}
void
xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size)
{
- munmap (addr, size);
+ unsigned long mask = xf86getpagesize() - 1;
+ unsigned long base = (unsigned long)addr & ~mask;
+ unsigned long len = (((unsigned long)addr + size + mask) & ~mask) - base;
+
+ munmap ((pointer)base, len);
}
/* Tell OS that we are driving the HW cursor ourselves. */
diff --git a/hw/xfree86/os-support/bus/e8870PCI.c b/hw/xfree86/os-support/bus/e8870PCI.c
index 829de03c0..adbd189f1 100644
--- a/hw/xfree86/os-support/bus/e8870PCI.c
+++ b/hw/xfree86/os-support/bus/e8870PCI.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v 1.2 2003/07/17 15:08:22 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -40,7 +40,7 @@ xf86PreScanE8870(void)
/* Look for an E8870's Hub interface */
tag = PCI_MAKE_TAG(0, 0x1E, 0);
- if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 82801_P2P))
+ if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_82801_P2P))
return FALSE;
/* XXX Fill me in... */
diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c
index c3e621daf..06baa69ea 100644
--- a/hw/xfree86/os-support/bus/freebsdPci.c
+++ b/hw/xfree86/os-support/bus/freebsdPci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c,v 1.5 2002/08/27 22:07:07 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c,v 1.6 2003/10/02 13:30:07 eich Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
@@ -84,7 +84,7 @@ static pciBusInfo_t freebsdPci0 = {
/* bridge */ NULL
};
-#if !defined(__OpenBSD__)
+#if !defined(__OpenBSD__) && !defined(__FreeBSD__)
#if X_BYTE_ORDER == X_BIG_ENDIAN
#ifdef __sparc__
#ifndef ASI_PL
diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c
index e07f5497c..b135d0b73 100644
--- a/hw/xfree86/os-support/bus/ix86Pci.c
+++ b/hw/xfree86/os-support/bus/ix86Pci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.18 2003/01/27 00:01:44 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.25 2003/09/24 02:43:34 dawes Exp $ */
/*
* ix86Pci.c - x86 PCI driver
*
@@ -109,6 +109,33 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
#include <stdio.h>
#include "compiler.h"
#include "xf86.h"
@@ -318,8 +345,9 @@ void ix86PciSelectCfgmech(void)
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);
+ "PCI: stages = 0x%02x, oldVal1 = 0x%08lx, mode1Res1"
+ " = 0x%08lx\n", stages, (unsigned long)oldVal1,
+ (unsigned long)mode1Res1);
return;
}
@@ -372,9 +400,10 @@ void ix86PciSelectCfgmech(void)
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);
+ "PCI: stages = 0x%02x, oldVal1 = 0x%08lx,\n"
+ "\tmode1Res1 = 0x%08lx, mode1Res2 = 0x%08lx\n",
+ stages, (unsigned long)oldVal1,
+ (unsigned long)mode1Res1, (unsigned long)mode1Res2);
return;
}
@@ -388,9 +417,10 @@ void ix86PciSelectCfgmech(void)
}
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);
+ xf86MsgVerb(X_INFO, 3, "PCI: stages = 0x%02x, oldVal1 = 0x%08lx,\n"
+ "\tmode1Res1 = 0x%08lx, mode1Res2 = 0x%08lx\n",
+ stages, (unsigned long)oldVal1, (unsigned long)mode1Res1,
+ (unsigned long)mode1Res2);
/* Try config type 2 */
oldVal2 = inb(PCI_CFGMECH2_ENABLE_REG);
@@ -656,35 +686,3 @@ ix86PciInit()
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/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c
index 637bd7021..9c46ee3d3 100644
--- a/hw/xfree86/os-support/bus/netbsdPci.c
+++ b/hw/xfree86/os-support/bus/netbsdPci.c
@@ -1,5 +1,6 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.4 2003/08/24 17:37:04 dawes Exp $ */
/*
- * Copyright (C) 1994-2002 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) 1994-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
@@ -25,7 +26,6 @@
* 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>
@@ -60,10 +60,6 @@ static pciBusInfo_t netbsdPci0 = {
/* numDevices */ 32,
/* secondary */ FALSE,
/* primary_bus */ 0,
-#ifdef PowerMAX_OS
-/* io_base */ 0,
-/* io_size */ 0,
-#endif
/* funcs */ &netbsdFuncs0,
/* pciBusPriv */ NULL,
/* bridge */ NULL
@@ -72,6 +68,7 @@ static pciBusInfo_t netbsdPci0 = {
void
netbsdPciInit()
{
+ struct pciio_businfo pci_businfo;
devpci = open("/dev/pci0", O_RDWR);
if (devpci == -1)
@@ -81,6 +78,10 @@ netbsdPciInit()
pciBusInfo[0] = &netbsdPci0;
pciFindFirstFP = pciGenFindFirst;
pciFindNextFP = pciGenFindNext;
+ /* use businfo to get the number of devs */
+ if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0)
+ FatalError("netbsdPciInit: not a PCI bus device");
+ netbsdPci0.numDevices = pci_businfo.maxdevs;
}
static CARD32
diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c
index 24bbec44c..2ada6fd47 100644
--- a/hw/xfree86/os-support/bus/sparcPci.c
+++ b/hw/xfree86/os-support/bus/sparcPci.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c,v 1.12 2003/01/02 18:11:32 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c,v 1.14 2003/08/24 17:37:04 dawes Exp $ */
/*
- * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
+ * Copyright (C) 2001-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
@@ -852,7 +852,7 @@ simbaVerifyBus(int bus)
pciConfigPtr pPCI;
if ((bus < 0) || (bus >= pciNumBuses) ||
!pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
- (pPCI->pci_device_vendor != DEVID(SUN, SIMBA)))
+ (pPCI->pci_device_vendor != DEVID(VENDOR_SUN, CHIP_SIMBA)))
return NULL;
return pPCI;
@@ -1012,7 +1012,7 @@ void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI)
pciBusInfo_t *pBusInfo;
CARD16 pcicommand;
- if (pPCI->pci_device_vendor != DEVID(SUN, SIMBA))
+ if (pPCI->pci_device_vendor != DEVID(VENDOR_SUN, CHIP_SIMBA))
return;
pBusInfo = pPCI->businfo;
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index 3ffc7d544..f2b5c0727 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.36.2.1 2003/03/21 22:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.39 2003/08/24 17:37:05 dawes Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
@@ -69,6 +69,33 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/*
* This file contains just the public interface to the PCI code.
@@ -638,12 +665,6 @@ typedef struct pci_device {
} pciDevice, *pciConfigPtr;
typedef enum {
- WRITE,
- READ,
- SET_BITS
-} pciFunc;
-
-typedef enum {
PCI_MEM,
PCI_MEM_SIZE,
PCI_MEM_SPARSE_BASE,
@@ -744,7 +765,6 @@ 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);
diff --git a/hw/xfree86/os-support/bus/xf86Sbus.h b/hw/xfree86/os-support/bus/xf86Sbus.h
index 5c8acfd4b..1f5f03bd2 100644
--- a/hw/xfree86/os-support/bus/xf86Sbus.h
+++ b/hw/xfree86/os-support/bus/xf86Sbus.h
@@ -20,7 +20,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.6 2003/10/02 13:30:07 eich Exp $ */
#ifndef _XF86_SBUS_H
#define _XF86_SBUS_H
@@ -35,7 +35,13 @@
#elif defined(__OpenBSD__) && defined(__sparc64__)
/* XXX */
#elif defined(CSRG_BASED)
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/fbio.h>
+#include <dev/ofw/openpromio.h>
+#else
#include <machine/fbio.h>
+#endif
#else
#include <sun/fbio.h>
#endif
diff --git a/hw/xfree86/os-support/bus/zx1PCI.c b/hw/xfree86/os-support/bus/zx1PCI.c
index dc4d062f3..b5a483560 100644
--- a/hw/xfree86/os-support/bus/zx1PCI.c
+++ b/hw/xfree86/os-support/bus/zx1PCI.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v 1.5 2003/11/06 18:38:14 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -97,6 +97,8 @@
#define LBA_PORT5_CNTRL 0x1228U
#define LBA_PORT6_CNTRL 0x1230U
#define LBA_PORT7_CNTRL 0x1238U
+#define LBA_ROPE_RESET 0x01UL
+#define LBA_CLEAR_ERROR 0x10UL
#define LBA_HARD_FAIL 0x40UL
#define ROPE_PAGE_CONTROL 0x1418U
@@ -326,7 +328,8 @@ ControlZX1Bridge(int bus, CARD16 mask, CARD16 value)
}
/* Move on to master abort failure enablement */
- tmp1 = MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL);
+ tmp1 = MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL) &
+ ~(LBA_ROPE_RESET | LBA_CLEAR_ERROR);
if ((tmp1 & LBA_HARD_FAIL) || (tmp2 & IOA_HARD_FAIL)) {
current |= PCI_PCI_BRIDGE_MASTER_ABORT_EN;
if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
@@ -388,14 +391,15 @@ GetZX1BridgeResources(int bus,
static CARD32
zx1FakeReadLong(PCITAG tag, int offset)
{
- FatalError("zx1FakeReadLong(0x%X, 0x%X) called\n", tag, offset);
+ FatalError("zx1FakeReadLong(0x%lX, 0x%X) called\n",
+ (unsigned long)tag, offset);
}
static void
zx1FakeWriteLong(PCITAG tag, int offset, CARD32 val)
{
- FatalError("zx1FakeWriteLong(0x%X, 0x%X, 0x%08X) called\n",
- tag, offset, val);
+ FatalError("zx1FakeWriteLong(0x%lX, 0x%X, 0x%08X) called\n",
+ (unsigned long)tag, offset, val);
}
static void
@@ -458,8 +462,10 @@ xf86PreScanZX1(void)
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))) {
+ if ((MIO_LONG(MIO_FUNCTION0 + PCI_ID_REG) !=
+ DEVID(VENDOR_HP, CHIP_ZX1_SBA)) ||
+ (MIO_LONG(MIO_FUNCTION1 + PCI_ID_REG) !=
+ DEVID(VENDOR_HP, CHIP_ZX1_IOC))) {
xf86UnMapVidMem(-1, pZX1mio, mapSize);
pZX1mio = NULL;
return FALSE;
@@ -513,7 +519,8 @@ xf86PreScanZX1(void)
if (zx1_ropemap[i] == i) {
/* Prevent hard-fails */
- zx1_lbacntl[i] = MIO_QUAD((i << 3) + LBA_PORT0_CNTRL);
+ zx1_lbacntl[i] = MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) &
+ ~(LBA_ROPE_RESET | LBA_CLEAR_ERROR);
if (zx1_lbacntl[i] & LBA_HARD_FAIL)
MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) =
zx1_lbacntl[i] & ~LBA_HARD_FAIL;
@@ -521,8 +528,10 @@ xf86PreScanZX1(void)
/* 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):
+ case DEVID(VENDOR_HP, CHIP_ELROY):
+ case DEVID(VENDOR_HP, CHIP_ZX1_LBA): /* Mercury */
+ case DEVID(VENDOR_HP, CHIP_ZX1_AGP8): /* QuickSilver */
+ /* Expected vendor/device IDs */
zx1_busno[i] =
(unsigned int)IOA_BYTE(i, IOA_SECONDARY_BUS);
zx1_subno[i] =
@@ -900,9 +909,9 @@ xf86PostScanZX1(void)
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):
+ case DEVID(VENDOR_HP, CHIP_ZX1_SBA):
+ case DEVID(VENDOR_HP, CHIP_ZX1_IOC):
+ case DEVID(VENDOR_HP, CHIP_ZX1_LBA):
xfree(pPCI); /* Remove it */
continue;
@@ -975,7 +984,7 @@ xf86PostScanZX1(void)
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_device_vendor = DEVID(VENDOR_HP, CHIP_ZX1_SBA);
pPCI->pci_base_class = PCI_CLASS_BRIDGE;
/* pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_HOST; */
pPCI->fakeDevice = TRUE;
@@ -1009,7 +1018,7 @@ xf86PostScanZX1(void)
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_device_vendor = DEVID(VENDOR_HP, CHIP_ZX1_LBA);
pPCI->pci_base_class = PCI_CLASS_BRIDGE;
pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_PCI;
pPCI->pci_header_type = 1;
diff --git a/hw/xfree86/os-support/int10Defines.h b/hw/xfree86/os-support/int10Defines.h
index d99ea8672..77d2f4db9 100644
--- a/hw/xfree86/os-support/int10Defines.h
+++ b/hw/xfree86/os-support/int10Defines.h
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/int10Defines.h,v 1.3 2001/06/30 21:54:03 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/int10Defines.h,v 1.4 2003/08/24 17:37:03 dawes Exp $ */
+/*
+ * Copyright (c) 2000-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _INT10DEFINES_H_
#define _INT10DEFINES_H_ 1
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c
index 4ef765451..11fe19f67 100644
--- a/hw/xfree86/os-support/linux/int10/linux.c
+++ b/hw/xfree86/os-support/linux/int10/linux.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.29 2002/10/16 21:13:47 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.31 2003/09/24 02:43:35 dawes Exp $ */
/*
* linux specific part of the int10 module
* Copyright 1999 Egbert Eich
@@ -123,7 +123,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
ErrorF("Mapping sys bios area\n");
#endif
if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE,
- PROT_READ | PROT_WRITE | PROT_EXEC,
+ PROT_READ | PROT_EXEC,
MAP_SHARED | MAP_FIXED, fd, SYS_BIOS))
== MAP_FAILED) {
xf86DrvMsg(screen, X_ERROR, "Cannot map SYS BIOS\n");
@@ -238,7 +238,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
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);
+ "Unable to retrieve all of segment 0x%06lX.\n", cs);
#ifdef DEBUG
ErrorF("done\n");
#endif
@@ -250,13 +250,13 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
&& !(initPrimary(options))) {
if (bios.bus == BUS_ISA && bios.location.legacy) {
xf86DrvMsg(screen, X_CONFIG,
- "Overriding BIOS location: 0x%lx\n",
+ "Overriding BIOS location: 0x%x\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);
+ "No V_BIOS at specified address 0x%lx\n",cs << 4);
goto error3;
}
} else {
@@ -286,7 +286,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
}
}
- xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
+ xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", cs);
pInt->BIOSseg = cs;
set_return_trap(pInt);
@@ -345,7 +345,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
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);
+ "on override address %p\n",bios_base);
goto error3;
}
} else {
@@ -365,7 +365,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
}
}
}
- xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%x\n",cs);
+ xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%lx\n",cs);
pInt->BIOSseg = cs;
break;
default:
diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
index 6203cc3c3..dc737ac47 100644
--- a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
+++ b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
@@ -1,3 +1,5 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c,v 1.3 2003/11/03 05:36:33 tsi Exp $ */
+
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
@@ -173,7 +175,7 @@ vm86_GP_fault(xf86Int10InfoPtr pInt)
case 0x0f:
xf86DrvMsg(pInt->scrnIndex, X_ERROR,
- "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8x\n", X86_CS, X86_EIP);
+ "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8lx\n", X86_CS, X86_EIP);
goto op0ferr;
default:
diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c
index 13e423433..acac20bce 100644
--- a/hw/xfree86/os-support/linux/lnx_agp.c
+++ b/hw/xfree86/os-support/linux/lnx_agp.c
@@ -7,7 +7,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.12 2003/09/24 02:43:35 dawes Exp $ */
#include "X.h"
#include "xf86.h"
@@ -18,7 +18,7 @@
#if defined(linux)
#include <asm/ioctl.h>
#include <linux/agpgart.h>
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/ioctl.h>
#include <sys/agpio.h>
#endif
@@ -263,14 +263,14 @@ xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
if (offset % AGP_PAGE_SIZE != 0) {
xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: "
- "offset (0x%x) is not page-aligned (%d)\n",
+ "offset (0x%lx) 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 "
+ "xf86BindGARTMemory: bind key %d at 0x%08lx "
"(pgoffset %d)\n", key, offset, pageOffset);
bind.pg_start = pageOffset;
@@ -279,7 +279,7 @@ xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
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",
+ "\tat offset 0x%lx failed (%s)\n",
key, offset, strerror(errno));
return FALSE;
}
@@ -332,8 +332,8 @@ xf86EnableAGP(int screenNum, CARD32 mode)
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));
+ "AGPIOC_SETUP with mode %ld failed (%s)\n",
+ (unsigned long)mode, strerror(errno));
return FALSE;
}
diff --git a/hw/xfree86/os-support/linux/lnx_io.c b/hw/xfree86/os-support/linux/lnx_io.c
index 741b9a279..7631a1ff0 100644
--- a/hw/xfree86/os-support/linux/lnx_io.c
+++ b/hw/xfree86/os-support/linux/lnx_io.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c,v 3.24 2002/10/20 21:45:27 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c,v 3.26 2003/11/17 22:20:41 dawes Exp $ */
/*
* Copyright 1992 by Orest Zborowski <obz@Kodak.com>
* Copyright 1993 by David Dawes <dawes@xfree86.org>
@@ -67,6 +67,7 @@ xf86GetKbdLeds()
* from util-linux-2.9t package */
#include <linux/kd.h>
+#include <linux/version.h>
#ifdef __sparc__
#include <asm/param.h>
#include <asm/kbio.h>
@@ -142,12 +143,7 @@ KIOCSRATE_ioctl_ok(int rate, int delay) {
#undef rate
-#if NeedFunctionPrototypes
void xf86SetKbdRepeat(char rad)
-#else
-void xf86SetKbdRepeat(rad)
-char rad;
-#endif
{
#ifdef __sparc__
int rate = 500; /* Default rate */
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.c b/hw/xfree86/os-support/linux/lnx_kbd.c
index f2d508c04..ba18f28a1 100644
--- a/hw/xfree86/os-support/linux/lnx_kbd.c
+++ b/hw/xfree86/os-support/linux/lnx_kbd.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.2 2003/02/17 15:11:57 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.5 2003/11/04 03:14:39 tsi Exp $ */
/*
* Copyright (c) 2002 by The XFree86 Project, Inc.
@@ -27,7 +27,7 @@
static KbdProtocolRec protocols[] = {
{"standard", PROT_STD },
- { NULL, PROT_UNKNOWN }
+ { NULL, PROT_UNKNOWN_KBD }
};
extern Bool VTSwitchEnabled;
@@ -93,12 +93,20 @@ GetKbdLeds(InputInfoPtr pInfo)
/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
* from util-linux-2.9t package */
-
+#include <linux/kd.h>
+#include <linux/version.h>
#ifdef __sparc__
#include <asm/param.h>
#include <asm/kbio.h>
#endif
+/* Deal with spurious kernel header change */
+#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
+# define rate period
+# endif
+#endif
+
static int
KDKBDREP_ioctl_ok(int rate, int delay) {
#if defined(KDKBDREP) && !defined(__sparc__)
@@ -160,6 +168,8 @@ KIOCSRATE_ioctl_ok(int rate, int delay) {
#endif /* KIOCSRATE */
}
+#undef rate
+
static void
SetKbdRepeat(InputInfoPtr pInfo, char rad)
{
@@ -436,7 +446,7 @@ OpenKeyboard(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
int i;
- KbdProtocolId prot = PROT_UNKNOWN;
+ KbdProtocolId prot = PROT_UNKNOWN_KBD;
char *s;
s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
diff --git a/hw/xfree86/os-support/linux/lnx_mouse.c b/hw/xfree86/os-support/linux/lnx_mouse.c
index 8bc7e6331..3d0d30f52 100644
--- a/hw/xfree86/os-support/linux/lnx_mouse.c
+++ b/hw/xfree86/os-support/linux/lnx_mouse.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_mouse.c,v 1.1 1999/05/17 13:17:18 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_mouse.c,v 1.2 2003/10/08 14:58:30 dawes Exp $ */
/*
* Copyright 1999 by The XFree86 Project, Inc.
@@ -8,6 +8,10 @@
#include "xf86.h"
#include "xf86Xinput.h"
#include "xf86OSmouse.h"
+#include "xf86_OSlib.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
static int
SupportedInterfaces(void)
@@ -15,6 +19,172 @@ SupportedInterfaces(void)
return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
}
+static const char *
+DefaultProtocol(void)
+{
+ return "Auto";
+}
+
+#define DEFAULT_MOUSE_DEV "/dev/mouse"
+#define DEFAULT_PS2_DEV "/dev/psaux"
+#define DEFAULT_GPM_DATA_DEV "/dev/gpmdata"
+#define DEFAULT_GPM_CTL_DEV "/dev/gpmdata"
+
+static const char *mouseDevs[] = {
+ DEFAULT_MOUSE_DEV,
+ DEFAULT_PS2_DEV,
+ DEFAULT_GPM_DATA_DEV,
+ NULL
+};
+
+typedef enum {
+ MOUSE_PROTO_UNKNOWN = 0,
+ MOUSE_PROTO_SERIAL,
+ MOUSE_PROTO_PS2,
+ MOUSE_PROTO_MSC,
+ MOUSE_PROTO_GPM
+} protocolTypes;
+
+static struct {
+ protocolTypes proto;
+ const char *name;
+} devproto[] = {
+ { MOUSE_PROTO_UNKNOWN, NULL },
+ { MOUSE_PROTO_PS2, "PS/2" },
+ { MOUSE_PROTO_MSC, "MouseSystems" },
+ { MOUSE_PROTO_GPM, "GPM" }
+};
+
+static const char *
+FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ int fd = -1;
+ const char **pdev;
+
+ for (pdev = mouseDevs; *pdev; pdev++) {
+ SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK | O_EXCL));
+ if (fd == -1) {
+#ifdef DEBUG
+ ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno));
+#endif
+ } else
+ break;
+ }
+
+ if (*pdev) {
+ close(fd);
+ /* Set the Device option. */
+ pInfo->conf_idev->commonOptions =
+ xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", *pdev);
+ xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n",
+ pInfo->name, *pdev);
+ }
+
+ return *pdev;
+}
+
+static const char *
+GuessProtocol(InputInfoPtr pInfo, int flags)
+{
+ int fd = -1;
+ const char *dev;
+ char *realdev;
+ struct stat sbuf;
+ int i;
+ int proto = MOUSE_PROTO_UNKNOWN;
+
+ dev = xf86SetStrOption(pInfo->conf_idev->commonOptions, "Device", NULL);
+ if (!dev) {
+#ifdef DEBUG
+ ErrorF("xf86SetStrOption failed to return the device name\n");
+#endif
+ return NULL;
+ }
+ /* Look at the device name to guess the protocol. */
+ realdev = NULL;
+ if (strcmp(dev, DEFAULT_MOUSE_DEV) == 0) {
+ if (lstat(dev, &sbuf) != 0) {
+#ifdef DEBUG
+ ErrorF("lstat failed for %s (%s)\n", dev, strerror(errno));
+#endif
+ return NULL;
+ }
+ if (S_ISLNK(sbuf.st_mode)) {
+ realdev = xnfalloc(PATH_MAX + 1);
+ i = readlink(dev, realdev, PATH_MAX);
+ if (i <= 0) {
+#ifdef DEBUG
+ ErrorF("readlink failed for %s (%s)\n", dev, strerror(errno));
+#endif
+ xfree(realdev);
+ return NULL;
+ }
+ realdev[i] = '\0';
+ }
+ }
+ if (!realdev)
+ realdev = xnfstrdup(dev);
+ else {
+ /* If realdev doesn't contain a '/' then prepend "/dev/" */
+ if (!strchr(realdev, '/')) {
+ char *tmp = xnfalloc(strlen(realdev) + 5 + 1);
+ sprintf(tmp, "/dev/%s", realdev);
+ xfree(realdev);
+ realdev = tmp;
+ }
+ }
+
+ if (strcmp(realdev, DEFAULT_PS2_DEV) == 0)
+ proto = MOUSE_PROTO_PS2;
+ else if (strcmp(realdev, DEFAULT_GPM_DATA_DEV) == 0)
+ proto = MOUSE_PROTO_MSC;
+ else if (strcmp(realdev, DEFAULT_GPM_CTL_DEV) == 0)
+ proto = MOUSE_PROTO_GPM;
+ xfree(realdev);
+ /*
+ * If the protocol can't be guessed from the device name,
+ * try to characterise it.
+ */
+ if (proto == MOUSE_PROTO_UNKNOWN) {
+ SYSCALL (fd = open(dev, O_RDWR | O_NONBLOCK | O_EXCL));
+ if (isatty(fd)) {
+ /* Serial PnP has already failed, so give up. */
+ } else {
+ if (fstat(fd, &sbuf) != 0) {
+#ifdef DEBUG
+ ErrorF("fstat failed for %s (%s)\n", dev, strerror(errno));
+#endif
+ close(fd);
+ return NULL;
+ }
+ if (S_ISFIFO(sbuf.st_mode)) {
+ /* Assume GPM data in MSC format. */
+ proto = MOUSE_PROTO_MSC;
+ } else {
+ /* Default to PS/2 */
+ proto = MOUSE_PROTO_PS2;
+ }
+ }
+ close(fd);
+ }
+ if (proto == MOUSE_PROTO_UNKNOWN) {
+ xf86Msg(X_ERROR, "%s: GuessProtocol: Cannot find mouse protocol.\n",
+ pInfo->name);
+ return NULL;
+ } else {
+ for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); i++) {
+ if (devproto[i].proto == proto) {
+ xf86Msg(X_INFO,
+ "%s: GuessProtocol: "
+ "setting mouse protocol to \"%s\"\n",
+ pInfo->name, devproto[i].name);
+ return devproto[i].name;
+ }
+ }
+ }
+ return NULL;
+}
+
OSMouseInfoPtr
xf86OSMouseInit(int flags)
{
@@ -24,6 +194,9 @@ xf86OSMouseInit(int flags)
if (!p)
return NULL;
p->SupportedInterfaces = SupportedInterfaces;
+ p->DefaultProtocol = DefaultProtocol;
+ p->FindDevice = FindDevice;
+ p->GuessProtocol = GuessProtocol;
return p;
}
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index 107d5595e..ad3a17fa2 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.64 2003/02/17 15:29:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.68 2003/09/24 02:43:35 dawes Exp $ */
/*
* Copyright 1992 by Orest Zborowski <obz@Kodak.com>
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -407,6 +407,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
pointer base;
int fd;
int mapflags = MAP_SHARED;
+ int prot;
memType realBase, alignOff;
realBase = Base & ~(getpagesize() - 1);
@@ -429,25 +430,31 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
mapflags |= MAP_NONCACHED;
#endif
-#if defined(__ia64__)
+#if 0
/* this will disappear when people upgrade their kernels */
- if ((fd = open(DEV_MEM, O_RDWR|O_SYNC)) < 0)
+ fd = open(DEV_MEM,
+ ((flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR) | O_SYNC);
#else
- if ((fd = open(DEV_MEM, O_RDWR)) < 0)
+ fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
#endif
+ if (fd < 0)
{
FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
strerror(errno));
}
+
+ if (flags & VIDMEM_READONLY)
+ prot = PROT_READ;
+ else
+ prot = PROT_READ | PROT_WRITE;
+
/* This requires linux-0.99.pl10 or above */
- base = mmap((caddr_t)0, Size + alignOff,
- PROT_READ|PROT_WRITE,
- mapflags, fd,
+ base = mmap((caddr_t)0, Size + alignOff, prot, mapflags, fd,
(off_t)(off_t)realBase + BUS_BASE);
close(fd);
if (base == MAP_FAILED) {
FatalError("xf86MapVidMem: Could not mmap framebuffer"
- " (0x%08x,0x%x) (%s)\n", Base, Size,
+ " (0x%08lx,0x%lx) (%s)\n", Base, Size,
strerror(errno));
}
#ifdef DEBUG
@@ -500,7 +507,7 @@ xf86EnableIO(void)
fd = open("/dev/mem", O_RDWR);
if (ioBase == NULL) {
ioBase = (volatile unsigned char *)mmap(0, 0x20000,
- PROT_READ|PROT_WRITE, MAP_SHARED, fd,
+ PROT_READ | PROT_WRITE, MAP_SHARED, fd,
ioBase_phys);
/* Should this be fatal or just a warning? */
#if 0
@@ -656,7 +663,7 @@ static unsigned long msb_set = 0;
static pointer
mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
- int fd;
+ int fd, prot;
unsigned long ret, rets = 0;
static Bool was_here = FALSE;
@@ -675,7 +682,8 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags
xf86ReadMmio32 = readSparse32;
}
- if ((fd = open(DEV_MEM, O_RDWR)) < 0) {
+ fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
+ if (fd < 0) {
FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
strerror(errno));
}
@@ -685,14 +693,18 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags
Base, Size, flags);
#endif
+ if (flags & VIDMEM_READONLY)
+ prot = PROT_READ;
+ else
+ prot = PROT_READ | PROT_WRITE;
+
/* This requirers linux-0.99.pl10 or above */
/*
* Always do DENSE mmap, since read32/write32 currently require it.
*/
ret = (unsigned long)mmap((caddr_t)(DENSE_BASE + Base), Size,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, fd,
+ prot, MAP_SHARED, fd,
(off_t) (bus_base + Base));
/*
@@ -706,8 +718,7 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags
((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE)))
{
rets = (unsigned long)mmap((caddr_t)(SPARSE_BASE + (Base << 5)),
- Size << 5, PROT_READ | PROT_WRITE,
- MAP_SHARED, fd,
+ Size << 5, prot, MAP_SHARED, fd,
(off_t) _bus_base_sparse() + (Base << 5));
}
@@ -968,7 +979,7 @@ static pointer
mapVidMemJensen(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
pointer base;
- int fd;
+ int fd, prot;
xf86WriteMmio8 = writeSparseJensen8;
xf86WriteMmio16 = writeSparseJensen16;
@@ -980,14 +991,20 @@ mapVidMemJensen(int ScreenNum, unsigned long Base, unsigned long Size, int flags
xf86ReadMmio16 = readSparseJensen16;
xf86ReadMmio32 = readSparseJensen32;
- if ((fd = open(DEV_MEM, O_RDWR)) < 0) {
+ fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
+ if (fd < 0) {
FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n",
strerror(errno));
}
+
+ if (flags & VIDMEM_READONLY)
+ prot = PROT_READ;
+ else
+ prot = PROT_READ | PROT_WRITE;
+
/* This requires linux-0.99.pl10 or above */
base = mmap((caddr_t)0, JENSEN_SHIFT(Size),
- PROT_READ|PROT_WRITE,
- MAP_SHARED, fd,
+ prot, MAP_SHARED, fd,
(off_t)(JENSEN_SHIFT((off_t)Base) + _bus_base_sparse()));
close(fd);
if (base == MAP_FAILED) {
diff --git a/hw/xfree86/os-support/misc/Delay.c b/hw/xfree86/os-support/misc/Delay.c
index 7d5dad40b..b5de1d899 100644
--- a/hw/xfree86/os-support/misc/Delay.c
+++ b/hw/xfree86/os-support/misc/Delay.c
@@ -1,5 +1,8 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.3 2000/12/08 20:13:38 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.4 2003/03/25 04:18:23 dawes Exp $ */
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
#include "X.h"
#include "xf86.h"
#include "xf86Priv.h"
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
index f705e0f42..98546b688 100644
--- a/hw/xfree86/os-support/misc/SlowBcopy.c
+++ b/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -4,7 +4,7 @@
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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.c,v 1.6 2003/04/07 16:23:39 eich Exp $ */
/*
* Create a dependency that should be immune from the effect of register
@@ -26,6 +26,9 @@
void
xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
{
+#if defined(__ia64__)
+ outb(0x80, 0x00);
+#endif
while(len--)
{
*dst++ = *src++;
diff --git a/hw/xfree86/os-support/sco/VTsw_sco.c b/hw/xfree86/os-support/sco/VTsw_sco.c
index d06bd3949..899c3820b 100644
--- a/hw/xfree86/os-support/sco/VTsw_sco.c
+++ b/hw/xfree86/os-support/sco/VTsw_sco.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c,v 1.3 2001/06/30 22:41:49 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c,v 1.4 2003/07/07 15:34:27 eich Exp $ */
/*
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
* Copyright 1993 by David McCullough <davidm@stallion.oz.au>
@@ -72,6 +72,7 @@ xf86VTSwitchAway()
{
ev_flush();
ev_suspend();
+
sco_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &sco_ledstate);
xf86Info.vtRequestsPending = FALSE;
@@ -97,7 +98,7 @@ xf86VTSwitchTo()
return(FALSE);
} else {
if (sco_ledstatus >= 0) {
- ioctl (xf86Info.consoleFd, KDSETLED, &sco_ledstate);
+ ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate);
}
sco_ledstatus = -1;
diff --git a/hw/xfree86/os-support/sco/sco_video.c b/hw/xfree86/os-support/sco/sco_video.c
index eb4b80c48..3c00f5564 100644
--- a/hw/xfree86/os-support/sco/sco_video.c
+++ b/hw/xfree86/os-support/sco/sco_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_video.c,v 3.8 2002/06/03 21:22:10 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_video.c,v 3.9 2003/03/14 13:46:07 tsi Exp $ */
/*
* Copyright 2001 by J. Kean Johnston <jkj@sco.com>
*
@@ -112,7 +112,7 @@ mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
unsigned long realBase, alignOff;
pointer base;
- fd = open (DEV_MEM, O_RDWR);
+ fd = open (DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
if (fd < 0) {
FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM,
strerror(errno));
@@ -126,8 +126,9 @@ mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
ErrorF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff);
#endif
- base = mmap((caddr_t)0, Size + alignOff, PROT_READ|PROT_WRITE,
- MAP_SHARED, fd, (off_t)realBase);
+ base = mmap((caddr_t)0, Size + alignOff,
+ (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, (off_t)realBase);
close(fd);
if (base == MAP_FAILED) {
FatalError("xf86MapVidMem: Could not mmap framebuffer (0x%08x,0x%x) (%s)\n",
diff --git a/hw/xfree86/os-support/shared/agp_noop.c b/hw/xfree86/os-support/shared/agp_noop.c
index c1100e67b..5da36fa19 100644
--- a/hw/xfree86/os-support/shared/agp_noop.c
+++ b/hw/xfree86/os-support/shared/agp_noop.c
@@ -1,10 +1,39 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.5 2003/08/24 17:37:05 dawes Exp $ */
+/*
+ * Copyright (c) 2000-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/*
* 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 $ */
-
+#ifdef __UNIXOS2__
+# define I_NEED_OS2_H
+#endif
#include "X.h"
#include "xf86.h"
#include "xf86Priv.h"
diff --git a/hw/xfree86/os-support/shared/at_scancode.c b/hw/xfree86/os-support/shared/at_scancode.c
index a1529579f..821e116ab 100644
--- a/hw/xfree86/os-support/shared/at_scancode.c
+++ b/hw/xfree86/os-support/shared/at_scancode.c
@@ -1,7 +1,29 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/at_scancode.c,v 1.1 2002/10/11 01:40:37 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/at_scancode.c,v 1.4 2003/08/24 17:37:05 dawes Exp $ */
/*
- * Copyright (c) 2002 by The XFree86 Project, Inc.
+ * Copyright (c) 2002-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
#include "xf86.h"
@@ -21,6 +43,34 @@ ATScancode(InputInfoPtr pInfo, int *scanCode)
case KEY_Prefix1:
pKbd->scanPrefix = *scanCode; /* special prefixes */
return TRUE;
+ case 0x59: *scanCode = KEY_0x59; break;
+ case 0x5a: *scanCode = KEY_0x5A; break;
+ case 0x5b: *scanCode = KEY_0x5B; break;
+ case 0x5c: *scanCode = KEY_KP_Equal; break; /* Keypad Equal */
+ case 0x5d: *scanCode = KEY_0x5D; break;
+ case 0x5e: *scanCode = KEY_0x5E; break;
+ case 0x5f: *scanCode = KEY_0x5F; break;
+ case 0x62: *scanCode = KEY_0x62; break;
+ case 0x63: *scanCode = KEY_0x63; break;
+ case 0x64: *scanCode = KEY_0x64; break;
+ case 0x65: *scanCode = KEY_0x65; break;
+ case 0x66: *scanCode = KEY_0x66; break;
+ case 0x67: *scanCode = KEY_0x67; break;
+ case 0x68: *scanCode = KEY_0x68; break;
+ case 0x69: *scanCode = KEY_0x69; break;
+ case 0x6a: *scanCode = KEY_0x6A; break;
+ case 0x6b: *scanCode = KEY_0x6B; break;
+ case 0x6c: *scanCode = KEY_0x6C; break;
+ case 0x6d: *scanCode = KEY_0x6D; break;
+ case 0x6e: *scanCode = KEY_0x6E; break;
+ case 0x6f: *scanCode = KEY_0x6F; break;
+ case 0x70: *scanCode = KEY_0x70; break;
+ case 0x71: *scanCode = KEY_0x71; break;
+ case 0x72: *scanCode = KEY_0x72; break;
+ case 0x73: *scanCode = KEY_0x73; break;
+ case 0x74: *scanCode = KEY_0x74; break;
+ case 0x75: *scanCode = KEY_0x75; break;
+ case 0x76: *scanCode = KEY_0x76; break;
}
break;
case KEY_Prefix0:
diff --git a/hw/xfree86/os-support/shared/kbd.c b/hw/xfree86/os-support/shared/kbd.c
index 0ebf729ac..213e8bd62 100644
--- a/hw/xfree86/os-support/shared/kbd.c
+++ b/hw/xfree86/os-support/shared/kbd.c
@@ -1,7 +1,29 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kbd.c,v 1.2 2003/02/17 15:11:59 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kbd.c,v 1.3 2003/08/24 17:37:05 dawes Exp $ */
/*
- * Copyright (c) 2001 by The XFree86 Project, Inc.
+ * Copyright (c) 2001-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
#include "xf86OSKbd.h"
diff --git a/hw/xfree86/os-support/shared/kmod_noop.c b/hw/xfree86/os-support/shared/kmod_noop.c
index 80f487593..ae6852ed9 100644
--- a/hw/xfree86/os-support/shared/kmod_noop.c
+++ b/hw/xfree86/os-support/shared/kmod_noop.c
@@ -1,3 +1,30 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kmod_noop.c,v 1.2 2003/08/24 17:37:05 dawes Exp $ */
+/*
+ * Copyright (c) 2000 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "xf86_OSproc.h"
diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c
index e72997cc3..b6aa8fb29 100644
--- a/hw/xfree86/os-support/shared/libc_wrapper.c
+++ b/hw/xfree86/os-support/shared/libc_wrapper.c
@@ -1,6 +1,6 @@
-/* $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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.102 2003/11/19 03:52:58 dawes Exp $ */
/*
- * Copyright 1997 by The XFree86 Project, Inc.
+ * Copyright 1997-2003 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
@@ -27,6 +27,9 @@
#undef __STRICT_ANSI__
#endif
#include <X.h>
+#ifdef __UNIXOS2__
+#define I_NEED_OS2_H
+#endif
#include <Xmd.h>
#include <Xos.h>
#include <sys/types.h>
@@ -251,6 +254,18 @@ xf86strlen(const char* s)
return (xf86size_t)strlen(s);
}
+xf86size_t
+xf86strlcat(char *dest, const char *src, xf86size_t size)
+{
+ return(strlcat(dest, src, size));
+}
+
+xf86size_t
+xf86strlcpy(char *dest, const char *src, xf86size_t size)
+{
+ return strlcpy(dest, src, size);
+}
+
char*
xf86strncat(char* dest, const char* src, xf86size_t n)
{
@@ -481,7 +496,7 @@ xf86mmap(void *start, xf86size_t length, int prot,
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 defined(__AMD64__) && defined(linux)
if (flags & XF86_MAP_32BIT) f |= MAP_32BIT;
#endif
if (prot & XF86_PROT_EXEC) p |= PROT_EXEC;
@@ -655,7 +670,7 @@ 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",
+ FatalError("libc_wrapper error: passed invalid FILE handle to %s",
func);
exit(42);
}
@@ -1088,7 +1103,7 @@ xf86setvbuf(XF86FILE* f, char *buf, int mode, xf86size_t size)
vbufmode = _IOLBF;
break;
default:
- FatalError("libc_wrapper error: mode in setvbuf incorrect\n");
+ FatalError("libc_wrapper error: mode in setvbuf incorrect");
exit(42);
}
@@ -1298,7 +1313,7 @@ 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",
+ FatalError("libc_wrapper error: passed invalid DIR handle to %s",
func);
exit(42);
}
@@ -1550,8 +1565,12 @@ int
xf86finite(double x)
{
#ifndef QNX4
+#ifndef __UNIXOS2__
return(finite(x));
#else
+ return(isfinite(x));
+#endif /* __UNIXOS2__ */
+#else
/* XXX Replace this with something that really works. */
return 1;
#endif
@@ -1810,7 +1829,7 @@ xf86getpagesize()
pagesize = PAGE_SIZE;
#endif
if (pagesize == -1)
- FatalError("xf86getpagesize: Cannot determine page size\n");
+ FatalError("xf86getpagesize: Cannot determine page size");
return pagesize;
}
@@ -1859,22 +1878,18 @@ xf86GetErrno ()
-#ifdef NEED_SNPRINTF
-#include "snprintf.c"
-#endif
-
#ifdef HAVE_SYSV_IPC
int
xf86shmget(xf86key_t key, int size, int xf86shmflg)
{
- int shmflg = xf86shmflg & 0777;
+ int shmflg;
+
+ /* This copies the permissions (SHM_R, SHM_W for u, g, o). */
+ 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;
@@ -1967,7 +1982,7 @@ int
xf86setjmp(xf86jmp_buf env)
{
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
- return __sigsetjmp(env, xf86setjmp1_arg2());
+ return __sigsetjmp((void *)env, xf86setjmp1_arg2());
#else
return xf86setjmp1(env, xf86setjmp1_arg2());
#endif
@@ -1976,7 +1991,7 @@ xf86setjmp(xf86jmp_buf env)
int
xf86setjmp0(xf86jmp_buf env)
{
- FatalError("setjmp: type 0 called instead of type %d\n", xf86getjmptype());
+ FatalError("setjmp: type 0 called instead of type %d", xf86getjmptype());
}
#if !defined(__GLIBC__) || (__GLIBC__ < 2) /* libc5 */
@@ -1995,7 +2010,7 @@ xf86setjmp1(xf86jmp_buf env, int arg2)
int
xf86setjmp1(xf86jmp_buf env, int arg2)
{
- FatalError("setjmp: type 1 called instead of type %d\n", xf86getjmptype());
+ FatalError("setjmp: type 1 called instead of type %d", xf86getjmptype());
}
#endif /* HAS_GLIBC_SIGSETJMP */
@@ -2009,7 +2024,7 @@ xf86setjmp1_arg2()
int
xf86setjmperror(xf86jmp_buf env)
{
- FatalError("setjmp: don't know how to handle setjmp() type %d\n",
+ FatalError("setjmp: don't know how to handle setjmp() type %d",
xf86getjmptype());
}
diff --git a/hw/xfree86/os-support/shared/pm_noop.c b/hw/xfree86/os-support/shared/pm_noop.c
index fc02b3a20..b5f4941bc 100644
--- a/hw/xfree86/os-support/shared/pm_noop.c
+++ b/hw/xfree86/os-support/shared/pm_noop.c
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/pm_noop.c,v 1.1 2000/02/13 03:36:11 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/pm_noop.c,v 1.2 2003/08/24 17:37:06 dawes Exp $ */
+/*
+ * Copyright (c) 2000 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/* Stubs for the OS-support layer power-management functions. */
diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
index a4f487025..1812729c0 100644
--- a/hw/xfree86/os-support/shared/posix_tty.c
+++ b/hw/xfree86/os-support/shared/posix_tty.c
@@ -1,6 +1,6 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.c,v 3.28 2003/02/17 15:11:59 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.c,v 3.30 2003/08/24 17:37:06 dawes Exp $ */
/*
- * Copyright 1993-1999 by The XFree86 Project, Inc.
+ * Copyright 1993-2003 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"),
@@ -127,12 +127,7 @@ xf86OpenSerial (pointer options)
return (-1);
}
-#ifndef Lynx
- SYSCALL (fd = open (dev, O_RDWR | O_NONBLOCK | O_EXCL));
-#else
- /* O_EXCL yields an EEXIST on LynxOS */
SYSCALL (fd = open (dev, O_RDWR | O_NONBLOCK));
-#endif
if (fd == -1)
{
xf86Msg (X_ERROR,
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index 077c566a6..fbab2a517 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -1,3 +1,5 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigio.c,v 1.16 2003/09/04 00:21:17 dawes Exp $ */
+
/* sigio.c -- Support for SIGIO handler installation and removal
* Created: Thu Jun 3 15:39:18 1999 by faith@precisioninsight.com
*
@@ -24,12 +26,34 @@
* DEALINGS IN THE SOFTWARE.
*
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ */
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigio.c,v 1.14 2002/05/05 19:18:14 herrb Exp $
- *
+ * 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
-
#ifdef XFree86Server
# include "X.h"
# include "xf86.h"
@@ -151,6 +175,7 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
fprintf(stderr,"fcntl(%d, F_SETOWN): %s\n",
fd, strerror(errno));
#endif
+ xf86UnblockSIGIO(blocked);
return 0;
}
sigemptyset(&sa.sa_mask);
diff --git a/hw/xfree86/os-support/shared/sigiostubs.c b/hw/xfree86/os-support/shared/sigiostubs.c
index 0fdebda1d..51f98f2a4 100644
--- a/hw/xfree86/os-support/shared/sigiostubs.c
+++ b/hw/xfree86/os-support/shared/sigiostubs.c
@@ -1,6 +1,35 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.2 1999/10/14 04:25:01 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.4 2003/08/24 17:37:06 dawes Exp $ */
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifdef XFree86Server
+#ifdef __UNIXOS2__
+# define I_NEED_OS2_H
+#endif
# include "X.h"
# include "xf86.h"
# include "xf86drm.h"
diff --git a/hw/xfree86/os-support/shared/stdPci.c b/hw/xfree86/os-support/shared/stdPci.c
index b21acabcc..fd60ec509 100644
--- a/hw/xfree86/os-support/shared/stdPci.c
+++ b/hw/xfree86/os-support/shared/stdPci.c
@@ -1,5 +1,34 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdPci.c,v 3.2 1999/12/06 03:55:13 robin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdPci.c,v 3.4 2003/08/24 17:37:06 dawes Exp $ */
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+#ifdef __UNIXOS2__
+# define I_NEED_OS2_H
+#endif
#include "X.h"
#include "xf86.h"
#include "xf86Priv.h"
diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c
index 5aae4ae9d..df781c371 100644
--- a/hw/xfree86/os-support/shared/stdResource.c
+++ b/hw/xfree86/os-support/shared/stdResource.c
@@ -1,7 +1,36 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdResource.c,v 1.20 2002/01/25 21:56:20 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdResource.c,v 1.22 2003/08/24 17:37:06 dawes Exp $ */
+/*
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/* Standard resource information code */
+#ifdef __UNIXOS2__
+# define I_NEED_OS2_H
+#endif
#include "X.h"
#include "xf86.h"
#include "xf86Priv.h"
@@ -11,6 +40,9 @@
#include "xf86_OSlib.h"
#include "xf86Resources.h"
+#ifdef __UNIXOS2__
+# undef ADDRESS
+#endif
/* Avoid Imakefile changes */
#include "bus/Pci.h"
diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c
index 872cd7aa9..aed735680 100644
--- a/hw/xfree86/os-support/shared/vidmem.c
+++ b/hw/xfree86/os-support/shared/vidmem.c
@@ -1,9 +1,35 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.15 2001/10/28 03:34:02 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.17 2003/08/24 17:37:06 dawes Exp $ */
/*
- * Copyright 1993-1999 by The XFree86 Project, Inc
+ * Copyright (c) 1993-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
+
+#ifdef __UNIXOS2__
+# define I_NEED_OS2_H
+#endif
#include "X.h"
#include "input.h"
#include "scrnintstr.h"
diff --git a/hw/xfree86/os-support/shared/xf86Axp.c b/hw/xfree86/os-support/shared/xf86Axp.c
index 24d31db59..42edbc53c 100644
--- a/hw/xfree86/os-support/shared/xf86Axp.c
+++ b/hw/xfree86/os-support/shared/xf86Axp.c
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.c,v 1.2 2000/11/06 21:57:11 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.c,v 1.3 2003/08/24 17:37:06 dawes Exp $ */
+/*
+ * Copyright (c) 2000 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#include "xf86Axp.h"
diff --git a/hw/xfree86/os-support/solaris/sun_bios.c b/hw/xfree86/os-support/solaris/sun_bios.c
index d1c79888b..e93e0e9dd 100644
--- a/hw/xfree86/os-support/solaris/sun_bios.c
+++ b/hw/xfree86/os-support/solaris/sun_bios.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_bios.c,v 1.2 2001/10/28 03:34:02 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_bios.c,v 1.3 2003/11/07 13:45:27 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -71,7 +71,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
{
if (!xf86LinearVidMem())
FatalError("xf86ReadBIOS: Could not mmap BIOS"
- " [a=%x]\n", Base);
+ " [a=%lx]\n", Base);
sprintf(solx86_vtname, apertureDevName);
}
@@ -86,7 +86,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
if (ptr == MAP_FAILED)
{
xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed "
- "[0x%05x, 0x%04x]\n",
+ "[0x%08lx, 0x%04x]\n",
solx86_vtname, Base, mlen);
close(fd);
return -1;
diff --git a/hw/xfree86/os-support/solaris/sun_kbd.c b/hw/xfree86/os-support/solaris/sun_kbd.c
index 7e4998817..058f1109a 100644
--- a/hw/xfree86/os-support/solaris/sun_kbd.c
+++ b/hw/xfree86/os-support/solaris/sun_kbd.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c,v 1.1 2001/05/28 02:42:31 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c,v 1.2 2003/10/09 11:44:00 pascal Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1993 by David Dawes <dawes@XFree86.org>
@@ -29,6 +29,7 @@
static int sun_otranslation = -1;
static int sun_odirect = -1;
+int sun_ktype;
int
xf86GetKbdLeds()
@@ -53,7 +54,7 @@ xf86SetKbdRepeat(char rad)
void
xf86KbdInit()
{
- int ktype, klayout;
+ int klayout;
if (xf86Info.kbdFd < 0) {
xf86Info.kbdFd = open("/dev/kbd", O_RDWR|O_NONBLOCK);
@@ -66,7 +67,7 @@ xf86KbdInit()
* broken (IMO) - DWH 8/21/99
*/
- if (ioctl(xf86Info.kbdFd, KIOCTYPE, &ktype) < 0)
+ if (ioctl(xf86Info.kbdFd, KIOCTYPE, &sun_ktype) < 0)
FatalError("Unable to determine keyboard type: %d\n", errno);
if (ioctl(xf86Info.kbdFd, KIOCLAYOUT, &klayout) < 0)
diff --git a/hw/xfree86/os-support/solaris/sun_kbdEv.c b/hw/xfree86/os-support/solaris/sun_kbdEv.c
index ff4ef3288..f6481af29 100644
--- a/hw/xfree86/os-support/solaris/sun_kbdEv.c
+++ b/hw/xfree86/os-support/solaris/sun_kbdEv.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c,v 1.4 2001/11/08 04:15:33 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c,v 1.6 2003/10/09 11:44:00 pascal Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
* Copyright 1993 by David Dawes <dawes@xfree86.org>
@@ -41,8 +41,11 @@
#endif
#include <sys/vuid_event.h>
+#include <sys/kbd.h>
#include "atKeynames.h"
+extern int sun_ktype;
+
#ifdef XKB
extern Bool noXkbExtension;
#endif
@@ -105,7 +108,7 @@ static OsTimerPtr sunTimer = NULL;
* type.
*/
static unsigned char map[256] = {
-#if defined(i368) || defined(__i386) || defined(__i386__)
+#if defined(i386) || defined(__i386) || defined(__i386__)
KEY_NOTUSED, /* 0 */
KEY_Tilde, /* 1 */
KEY_1, /* 2 */
@@ -374,6 +377,248 @@ static unsigned char map[256] = {
/* The rest default to KEY_UNKNOWN */
};
+#if defined(KB_USB)
+static unsigned char usbmap[256] = {
+/*
+ * partially taken from ../bsd/bsd_KbdMap.c
+ *
+ * added keycodes for Sun special keys (left function keys, audio control)
+ */
+ /* 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_BSlash, /* \ _ # ~ 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_Power, /* Sun: Power */
+ /* 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_L7, /* Sun: Open */
+ /* 117 */ KEY_Help, /* Sun: Help */
+ /* 118 */ KEY_L3, /* Sun: Props */
+ /* 119 */ KEY_L5, /* Sun: Front */
+ /* 120 */ KEY_L1, /* Sun: Stop */
+ /* 121 */ KEY_L2, /* Sun: Again */
+ /* 122 */ KEY_L4, /* Sun: Undo */
+ /* 123 */ KEY_L10, /* Sun: Cut */
+ /* 124 */ KEY_L6, /* Sun: Copy */
+ /* 125 */ KEY_L8, /* Sun: Paste */
+ /* 126 */ KEY_L9, /* Sun: Find */
+ /* 127 */ KEY_Mute, /* Sun: AudioMute */
+ /* 128 */ KEY_AudioRaise, /* Sun: AudioRaise */
+ /* 129 */ KEY_AudioLower, /* Sun: AudioLower */
+ /* 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_RMeta, /* Right Meta */
+};
+
+#endif /* KB_USB */
/*
* sunPostKbdEvent --
* Translate the raw hardware Firm_event into an XEvent, and tell DIX
@@ -404,7 +649,12 @@ sunPostKbdEvent(Firm_event *event)
* and now get some special keysequences
*/
- keycode = map[event->id];
+#if defined(KB_USB)
+ if(sun_ktype == KB_USB)
+ keycode = usbmap[event->id];
+ else
+#endif
+ keycode = map[event->id];
if ((ModifierDown(ControlMask | AltMask)) ||
(ModifierDown(ControlMask | AltLangMask)))
diff --git a/hw/xfree86/os-support/sysv/sysv_video.c b/hw/xfree86/os-support/sysv/sysv_video.c
index ab604e95a..c0460f524 100644
--- a/hw/xfree86/os-support/sysv/sysv_video.c
+++ b/hw/xfree86/os-support/sysv/sysv_video.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_video.c,v 3.20 2000/10/28 01:42:29 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_video.c,v 3.21 2003/03/14 13:46:08 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1993 by David Wexelblat <dwex@goblin.org>
@@ -144,13 +144,16 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
int fd;
#if defined(SVR4)
- if ((fd = open(DEV_MEM, O_RDWR)) < 0)
+ fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
+ if (fd < 0)
{
FatalError("xf86MapVidMem: failed to open %s (%s)\n",
DEV_MEM, strerror(errno));
}
- base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE,
- MAP_SHARED, fd, (off_t)Base);
+ base = mmap((caddr_t)0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, (off_t)Base);
close(fd);
if (base == MAP_FAILED)
{
diff --git a/hw/xfree86/os-support/xf86OSKbd.h b/hw/xfree86/os-support/xf86OSKbd.h
index e63d7759c..917b11526 100644
--- a/hw/xfree86/os-support/xf86OSKbd.h
+++ b/hw/xfree86/os-support/xf86OSKbd.h
@@ -1,7 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h,v 1.3 2003/02/17 15:11:55 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h,v 1.6 2003/11/03 05:11:51 tsi Exp $ */
/*
- * Copyright (c) 2002 by The XFree86 Project, Inc.
+ * Copyright (c) 2002-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ *
* Author: Ivan Pascal.
*/
@@ -81,7 +104,7 @@ typedef enum {
PROT_XQUEUE,
PROT_WSCONS,
PROT_USB,
- PROT_UNKNOWN
+ PROT_UNKNOWN_KBD
} KbdProtocolId;
typedef struct {
@@ -90,3 +113,21 @@ typedef struct {
} KbdProtocolRec;
Bool xf86OSKbdPreInit(InputInfoPtr pInfo);
+
+/* Adjust this when the kbd interface changes. */
+
+/*
+ * History:
+ *
+ * 1.0.0 - Initial version.
+ */
+
+#define OS_KBD_VERSION_MAJOR 1
+#define OS_KBD_VERSION_MINOR 0
+#define OS_KBD_VERSION_PATCH 0
+
+#define OS_KBD_VERSION_CURRENT \
+ BUILTIN_INTERFACE_VERSION_NUMERIC(OS_KBD_VERSION_MAJOR, \
+ OS_KBD_VERSION_MINOR, \
+ OS_KBD_VERSION_PATCH)
+
diff --git a/hw/xfree86/os-support/xf86OSmouse.h b/hw/xfree86/os-support/xf86OSmouse.h
index a4486b987..ee6313a3b 100644
--- a/hw/xfree86/os-support/xf86OSmouse.h
+++ b/hw/xfree86/os-support/xf86OSmouse.h
@@ -1,7 +1,29 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.20 2002/12/17 20:55:23 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.24 2003/11/03 05:11:51 tsi Exp $ */
/*
- * Copyright (c) 1997-1999 by The XFree86 Project, Inc.
+ * Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
/* Public interface to OS-specific mouse support. */
@@ -22,6 +44,36 @@
* specific protocol names that are
* supported for this class. */
+/* Mouse Protocol IDs. */
+typedef enum {
+ PROT_UNKNOWN = -2,
+ PROT_UNSUP = -1, /* protocol is not supported */
+ PROT_MS = 0,
+ PROT_MSC,
+ PROT_MM,
+ PROT_LOGI,
+ PROT_LOGIMAN,
+ PROT_MMHIT,
+ PROT_GLIDE,
+ PROT_IMSERIAL,
+ PROT_THINKING,
+ PROT_ACECAD,
+ PROT_VALUMOUSESCROLL,
+ PROT_PS2,
+ PROT_GENPS2,
+ PROT_IMPS2,
+ PROT_EXPPS2,
+ PROT_THINKPS2,
+ PROT_MMPS2,
+ PROT_GLIDEPS2,
+ PROT_NETPS2,
+ PROT_NETSCPS2,
+ PROT_BM,
+ PROT_AUTO,
+ PROT_SYSMOUSE,
+ PROT_NUMPROTOS /* This must always be last. */
+} MouseProtocolID;
+
struct _MouseDevRec;
typedef int (*GetInterfaceTypesProc)(void);
@@ -33,10 +85,9 @@ 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 *);
+typedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol,
+ int flags);
+typedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags);
/*
* OSMouseInfoRec is used to pass information from the OSMouse layer to the
@@ -52,6 +103,8 @@ typedef struct {
SetResProc SetPS2Res;
SetResProc SetBMRes;
SetResProc SetMiscRes;
+ FindDeviceProc FindDevice;
+ GuessProtocolProc GuessProtocol;
} OSMouseInfoRec, *OSMouseInfoPtr;
/*
@@ -78,7 +131,11 @@ typedef struct {
* 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.
+ * then to something other than -1. SetupAuto gets called in two
+ * ways. The first is before any devices have been opened. This
+ * can be used when the protocol "Auto" always maps to a single
+ * protocol type. The second is with the device open, allowing
+ * OS-specific probing to be done.
*
* SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
* protocol types.
@@ -86,15 +143,62 @@ typedef struct {
* SetBMRes: Set the resolution and sample rate for MSE_BM protocol types.
*
* SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types.
+ *
+ * FindDevice: This function gets called when no Device has been specified
+ * in the config file. OS-specific methods may be used to guess
+ * which input device to use. This function is called after the
+ * pre-open attempts at protocol discovery are done, but before
+ * the device is open. I.e., after the first SetupAuto() call,
+ * after the DefaultProtocol() call, but before the PreInit()
+ * call. Available protocol information may be used in locating
+ * the default input device.
+ *
+ * GuessProtocol: A last resort attempt at guessing the mouse protocol by
+ * whatever OS-specific means might be available. OS-independent
+ * things should be in the mouse driver. This function gets
+ * called after the mouse driver's OS-independent methods have
+ * failed.
*/
extern OSMouseInfoPtr xf86OSMouseInit(int flags);
+/* Adjust this when the mouse interface changes. */
+
+/*
+ * History:
+ *
+ * 1.0.0 - Everything up to when versioning was started.
+ * 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec
+ *
+ */
+
+#define OS_MOUSE_VERSION_MAJOR 1
+#define OS_MOUSE_VERSION_MINOR 1
+#define OS_MOUSE_VERSION_PATCH 0
+
+#define OS_MOUSE_VERSION_CURRENT \
+ BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR, \
+ OS_MOUSE_VERSION_MINOR, \
+ OS_MOUSE_VERSION_PATCH)
+
+#define HAVE_GUESS_PROTOCOL \
+ (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
+ BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
+
+#define HAVE_FIND_DEVICE \
+ (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \
+ BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0))
+
/*
* Mouse device record. This is shared by the mouse driver and the OSMouse
* layer.
*/
+typedef void (*checkMovementsProc)(InputInfoPtr,int, int);
+typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
+typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
+typedef Bool (*dataGoodProc)(struct _MouseDevRec *);
+
typedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
int dx, int dy, int dz, int dw);
typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
@@ -106,8 +210,8 @@ typedef struct _MouseDevRec {
DeviceIntPtr device;
const char * mseDevice;
const char * protocol;
- int protocolID;
- int oldProtocolID; /* hack */
+ MouseProtocolID protocolID;
+ MouseProtocolID oldProtocolID; /* hack */
int class;
int mseModel;
int baudRate;
diff --git a/hw/xfree86/os-support/xf86OSpriv.h b/hw/xfree86/os-support/xf86OSpriv.h
index c3224aeeb..865738c40 100644
--- a/hw/xfree86/os-support/xf86OSpriv.h
+++ b/hw/xfree86/os-support/xf86OSpriv.h
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSpriv.h,v 1.5 2000/10/28 01:42:24 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSpriv.h,v 1.6 2003/08/24 17:37:03 dawes Exp $ */
+/*
+ * Copyright (c) 1999-2000 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef _XF86OSPRIV_H
#define _XF86OSPRIV_H
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index b35186724..4d3205eb4 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.90 2002/05/31 18:46:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.95 2003/11/17 22:20:40 dawes Exp $ */
/*
* Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1992 by David Dawes <dawes@XFree86.org>
@@ -10,7 +10,7 @@
* Copyright 1993 by David Wexelblat <dwex@XFree86.org>
* Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
* Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
- * Copyright 1994-1998 by The XFree86 Project, Inc
+ * Copyright 1994-2003 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
@@ -92,10 +92,6 @@ extern int xf86getpagesize(void);
extern int xf86GetErrno(void);
typedef unsigned long xf86size_t;
typedef signed long xf86ssize_t;
-#ifdef NEED_SNPRINTF
-extern int snprintf(char *str, size_t size, const char *format, ...);
-extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
-#endif
#endif
#include <stdio.h>
@@ -106,7 +102,7 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
/* SYSV386 (SVR3, SVR4) - But not Solaris8 */
/**************************************************************************/
#if (defined(SYSV) || defined(SVR4)) && \
- !defined(DGUX) && \
+ !defined(DGUX) && !defined(sgi) && \
!defined(__SOL8__) && \
(!defined(sun) || defined(i386))
# ifdef SCO325
@@ -180,11 +176,11 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
# if defined(SCO)
# include <sys/vtkd.h>
# include <sys/console.h>
-# include <sys/keyboard.h>
+# include <sys/scankbd.h>
# include <sys/vid.h>
-# define LED_CAP 0x01
-# define LED_NUM 0x02
-# define LED_SCR 0x04
+# define LED_CAP CLKED
+# define LED_NUM NLKED
+# define LED_SCR SLKED
# elif defined(HAS_USL_VTS)
# include <sys/at_ansi.h>
# include <sys/kd.h>
@@ -675,6 +671,17 @@ extern char* __XOS2RedirRoot(char*);
#endif /* __GNU__ */
/**************************************************************************/
+/* IRIX */
+/**************************************************************************/
+#if defined(sgi)
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#endif
+
+/**************************************************************************/
/* Generic */
/**************************************************************************/
@@ -721,9 +728,7 @@ extern int sys_nerr;
#if defined(ISC) || defined(Lynx)
#define rint(x) RInt(x)
double RInt(
-#if NeedFunctionPrototypes
double x
-#endif
);
#endif
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
index 4f067d5e0..09d3f2861 100644
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ b/hw/xfree86/os-support/xf86_OSproc.h
@@ -8,7 +8,7 @@
* Copyright 1993 by Vrije Universiteit, The Netherlands
* Copyright 1993 by David Wexelblat <dwex@XFree86.org>
* Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
- * Copyright 1994-1999 by The XFree86 Project, Inc
+ * Copyright 1994-2003 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
@@ -64,7 +64,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.55 2002/01/25 21:56:17 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.57 2003/10/07 23:14:54 herrb Exp $ */
#ifndef _XF86_OSPROC_H
#define _XF86_OSPROC_H
@@ -125,6 +125,7 @@ extern void xf86WrapperInit(void);
#define xf86FatalError(a, b) \
if (dispatchException & DE_TERMINATE) { \
ErrorF(a, b); \
+ ErrorF("\n"); \
return; \
} else FatalError(a, b)
diff --git a/hw/xfree86/os-support/xf86_ansic.h b/hw/xfree86/os-support/xf86_ansic.h
index 03fa33417..733a5543d 100644
--- a/hw/xfree86/os-support/xf86_ansic.h
+++ b/hw/xfree86/os-support/xf86_ansic.h
@@ -1,5 +1,6 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.53 2003/10/28 18:36:37 tsi Exp $ */
/*
- * Copyright 1997-2000 by The XFree86 Project, Inc
+ * Copyright 1997-2003 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
@@ -22,8 +23,6 @@
*
*/
-/* $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
@@ -240,6 +239,8 @@ 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 xf86strlcat(char*,const char*,xf86size_t);
+extern xf86size_t xf86strlcpy(char*,const char*,xf86size_t);
extern xf86size_t xf86strlen(const char*);
extern char* xf86strncat(char *, const char *, xf86size_t);
extern int xf86strncmp(const char*,const char*,xf86size_t);
diff --git a/hw/xfree86/os-support/xf86_libc.h b/hw/xfree86/os-support/xf86_libc.h
index b97599ed5..61eb93d8b 100644
--- a/hw/xfree86/os-support/xf86_libc.h
+++ b/hw/xfree86/os-support/xf86_libc.h
@@ -1,6 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.56 2003/02/22 06:00:39 dawes Exp $ */
-
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.60 2003/10/26 12:17:17 herrb Exp $ */
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/*
* This file is an attempt to make developing code for the new loadable module
@@ -71,7 +95,11 @@ struct xf86stat {
typedef int xf86key_t;
/* setjmp/longjmp */
+#if defined(__ia64__)
+typedef int xf86jmp_buf[1024] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */
+#else
typedef int xf86jmp_buf[1024];
+#endif
/* for setvbuf */
#define XF86_IONBF 1
@@ -348,6 +376,10 @@ typedef int xf86jmp_buf[1024];
#define strcspn(ccp1,ccp2) xf86strcspn(ccp1,ccp2)
#undef strerror
#define strerror(i) xf86strerror(i)
+#undef strlcat
+#define strlcat(cp,ccp,I) xf86strlcat(cp,ccp,I)
+#undef strlcpy
+#define strlcpy(cp,ccp,I) xf86strlcpy(cp,ccp,I)
#undef strlen
#define strlen(ccp) xf86strlen(ccp)
#undef strncmp
@@ -385,11 +417,11 @@ typedef int xf86jmp_buf[1024];
#undef ungetc
#define ungetc(i,FP) xf86ungetc(i,FP)
#undef vfprinf
-#define vfprintf xf86vfprintf
+#define vfprintf(p,f,a) xf86vfprintf(p,f,a)
#undef vsnprintf
-#define vsnprintf xf86vsnprintf
+#define vsnprintf(s,n,f,a) xf86vsnprintf(s,n,f,a)
#undef vsprintf
-#define vsprintf xf86vsprintf
+#define vsprintf(s,f,a) xf86vsprintf(s,f,a)
/* XXX Disable assert as if NDEBUG was defined */
/* Some X headers defined this away too */
#undef assert
diff --git a/hw/xfree86/parser/Configint.h b/hw/xfree86/parser/Configint.h
index 43605dac3..1659d1be4 100644
--- a/hw/xfree86/parser/Configint.h
+++ b/hw/xfree86/parser/Configint.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Configint.h,v 1.20 2002/03/04 16:11:06 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Configint.h,v 1.21 2003/08/24 17:37:07 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/*
* These definitions are used through out the configuration file parser, but
diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c
index e929641c9..9bfe4d1b9 100644
--- a/hw/xfree86/parser/Device.c
+++ b/hw/xfree86/parser/Device.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Device.c,v 1.26 2003/01/04 20:20:22 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Device.c,v 1.27 2003/08/24 17:37:07 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
index 4be58b512..816a16c94 100644
--- a/hw/xfree86/parser/Files.c
+++ b/hw/xfree86/parser/Files.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Files.c,v 1.15 2003/01/04 20:20:22 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Files.c,v 1.16 2003/08/24 17:37:07 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
index dfd3ab0bd..e6326a74e 100644
--- a/hw/xfree86/parser/Flags.c
+++ b/hw/xfree86/parser/Flags.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Flags.c,v 1.22 2003/01/04 20:20:22 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Flags.c,v 1.23 2003/08/24 17:37:07 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Input.c b/hw/xfree86/parser/Input.c
index f5387b384..6e38bdd15 100644
--- a/hw/xfree86/parser/Input.c
+++ b/hw/xfree86/parser/Input.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Input.c,v 1.13 2003/01/04 20:20:22 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Input.c,v 1.14 2003/08/24 17:37:07 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Keyboard.c b/hw/xfree86/parser/Keyboard.c
index 68cbaf3c0..cca3ce412 100644
--- a/hw/xfree86/parser/Keyboard.c
+++ b/hw/xfree86/parser/Keyboard.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Keyboard.c,v 1.15 2003/01/04 20:20:22 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Keyboard.c,v 1.17 2003/08/24 17:37:07 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
@@ -101,8 +128,8 @@ xf86parseKeyboardSection (void)
if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
Error (QUOTE_MSG, "Protocol");
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("Protocol"),
- val.str);
+ xf86configStrdup("Protocol"),
+ val.str);
break;
case AUTOREPEAT:
if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
@@ -117,7 +144,7 @@ xf86parseKeyboardSection (void)
xf86conffree(s1);
xf86conffree(s2);
ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
- xf86configStrdup("AutoRepeat"), s);
+ xf86configStrdup("AutoRepeat"), s);
break;
case XLEDS:
if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c
index cd351c9c6..9907d29c8 100644
--- a/hw/xfree86/parser/Layout.c
+++ b/hw/xfree86/parser/Layout.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Layout.c,v 1.23 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Layout.c,v 1.24 2003/08/24 17:37:07 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c
index 1d61da9a6..33b591d88 100644
--- a/hw/xfree86/parser/Module.c
+++ b/hw/xfree86/parser/Module.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Module.c,v 1.11 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Module.c,v 1.12 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
index 939b621ea..942b199d2 100644
--- a/hw/xfree86/parser/Monitor.c
+++ b/hw/xfree86/parser/Monitor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.27 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.28 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c
index fac4260a4..8b373c562 100644
--- a/hw/xfree86/parser/Pointer.c
+++ b/hw/xfree86/parser/Pointer.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Pointer.c,v 1.12 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Pointer.c,v 1.13 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c
index af8c407a9..e3bf18048 100644
--- a/hw/xfree86/parser/Screen.c
+++ b/hw/xfree86/parser/Screen.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Screen.c,v 1.24 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Screen.c,v 1.28 2003/11/07 23:41:41 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
@@ -61,6 +88,7 @@ xf86parseDisplaySubSection (void)
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;
+ ptr->disp_frameX0 = ptr->disp_frameY0 = -1;
while ((token = xf86getToken (DisplayTab)) != ENDSUBSECTION)
{
switch (token)
@@ -338,7 +366,7 @@ xf86printScreenSection (FILE * cf, XF86ConfScreenPtr ptr)
fprintf (cf, "\tSubSection \"Display\"\n");
if (dptr->disp_comment)
fprintf (cf, "%s", dptr->disp_comment);
- if (dptr->disp_frameX0 != 0 || dptr->disp_frameY0 != 0)
+ if (dptr->disp_frameX0 >= 0 || dptr->disp_frameY0 >= 0)
{
fprintf (cf, "\t\tViewport %d %d\n",
dptr->disp_frameX0, dptr->disp_frameY0);
@@ -479,17 +507,20 @@ xf86validateScreen (XF86ConfigPtr p)
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
+ if (screen->scrn_monitor_str)
{
- screen->scrn_monitor = monitor;
- if (!xf86validateMonitor(p, screen))
+ 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);
@@ -541,15 +572,3 @@ xf86findScreen (const char *ident, XF86ConfScreenPtr p)
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
index f2e98872c..fbbb2e00f 100644
--- a/hw/xfree86/parser/Vendor.c
+++ b/hw/xfree86/parser/Vendor.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Vendor.c,v 1.16 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Vendor.c,v 1.17 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c
index b899f0d3d..de65c415e 100644
--- a/hw/xfree86/parser/Video.c
+++ b/hw/xfree86/parser/Video.c
@@ -1,3 +1,4 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Video.c,v 1.13 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -25,7 +26,32 @@
* 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 $ */
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
index a2440540d..522cf5c2f 100644
--- a/hw/xfree86/parser/configProcs.h
+++ b/hw/xfree86/parser/configProcs.h
@@ -1,4 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/configProcs.h,v 1.16 2001/08/06 20:51:15 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/configProcs.h,v 1.17 2003/08/24 17:37:08 dawes Exp $ */
+/*
+ * Copyright (c) 1997-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/* Private procs. Public procs are in xf86Parser.h and xf86Optrec.h */
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
index cd7bbf10b..2a5afeb27 100644
--- a/hw/xfree86/parser/read.c
+++ b/hw/xfree86/parser/read.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.23 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.24 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 4d8167622..4dc2e0dd1 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.24 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.30 2003/11/03 05:11:52 tsi Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
@@ -65,7 +92,8 @@
static int StringToToken (char *, xf86ConfigSymTabRec *);
static FILE *configFile = NULL;
-static int configStart = 0; /* start of the current token */
+static const char **builtinConfig = NULL;
+static int builtinIndex = 0;
static int configPos = 0; /* current readers position */
static int configLineNo = 0; /* linenumber */
static char *configBuf, *configRBuf; /* buffer for lines */
@@ -160,12 +188,24 @@ xf86getToken (xf86ConfigSymTabRec * tab)
again:
if (!c)
{
- if (fgets (configBuf, CONFIG_BUF_LEN - 1, configFile) == NULL)
+ char *ret;
+ if (configFile)
+ ret = fgets (configBuf, CONFIG_BUF_LEN - 1, configFile);
+ else {
+ if (builtinConfig[builtinIndex] == NULL)
+ ret = NULL;
+ else {
+ ret = strncpy(configBuf, builtinConfig[builtinIndex],
+ CONFIG_BUF_LEN);
+ builtinIndex++;
+ }
+ }
+ if (ret == NULL)
{
return (pushToken = EOF_TOKEN);
}
configLineNo++;
- configStart = configPos = 0;
+ configPos = 0;
eol_seen = 1;
}
@@ -205,16 +245,13 @@ again:
/* 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 ...
*/
@@ -359,7 +396,6 @@ xf86tokenString (void)
return configRBuf;
}
-#if 1
int
xf86pathIsAbsolute(const char *path)
{
@@ -367,7 +403,7 @@ xf86pathIsAbsolute(const char *path)
return 1;
#ifdef __UNIXOS2__
if (path && (path[0] == '\\' || (path[1] == ':')))
- return 0;
+ return 1;
#endif
return 0;
}
@@ -649,7 +685,6 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
int cmdlineUsed = 0;
configFile = NULL;
- configStart = 0; /* start of the current token */
configPos = 0; /* current readers position */
configLineNo = 0; /* linenumber */
pushToken = LOCK_TOKEN;
@@ -692,178 +727,6 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
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)
@@ -875,8 +738,24 @@ xf86closeConfigFile (void)
xf86conffree (configBuf);
configBuf = NULL;
- fclose (configFile);
- configFile = NULL;
+ if (configFile) {
+ fclose (configFile);
+ configFile = NULL;
+ } else {
+ builtinConfig = NULL;
+ builtinIndex = 0;
+ }
+}
+
+void
+xf86setBuiltinConfig(const char *config[])
+{
+ builtinConfig = config;
+ configPath = xf86configStrdup("<builtin configuration>");
+ configBuf = xf86confmalloc (CONFIG_BUF_LEN);
+ configRBuf = xf86confmalloc (CONFIG_BUF_LEN);
+ configBuf[0] = '\0'; /* sanity ... */
+
}
void
@@ -884,16 +763,6 @@ 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);
@@ -901,8 +770,6 @@ xf86parseError (char *format,...)
va_end (ap);
ErrorF ("\n");
-#endif
-
}
void
@@ -910,16 +777,6 @@ 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);
@@ -927,7 +784,6 @@ xf86parseWarning (char *format,...)
va_end (ap);
ErrorF ("\n");
-#endif
}
void
@@ -935,23 +791,12 @@ 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
diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c
index 1d7472a5c..e096c6247 100644
--- a/hw/xfree86/parser/write.c
+++ b/hw/xfree86/parser/write.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/write.c,v 1.17 2002/09/17 18:54:16 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/write.c,v 1.18 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/* View/edit this file with tab stops set to 4 */
diff --git a/hw/xfree86/parser/xf86Optrec.h b/hw/xfree86/parser/xf86Optrec.h
index 25f91a037..d7a1e7ae5 100644
--- a/hw/xfree86/parser/xf86Optrec.h
+++ b/hw/xfree86/parser/xf86Optrec.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Optrec.h,v 1.10 2001/06/30 04:00:24 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Optrec.h,v 1.11 2003/08/24 17:37:08 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/*
* This file contains the Option Record that is passed between the Parser,
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index ae89005a4..1a30d17a8 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.30 2002/09/16 18:06:16 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.33 2003/10/08 14:58:30 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
/*
* This file contains the external interfaces for the XFree86 configuration
@@ -417,6 +444,7 @@ xf86ConfigSymTabRec, *xf86ConfigSymTabPtr;
*/
extern const char *xf86openConfigFile (const char *, const char *,
const char *);
+extern void xf86setBuiltinConfig(const char *config[]);
extern XF86ConfigPtr xf86readConfigFile (void);
extern void xf86closeConfigFile (void);
extern void xf86freeConfig (XF86ConfigPtr p);
@@ -427,7 +455,6 @@ 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);
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index eb8eab766..387773dc0 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86tokens.h,v 1.19 2003/01/04 20:20:23 paulo Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86tokens.h,v 1.20 2003/08/24 17:37:09 dawes Exp $ */
/*
*
* Copyright (c) 1997 Metro Link Incorporated
@@ -26,6 +26,33 @@
* in this Software without prior written authorization from Metro Link.
*
*/
+/*
+ * Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
#ifndef _xf86_tokens_h
#define _xf86_tokens_h
diff --git a/hw/xfree86/ramdac/BT.c b/hw/xfree86/ramdac/BT.c
index 9ddd3b20b..3b42ecb13 100644
--- a/hw/xfree86/ramdac/BT.c
+++ b/hw/xfree86/ramdac/BT.c
@@ -23,7 +23,7 @@
*
* BT RAMDAC routines.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.c,v 1.7 2000/10/20 12:57:27 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.c,v 1.8 2003/09/24 02:43:35 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -107,7 +107,7 @@ BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/*, RamDacRecP
return NULL;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Attached RAMDAC is %s\n", BTramdacDeviceInfo[BTramdac_ID&0xFFFF]);
+ "Attached RAMDAC is %s\n", BTramdacDeviceInfo[BTramdac_ID&0xFFFF].DeviceName);
}
for (i=0;ramdacs[i].token != -1;i++) {
diff --git a/hw/xfree86/ramdac/IBM.c b/hw/xfree86/ramdac/IBM.c
index d62a9ba56..34562e297 100644
--- a/hw/xfree86/ramdac/IBM.c
+++ b/hw/xfree86/ramdac/IBM.c
@@ -23,7 +23,7 @@
*
* IBM RAMDAC routines.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.c,v 1.12 2003/02/17 16:08:29 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.c,v 1.13 2003/09/24 02:43:35 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -282,7 +282,7 @@ IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/* , RamDacRe
return NULL;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Attached RAMDAC is %s\n", IBMramdacDeviceInfo[IBMramdac_ID&0xFFFF]);
+ "Attached RAMDAC is %s\n", IBMramdacDeviceInfo[IBMramdac_ID&0xFFFF].DeviceName);
}
for (i=0;ramdacs[i].token != -1;i++) {
diff --git a/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c
index 267a13f9f..5e466b707 100644
--- a/hw/xfree86/ramdac/TI.c
+++ b/hw/xfree86/ramdac/TI.c
@@ -24,7 +24,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TI.c,v 1.8 2003/09/24 02:43:35 dawes Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -318,7 +318,7 @@ TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs)
return NULL;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
- "Attached RAMDAC is %s\n", TIramdacDeviceInfo[TIramdac_ID&0xFFFF]);
+ "Attached RAMDAC is %s\n", TIramdacDeviceInfo[TIramdac_ID&0xFFFF].DeviceName);
}
for (i=0;ramdacs[i].token != -1;i++) {
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index e911f8066..41b623a6a 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.12 2003/02/13 20:28:41 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.13 2003/03/04 21:21:15 mvojkovi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -191,6 +191,13 @@ xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
pScreen->devPrivates[xf86CursorScreenIndex].ptr;
xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+#ifdef ARGB_CURSOR
+ /* recoloring isn't applicable to ARGB cursors and drivers
+ shouldn't have to ignore SetCursorColors requests */
+ if (pCurs->bits->argb)
+ return;
+#endif
+
if (ScreenPriv->PalettedCursor) {
xColorItem sourceColor, maskColor;
ColormapPtr pmap = ScreenPriv->pInstalledMap;
diff --git a/hw/xfree86/ramdac/xf86RamDac.c b/hw/xfree86/ramdac/xf86RamDac.c
index 7db16e394..b45be814d 100644
--- a/hw/xfree86/ramdac/xf86RamDac.c
+++ b/hw/xfree86/ramdac/xf86RamDac.c
@@ -23,7 +23,7 @@
*
* Generic RAMDAC access routines.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.c,v 1.6 2000/09/26 15:57:21 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.c,v 1.7 2003/11/03 05:11:53 tsi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -69,8 +69,6 @@ RamDacHelperDestroyInfoRec(RamDacHelperRecPtr infoRec)
Bool
RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv)
{
- RamDacHWRecPtr ramdacHWPtr;
- RamDacRegRecPtr ramdacReg;
RamDacScreenRecPtr ramdacScrPtr;
/*
@@ -78,10 +76,8 @@ RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv)
*/
if (!RamDacGetRec(pScrn))
return FALSE;
- ramdacHWPtr = RAMDACHWPTR(pScrn);
- ramdacReg = &ramdacHWPtr->ModeReg;
- ramdacScrPtr = ((RamDacScreenRecPtr)
- (pScrn)->privates[RamDacGetScreenIndex()].ptr);
+ ramdacScrPtr =
+ ((RamDacScreenRecPtr) (pScrn)->privates[RamDacGetScreenIndex()].ptr);
ramdacScrPtr->RamDacRec = ramdacPriv;
return(TRUE);
@@ -100,8 +96,6 @@ RamDacGetRecPrivate()
Bool
RamDacGetRec(ScrnInfoPtr scrp)
{
- RamDacRegRecPtr regp;
-
RamDacGetRecPrivate();
/*
* New privates are always set to NULL, so we can check if the allocation
@@ -116,8 +110,6 @@ RamDacGetRec(ScrnInfoPtr scrp)
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;
}
diff --git a/hw/xfree86/scanpci/extrapci.ids b/hw/xfree86/scanpci/extrapci.ids
index 926e1a75f..32d96cec8 100644
--- a/hw/xfree86/scanpci/extrapci.ids
+++ b/hw/xfree86/scanpci/extrapci.ids
@@ -14,7 +14,7 @@
# 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 $
+# $XFree86: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.10 2003/10/30 15:29:32 tsi Exp $
#
# Vendors, devices and subsystems. Please keep sorted.
@@ -32,14 +32,13 @@
# xyzw "
# 20ce New Chipset Description
+103c "
+ 12b4 zx1 QuickSilver AGP8x LBA
+
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
-
+126f "
+ 0730 SM731 Cougar3DR
+
diff --git a/hw/xfree86/scanpci/pci.ids b/hw/xfree86/scanpci/pci.ids
index a6bb2fa1c..0d6a460f3 100644
--- a/hw/xfree86/scanpci/pci.ids
+++ b/hw/xfree86/scanpci/pci.ids
@@ -7,7 +7,7 @@
# 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
+# Daily snapshot on Wed 2003-05-14 10:00:04
#
# Vendors, devices and subsystems. Please keep sorted.
@@ -126,7 +126,7 @@
0020 53c1010 Ultra3 SCSI Adapter
1de1 1020 DC-390U3W
0021 53c1010 66MHz Ultra3 SCSI Adapter
- 0030 53c1030
+ 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI
1028 1010 LSI U320 SCSI Controller
0040 53c1035
008f 53c875J
@@ -161,6 +161,7 @@
0017 PROTO-3 PCI Prototyping board
9100 INI-9100/9100W SCSI Host
1002 ATI Technologies Inc
+ 4136 Radeon IGP 320 M
# New support forthcoming in XFree86 4.3.0
4144 Radeon R300 AD [Radeon 9500 Pro]
# New support forthcoming in XFree86 4.3.0
@@ -305,16 +306,18 @@
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]
+ 4e44 Radeon R300 ND [Radeon 9700 Pro]
+ 4e45 Radeon R300 NE [Radeon 9500 Pro]
+ 1002 0002 Radeon R300 NE [Radeon 9500 Pro]
4e46 Radeon R300 NF [Radeon 9700]
# Update: This is FireGL X1, not Radeon 9700
4e47 Radeon R300 NG [FireGL X1]
-# Update
+ 4e48 Radeon R350 [Radeon 9800]
4e64 Radeon R300 [Radeon 9700 Pro] (Secondary)
- 4e65 Radeon R300 [Radeon 9700] (Secondary)
+ 4e65 Radeon R300 [Radeon 9500 Pro] (Secondary)
4e66 Radeon R300 [Radeon 9700] (Secondary)
4e67 Radeon R300 [FireGL X1] (Secondary)
+ 4e68 Radeon R350 [Radeon 9800] (Secondary)
5041 Rage 128 PA/PRO
5042 Rage 128 PB/PRO AGP 2x
5043 Rage 128 PC/PRO AGP 4x
@@ -438,6 +441,7 @@
1002 0088 Xpert 99
5345 Rage 128 SE/4x
5346 Rage 128 SF/4x AGP 2x
+ 1002 0048 RAGE 128 16MB VGA TVOUT AMC PAL
5347 Rage 128 SG/4x AGP 4x
5348 Rage 128 SH
534b Rage 128 SK/4x
@@ -468,7 +472,9 @@
1002 5654 Mach64VT Reference
5655 264VT3 [Mach64 VT3]
5656 264VT4 [Mach64 VT4]
- 700f U1/A3 AGP Bridge [IGP 320M]
+ 700f PCI Bridge [IGP 320M]
+ 7010 PCI Bridge [IGP 340M]
+ cab2 RS200/RS200M AGP Bridge [IGP 340M]
1003 ULSI Systems
0201 US201
1004 VLSI Technology Inc
@@ -574,6 +580,7 @@
0014 DECchip 21041 [Tulip Pass 3]
1186 0100 DE-530+
0016 DGLPB [OPPO]
+ 0017 PV-PCI Graphics Controller (ZLXp-L)
0019 DECchip 21142/43
1011 500a DE500A Fast Ethernet
1011 500b DE500B Fast Ethernet
@@ -977,13 +984,15 @@
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
+ 0007 Remote Access Controller:DRAC III
+ 0008 Remote Access Controller
+ 0009 BMC/SMIC device not present
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
+ 000c Remote Access Controller:ERA or ERA/O
+ 000d BMC/SMIC device
000e PowerEdge Expandable RAID Controller
000f PowerEdge Expandable RAID Controller 4/Di
1029 Siemens Nixdorf IS
@@ -993,6 +1002,7 @@
102b Matrox Graphics, Inc.
# DJ: I've a suspicion that 0010 is a duplicate of 0d10.
0010 MGA-I [Impression?]
+ 0100 MGA 1064SG [Mystique]
0518 MGA-II [Athena]
0519 MGA 2064W [Millennium]
051a MGA 1064SG [Mystique]
@@ -1225,6 +1235,7 @@
0635 635 Host
0645 SiS645 Host & Memory & AGP Controller
0646 SiS645DX Host & Memory & AGP Controller
+ 0648 SiS 645xx
0650 650 Host
0651 SiS651 Host
0730 730 Host
@@ -1232,6 +1243,7 @@
0735 735 Host
0740 740 Host
0745 745 Host
+ 0755 SiS 755 Host Bridge
0900 SiS900 10/100 Ethernet
1039 0900 SiS900 10/100 Ethernet Adapter
0961 SiS961 [MuTIOL Media IO]
@@ -1268,14 +1280,14 @@
1092 4910 SpeedStar A70
1092 4920 SpeedStar A70
1569 6326 SiS6326 GUI Accelerator
- 7001 SiS7001 USB Controller
+ 7001 USB 1.0 Controller
1039 7000 Onboard USB Controller
- 7002 SiS7002 USB 2.0
+ 7002 USB 2.0 Controller
1509 7002 Onboard USB Controller
7007 FireWire Controller
- 7012 SiS7012 PCI Audio Accelerator
+ 7012 Sound Controller
7013 Intel 537 [56k Winmodem]
- 7016 SiS7016 10/100 Ethernet Adapter
+ 7016 10/100 Ethernet Adapter
1039 7016 SiS7016 10/100 Ethernet Adapter
7018 SiS PCI Audio Accelerator
1014 01b6 SiS PCI Audio Accelerator
@@ -1352,8 +1364,8 @@
1040 Accelgraphics Inc.
1041 Computrend
1042 Micron
- 1000 FDC 37C665
- 1001 37C922
+ 1000 PC Tech RZ1000
+ 1001 PC Tech RZ1001
3000 Samurai_0
3010 Samurai_1
3020 Samurai_IDE
@@ -1616,6 +1628,7 @@
105a 4d39 Fasttrak66
1275 20275
3376 PDC20376
+ 1043 809e A7V8X motherboard
4d30 20267
105a 4d33 Ultra100
105a 4d39 Fasttrak100
@@ -1628,6 +1641,7 @@
4d68 20268
105a 4d68 Ultra100TX2
4d69 20269
+ 105a 4d68 Ultra133TX2
5275 PDC20276 IDE
105a 0275 SuperTrak SX6000 IDE
5300 DC5300
@@ -1672,6 +1686,7 @@
13cc 0009 Barco Metheus 5 Megapixel, Dual Head
13cc 000a Barco Metheus 5 Megapixel, Dual Head
5348 Revolution 4
+ 105d 0037 Revolution IV-FP AGP (For SGI 1600SW)
105e Vtech Computers Ltd
105f Infotronic America Inc
1060 United Microelectronics [UMC]
@@ -1810,6 +1825,7 @@
2100 QLA2100 64-bit Fibre Channel Adapter
1077 0001 QLA2100 64-bit Fibre Channel Adapter
2200 QLA2200
+ 1077 0002 QLA2200
2300 QLA2300 64-bit FC-AL Adapter
2312 QLA2312 Fibre Channel Adapter
1078 Cyrix Corporation
@@ -1961,6 +1977,7 @@
c831 PCI-GPIB bridge
1094 First International Computers [FIC]
1095 CMD Technology Inc
+ 0240 Adaptec AAR-1210SA SATA HostRAID Controller
0640 PCI0640
0643 PCI0643
0646 PCI0646
@@ -2109,6 +2126,7 @@
10a3 Everex Systems Inc
10a4 Globe Manufacturing Sales
10a5 Smart Link Ltd.
+ 3052 SmartPCI562 56K Modem
5449 SmartPCI561 modem
10a6 Informtech Industrial Ltd.
10a7 Benchmarq Microelectronics
@@ -2124,6 +2142,7 @@
0007 RPCEX
0008 DiVO VIP
0009 Alteon Gigabit Ethernet
+ 10a9 8002 Acenic Gigabit Ethernet
0010 AMP Video I/O
0011 GRIP
0012 SGH PSHAC GSN
@@ -2135,6 +2154,7 @@
1006 Dual JPEG 4
1007 Dual JPEG 5
1008 Cesium
+ 100a IOC4 I/O controller
2001 Fibre Channel
2002 ASDE
8001 O2 1394
@@ -2209,6 +2229,7 @@
d84d 4078 EX-4078 2S(16C552) RS-232+1P
9054 PCI <-> IOBus Bridge
10b5 2455 Wessex Techology PHIL-PCI
+ 12d9 0002 PCI Prosody Card rev 1.5
9060 9060
906d 9060SD
125c 0640 Aries 16000P
@@ -2216,6 +2237,7 @@
9080 9080
10b5 9080 9080 [real subsystem ID not set]
129d 0002 Aculab PCI Prosidy card
+ 12d9 0002 PCI Prosody Card
10b6 Madge Networks
0001 Smart 16/4 PCI Ringnode
0002 Smart 16/4 PCI Ringnode Mk2
@@ -2243,6 +2265,7 @@
1001 Collage 155 ATM Server Adapter
10b7 3Com Corporation
0001 3c985 1000BaseSX (SX/TX)
+ 0910 3C910-A01
1006 MINI PCI type 3B Data Fax Modem
1007 Mini PCI 56k Winmodem
10b7 615c Mini PCI 56K Modem
@@ -2423,6 +2446,7 @@
5251 M5251 P1394 OHCI 1.0 Controller
5253 M5253 P1394 OHCI 1.1 Controller
5261 M5261 Ethernet Controller
+ 5450 Lucent Technologies Soft Modem AMR
5451 M5451 PCI AC-Link Controller Audio Device
1014 0506 ThinkPad R30
5453 M5453 PCI AC-Link Controller Modem Device
@@ -2568,6 +2592,7 @@
1043 0201 AGP-V3800 SDRAM
1043 0205 PCI-V3800
1043 4000 AGP-V3800PRO
+ 1048 0c21 Synergy II
1092 4804 Viper V770
1092 4a00 Viper V770
1092 4a02 Viper V770 Ultra
@@ -2656,6 +2681,7 @@
0153 NV15GL [Quadro2 Pro]
0170 NV17 [GeForce4 MX 460]
0171 NV17 [GeForce4 MX 440]
+ 10b0 0002 Gainward Pro/600 TV
1462 8661 G4MX440-VTP
1462 8730 MX440SES-T (MS-8873)
147b 8f00 Abit Siluro GeForce4MX440
@@ -2870,6 +2896,8 @@
1102 8040 CT4760 SBLive!
1102 8051 CT4850 SBLive! Value
1102 8061 SBLive! Player 5.1
+ 1102 8064 SB Live! 5.1 Model SB0100
+ 1102 8065 SBLive! 5.1 Digital Model SB0220
0004 SB Audigy
1102 0051 SB0090 Audigy Player
1102 0053 SB0090 Audigy Player/OEM
@@ -2882,7 +2910,7 @@
1102 0040 SB Audigy MIDI/Game Port
7004 [SB Live! Value] Input device controller
8064 SB0100 [SBLive! 5.1 OEM]
- 8938 ES1371
+ 8938 Ectiva EV1938
1103 Triones Technologies, Inc.
0003 HPT343
# Revisions: 01=HPT366, 03=HPT370, 04=HPT370A, 05=HPT372
@@ -2893,6 +2921,7 @@
0006 HPT302
0007 HPT371
0008 HPT374
+ 0009 HPT372N
1104 RasterOps Corp.
1105 Sigma Designs, Inc.
1105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder
@@ -2909,10 +2938,13 @@
0391 VT8371 [KX133]
0501 VT8501 [Apollo MVP4]
0505 VT82C505
- 0561 VT82C561
- 0571 VT82C586/B/686A/B PIPC Bus Master IDE
+# Shares chip with :0576. The VT82C576M has :1571 instead of :0561.
+ 0561 VT82C576MV
+ 0571 VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
+ 1019 0985 P6VXA Motherboard
1043 8052 VT8233A Bus Master ATA100/66/33 IDE
- 1106 0571 VT8235 Bus Master ATA133/100/66/33 IDE
+ 1043 808c A7V8X motherboard
+ 1106 0571 VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
1179 0001 Magnia Z310
1458 5002 GA-7VAX Mainboard
0576 VT82C576 3V [Apollo Master]
@@ -2927,8 +2959,11 @@
0598 VT82C598 [Apollo MVP3]
0601 VT8601 [Apollo ProMedia]
0605 VT8605 [ProSavage PM133]
+ 1043 802c CUV4X mainboard
0680 VT82C680 [Apollo P6]
0686 VT82C686 [Apollo Super South]
+ 1019 0985 P6VXA Motherboard
+ 1043 802c CUV4X mainboard
1043 8033 A7V Mainboard
1043 803e A7V-E Mainboard
1043 8040 A7M266 Mainboard
@@ -2938,6 +2973,7 @@
1179 0001 Magnia Z310
147b a702 KG7-Lite Mainboard
0691 VT82C693A/694x [Apollo PRO133x]
+ 1019 0985 P6VXA Motherboard
1179 0001 Magnia Z310
1458 0691 VT82C691 Apollo Pro System Controller
0693 VT82C693 [Apollo Pro Plus]
@@ -2945,10 +2981,12 @@
0926 VT82C926 [Amazon]
1000 VT82C570MV
1106 VT82C570MV
- 1571 VT82C416MV
+ 1571 VT82C576M/VT82C586
1595 VT82C595/97 [Apollo VP2/97]
3038 USB
0925 1234 USB Controller
+ 1019 0985 P6VXA Motherboard
+ 1043 808c A7V8X motherboard
1179 0001 Magnia Z310
3040 VT82C586B ACPI
3043 VT86C100A [Rhine]
@@ -2959,6 +2997,7 @@
3050 VT82C596 Power Management
3051 VT82C596 Power Management
3057 VT82C686 [Apollo Super ACPI]
+ 1019 0985 P6VXA Motherboard
1043 8033 A7V Mainboard
1043 803e A7V-E Mainboard
1043 8040 A7M266 Mainboard
@@ -2966,16 +3005,19 @@
1179 0001 Magnia Z310
3058 VT82C686 AC97 Audio Controller
0e11 b194 Soundmax integrated digital audio
+ 1019 0985 P6VXA Motherboard
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
+ 3059 VT8233/A/8235 AC97 Audio Controller
+ 1043 8095 A7V8X Motherboard (Realtek ALC650 codec)
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
+ 13b9 1421 LD-10/100AL PCI Fast Ethernet Adapter (rev.B)
3068 Intel 537 [AC97 Modem]
3074 VT8233 PCI to ISA Bridge
1043 8052 VT8233A
@@ -2987,11 +3029,12 @@
3102 VT8662 Host Bridge
3103 VT8615 Host Bridge
3104 USB 2.0
+ 1043 808c A7V8X motherboard
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
+ 3116 VT8375 [KM266/KL266] Host Bridge
# found on EPIA M6000/9000 mainboard
3122 VT8623 [Apollo CLE266] integrated CastleRock graphics
# found on EPIA M6000/9000 mainboard
@@ -3003,8 +3046,10 @@
3156 P/KN266 Host Bridge
3168 VT8374 P4X400 Host Controller/AGP Bridge
3177 VT8235 ISA Bridge
+ 1043 808c A7V8X motherboard
1458 5001 GA-7VAX Mainboard
3189 VT8377 [KT400 AGP] Host Bridge
+ 1043 807f A7V8X motherboard
1458 5000 GA-7VAX Mainboard
5030 VT82C596 ACPI [Apollo PRO]
6100 VT85C100A [Rhine II]
@@ -3016,6 +3061,7 @@
8596 VT82C596 [Apollo PRO AGP]
8597 VT82C597 [Apollo VP3 AGP]
8598 VT82C598/694x [Apollo MVP3/Pro133x AGP]
+ 1019 0985 P6VXA Motherboard
8601 VT8601 [Apollo ProMedia AGP]
8605 VT8605 [PM133 AGP]
8691 VT82C691 [Apollo Pro]
@@ -3043,6 +3089,12 @@
110a Siemens Nixdorf AG
0002 Pirahna 2-port
0005 Tulip controller, power management, switch extender
+ 0006 FSC PINC (I/O-APIC)
+ 0015 FSC Multiprocessor Interrupt Controller
+ 001d FSC Copernicus Management Controller
+ 007b FSC Remote Service Controller, mailbox device
+ 007c FSC Remote Service Controller, shared memory device
+ 007d FSC Remote Service Controller, SMIC device
2102 DSCC4 WAN adapter
4942 FPGA I-Bus Tracer for MBD
6120 SZB6120
@@ -3461,6 +3513,7 @@
0001 Motion TPEG Recorder/Player with audio
1166 ServerWorks
0005 CNB20-LE Host Bridge
+ 0006 CNB20HE Host Bridge
0007 CNB20-LE Host Bridge
0008 CNB20HE Host Bridge
0009 CNB20LE Host Bridge
@@ -3733,6 +3786,7 @@
0443 LT WinModem
0444 LT WinModem
0445 LT WinModem
+ 8086 2203 PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)
0446 LT WinModem
0447 LT WinModem
0448 WinModem 56k
@@ -4164,6 +4218,7 @@
1668 0414 HWP01170-01 802.11b PCI Wireless Adapter
1737 3874 WMP11 Wireless 802.11b PCI Adapter
8086 2513 Wireless 802.11b MiniPCI Adapter
+ 3890 D-Links DWL-g650 A1
8130 HMP8130 NTSC/PAL Video Decoder
8131 HMP8131 NTSC/PAL Video Decoder
1261 Matsushita-Kotobuki Electronics Industries, Ltd.
@@ -4199,6 +4254,7 @@
1273 Hughes Network Systems
0002 DirecPC
1274 Ensoniq
+ 1171 ES1373 [AudioPCI] (also Creative Labs CT5803)
1371 ES1371 [AudioPCI-97]
0e11 0024 AudioPCI on Motherboard Compaq Deskpro
0e11 b1a7 ES1371, ES1373 AudioPCI
@@ -4268,6 +4324,7 @@
1277 Comstream
1278 Transtech Parallel Systems Ltd.
0701 TPE3/TM3 PowerPC Node
+ 0710 TPE5 PowerPC PCI board
1279 Transmeta Corporation
0295 Northbridge
0395 LongRun Northbridge
@@ -4463,6 +4520,7 @@
12ae 0001 Gigabit Ethernet-SX (Universal)
1410 0104 Gigabit Ethernet-SX PCI Adapter
0002 AceNIC Gigabit Ethernet (Copper)
+ 10a9 8002 Acenic Gigabit Ethernet
12ae 0002 Gigabit Ethernet-T (3C986-T)
12af TDK USA Corp
12b0 Jorge Scientific Corp
@@ -4557,11 +4615,14 @@
00a0 ITNT2
12d3 Vingmed Sound A/S
12d4 Ulticom (Formerly DGM&S)
+ 0200 T1 Card
12d5 Equator Technologies
12d6 Analogic Corp
12d7 Biotronic SRL
12d8 Pericom Semiconductor
12d9 Aculab PLC
+ 0002 PCI Prosody
+ 0004 cPCI Prosody
12da True Time Inc.
12db Annapolis Micro Systems, Inc
12dc Symicron Computer Communication Ltd.
@@ -4679,6 +4740,7 @@
0036 PCI-DAS64/M2/16
0037 PCI-DAS64/M3/16
004c PCI-DAS1000
+ 004d PCI-QUAD04
1308 Jato Technologies Inc.
0001 NetCelerator Adapter
1308 0001 NetCelerator Adapter
@@ -4766,6 +4828,7 @@
1331 Radisys Corp.
1332 Micro Memory
5415 MM-5415CN PCI Memory Module with Battery Backup
+ 5425 MM-5425CN PCI 64/66 Memory Module with Battery Backup
1334 Redcreek Communications, Inc
1335 Videomail, Inc
1337 Third Planet Publishing
@@ -4875,6 +4938,7 @@
1384 Reality Simulation Systems Inc
1385 Netgear
4100 802.11b Wireless Adapter (MA301)
+ 4105 MA311 802.11b wireless adapter
620a GA620
622a GA622
630a GA630
@@ -5011,7 +5075,7 @@
13e6 Argosy research Inc
13e7 NAC Incorporated
13e8 Chip Express Corporation
-13e9 Chip Express Corporation
+13e9 Intraserver Technology Inc
13ea Dallas Semiconductor
13eb Hauppauge Computer Works Inc
13ec Zydacron Inc
@@ -5036,6 +5100,7 @@
1043 8077 CMI8738 6-channel audio controller
1043 80e2 CMI8738 6ch-MX
13f6 0111 CMI8738/C3DX PCI Audio Device
+ 1681 a000 Gamesurround MUSE XL
0211 CM8738
13f7 Wildfire Communications
13f8 Ad Lib Multimedia Inc
@@ -5191,6 +5256,7 @@
146a IFR
146b Parascan Technologies Ltd
146c Ruby Tech Corp.
+ 1430 FE-1430TX Fast Ethernet PCI Adapter
146d Tachyon, INC.
146e Williams Electronics Games, Inc.
146f Multi Dimensional Consulting Inc
@@ -5241,6 +5307,7 @@
149b SEIKO Instruments Inc
149c OVISLINK Corp.
149d NEWTEK Inc
+ 0001 Video Toaster for PC
149e Mapletree Networks Inc.
149f LECTRON Co Ltd
14a0 SOFTING GmBH
@@ -5383,6 +5450,9 @@
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
+ 10a9 8010 SGI IO9 Gigabit Ethernet (Copper)
+ 10a9 8011 SGI Gigabit Ethernet (Copper)
+ 10a9 8012 SGI Gigabit Ethernet (Fiber)
10b7 1004 3C996-SX 1000Base-SX
10b7 1006 3C996B-T 1000Base-T
10b7 1007 3C1000-T 1000Base-T
@@ -5400,6 +5470,7 @@
1647 NetXtreme BCM5703 Gigabit Ethernet
0e11 0099 NC7780 1000BaseTX
0e11 009a NC7770 1000BaseTX
+ 10a9 8010 SGI IO9 Gigabit Ethernet (Copper)
14e4 0009 BCM5703 1000BaseTX
14e4 000a BCM5703 1000BaseSX
14e4 000b BCM5703 1000BaseTX
@@ -5417,6 +5488,7 @@
165d NetXtreme BCM5705M Gigabit Ethernet
1696 NetXtreme BCM5782 Gigabit Ethernet
14e4 000d NetXtreme BCM5782 1000Base-T
+ 169c NetXtreme BCM5788 Gigabit Ethernet
16a6 NetXtreme BCM5702 Gigabit Ethernet
0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
1028 0126 BCM5702 1000Base-T
@@ -5442,7 +5514,9 @@
4211 BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem
4212 BCM4212 v.90 56k modem
4301 BCM4301 802.11b
+ 4320 BCM94306 802.11g
4401 BCM4401 100Base-T
+ 1043 80a8 A7V8X motherboard
4402 BCM4402 Integrated 10/100BaseT
4410 BCM4413 iLine32 HomePNA 2.0
4411 BCM4413 V.90 56k modem
@@ -5531,6 +5605,9 @@
122d 4302 Dell MP3930V-W(C) MiniPCI
1610 ADSL AccessRunner PCI Arbitration Device
1611 AccessRunner PCI ADSL Interface Device
+ 1620 ADSL AccessRunner V2 PCI Arbitration Device
+ 1621 AccessRunner V2 PCI ADSL Interface Device
+ 1622 AccessRunner V2 PCI ADSL Yukon WAN Adapter
1803 HCF 56k Modem
0e11 0023 623-LAN Grizzly
0e11 0043 623-LAN Yogi
@@ -5945,6 +6022,7 @@
1638 Standard Microsystems Corp [SMC]
1100 SMC2602W EZConnect / Addtron AWA-100
163c Smart Link Ltd.
+ 3052 SmartLink SmartPCI562 56K Modem
5449 SmartPCI561 Modem
1657 Brocade Communications Systems, Inc.
165a Epix Inc
@@ -5958,6 +6036,8 @@
16ab Global Sun Technology Inc
1102 PCMCIA-to-PCI Wireless Network Bridge
16be Creatix Polymedia GmbH
+16ca CENATEK Inc
+ 0001 Rocket Drive DL
16ec U.S. Robotics
3685 Wireless Access PCI Adapter Model 022415
16f6 VideoTele.com, Inc.
@@ -6011,6 +6091,8 @@
2020 DC-390
690c 690c
dc29 DC290
+1fc0 Tumsan Oy
+ 0300 E2200 Dual E1/Rawpipe Card
2000 Smart Link Ltd.
2001 Temporal Research Ltd
2003 Smart Link Ltd.
@@ -6029,6 +6111,8 @@
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
+ 101a E.Band [AudioTrak Inca88]
+ 101b E.Band [AudioTrak Inca88]
8011 VXPro II Chipset
3388 8011 VXPro II Chipset CPU to PCI Bridge
8012 VXPro II Chipset
@@ -6259,7 +6343,7 @@
8d01 86C380 [ProSavageDDR K4M266]
8d02 VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)
8d03 VT8751 [ProSavageDDR P4M266]
- 8d04 [ProSavageDDR K4M266]
+ 8d04 VT8375 [ProSavage8 KM266/KL266]
9102 86C410 Savage 2000
1092 5932 Viper II Z200
1092 5934 Viper II Z200
@@ -6271,6 +6355,7 @@
1092 5a57 Viper II Z200
ca00 SonicVibes
544c Teralogic Inc
+ 0350 TL880-based HDTV/ATSC tuner
5455 Technische University Berlin
4458 S5933
5519 Cnet Technologies, Inc.
@@ -6377,15 +6462,20 @@
103e 82801BD PRO/100 VM (MOB) Ethernet Controller
1040 536EP Data Fax Modem
16be 1040 V.9X DSP Data Fax Modem
+ 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter
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
+ 8086 4532 D815EEA2 mainboard
+ 8086 4557 D815EGEW Mainboard
1131 82815 815 Chipset AGP Bridge
1132 82815 CGC [Chipset Graphics Controller]
1025 1016 Travelmate 612 TX
104d 80df Vaio PCG-FX403
+ 8086 4532 D815EEA2 Mainboard
+ 8086 4557 D815EGEW Mainboard
1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller
8086 1161 82806AA PCI64 Hub APIC
1162 Xscale 80200 Big Endian Companion Chip
@@ -6626,22 +6716,28 @@
1025 1016 Travelmate 612 TX
104d 80df Vaio PCG-FX403
147b 0507 TH7II-RAID
+ 8086 4532 D815EEA2 mainboard
+ 8086 4557 D815EGEW Mainboard
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
+ 8086 4532 D815EEA2 mainboard
+ 8086 4557 D815EGEW Mainboard
2444 82801BA/BAM USB (Hub #2)
1025 1016 Travelmate 612 TX
104d 80df Vaio PCG-FX403
147b 0507 TH7II-RAID
+ 8086 4532 D815EEA2 mainboard
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
+ 8086 4557 D815EGEW Mainboard
2446 Intel 537 [82801BA/BAM AC'97 Modem]
1025 1016 Travelmate 612 TX
104d 80df Vaio PCG-FX403
@@ -6660,8 +6756,12 @@
1014 023d EtherExpress PRO/100 VE
1014 0244 EtherExpress PRO/100 VE
1014 0245 EtherExpress PRO/100 VE
+ 1014 0265 PRO/100 VE Desktop Connection
+ 1014 0267 PRO/100 VE Desktop Connection
+ 1014 026a PRO/100 VE Desktop Connection
109f 315d EtherExpress PRO/100 VE
109f 3181 EtherExpress PRO/100 VE
+ 1179 ff01 PRO/100 VE Network Connection
1186 7801 EtherExpress PRO/100 VE
144d 2602 HomePNA 1M CNR
8086 3010 EtherExpress PRO/100 VE
@@ -6680,8 +6780,10 @@
1014 01c6 Netvista A40/A40p
1043 8027 TUSL2-C Mainboard
147b 0507 TH7II-RAID
+ 8086 4532 D815EEA2 mainboard
+ 8086 4557 D815EGEW Mainboard
244c 82801BAM ISA Bridge (LPC)
- 244e 82801BA/CA/DB PCI Bridge
+ 244e 82801BA/CA/DB/EB PCI Bridge
2450 82801E ISA Bridge (LPC)
2452 82801E USB
2453 82801E SMBus
@@ -6689,13 +6791,13 @@
245b 82801E IDE U100
245d 82801E Ethernet Controller 1
245e 82801E PCI Bridge
- 2480 82801CA ISA Bridge (LPC)
+ 2480 82801CA LPC Interface Controller
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
+ 2483 82801CA/CAM SMBus Controller
1014 0220 ThinkPad A/T/X Series
104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
15d9 3480 P4DP6
@@ -6705,13 +6807,13 @@
104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
15d9 3480 P4DP6
8086 1958 vpr Matrix 170B4
- 2485 82801CA/CAM AC'97 Audio
+ 2485 82801CA/CAM AC'97 Audio Controller
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
+ 2486 82801CA/CAM AC'97 Modem Controller
1014 0223 ThinkPad A/T/X Series
1014 0503 ThinkPad R31 2656BBG
1014 051a ThinkPad A/T/X Series
@@ -6729,26 +6831,40 @@
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
+ 248b 82801CA Ultra ATA Storage Controller
15d9 3480 P4DP6
248c 82801CAM ISA Bridge (LPC)
- 24c0 82801DB ISA Bridge (LPC)
+ 24c0 82801DB LPC Interface Controller
1462 5800 845PE Max (MS-6580)
24c2 82801DB USB (Hub #1)
1462 5800 845PE Max (MS-6580)
- 24c3 82801DB SMBus
+ 24c3 82801DB/DBM SMBus Controller
1462 5800 845PE Max (MS-6580)
24c4 82801DB USB (Hub #2)
1462 5800 845PE Max (MS-6580)
- 24c5 82801DB AC'97 Audio
+ 24c5 82801DB AC'97 Audio Controller
1462 5800 845PE Max (MS-6580)
- 24c6 82801DB AC'97 Modem
+ 24c6 82801DB AC'97 Modem Controller
24c7 82801DB USB (Hub #3)
1462 5800 845PE Max (MS-6580)
- 24cb 82801DB ICH4 IDE
+ 24ca 82801DBM Ultra ATA Storage Controller
+ 24cb 82801DB Ultra ATA Storage Controller
1462 5800 845PE Max (MS-6580)
- 24cd 82801DB USB EHCI Controller
+ 24cc 82801DBM LPC Interface Controller
+ 24cd 82801DB USB2
1462 3981 845PE Max (MS-6580) Onboard USB EHCI Controller
+ 24d0 82801EB LPC Interface Controller
+ 24d1 82801EB Ultra ATA Storage Controller
+ 24d2 82801EB USB
+ 24d3 82801EB SMBus Controller
+ 24d4 82801EB USB
+ 24d5 82801EB AC'97 Audio Controller
+ 24d6 82801EB AC'97 Modem Controller
+ 24d7 82801EB USB
+ 24db 82801EB Ultra ATA Storage Controller
+ 24dc 82801EB LPC Interface Controller
+ 24dd 82801EB USB2
+ 24de 82801EB USB
2500 82820 820 (Camino) Chipset Host Bridge (MCH)
1028 0095 Precision Workstation 220 Chipset
1043 801c P3C-2000 system chipset
@@ -6764,21 +6880,39 @@
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
+ 2540 E7500 Memory Controller Hub
15d9 3480 P4DP6
- 2541 e7500 [Plumas] DRAM Controller Error Reporting
+ 2541 E7000 Series Host RASUM Controller
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)
+ 2543 E7000 Series Hub Interface B PCI-to-PCI Bridge
+ 2544 E7000 Series Hub Interface B RASUM Controller
+ 2545 E7000 Series Hub Interface C PCI-to-PCI Bridge
+ 2546 E7000 Series Hub Interface C RASUM Controller
+ 2547 E7000 Series Hub Interface D PCI-to-PCI Bridge
+ 2548 E7000 Series Hub Interface D RASUM Controller
+ 254c E7501 Memory Controller Hub
+ 2550 E7505 Memory Controller Hub
+ 2551 E7000 Series RAS Controller
+ 2552 E7000 Series Processor to AGP Controller
+ 2553 E7000 Series Hub Interface B PCI-to-PCI Bridge
+ 2554 E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller
+ 255d E7205 Memory Controller Hub
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
+ 2570 82865G/PE/P Processor to I/O Controller
+ 2571 82865G/PE/P Processor to AGP Controller
+ 2572 82865G Integrated Graphics Device
+ 2573 82865G/PE/P Processor to PCI to CSA Bridge
+ 2576 82864G/PE/P Processor to I/O Memory Interface
+ 2578 82875P Memory Controller Hub
+ 2579 82875P Processor to AGP Controller
+ 257b 82875P Processor to PCI to CSA Bridge
+ 257e 82875P Processor to I/O Memory Interface
3092 Integrated RAID
+ 3340 82855PM Processor to I/O Controller
+ 3341 82855PM Processor to AGP Controller
3575 82830 830 Chipset Host Bridge
1014 021d ThinkPad A/T/X Series
104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
@@ -6786,6 +6920,8 @@
3577 82830 CGC [Chipset Graphics Controller]
1014 0513 ThinkPad A/T/X Series
3578 82830 830 Chipset Host Bridge
+ 3580 82852/855GM Host Bridge
+ 3582 82852/855GM Integrated Graphics Device
5200 EtherExpress PRO/100 Intelligent Server
5201 EtherExpress PRO/100 Intelligent Server
8086 0001 EtherExpress PRO/100 Server Ethernet Adapter
@@ -6801,6 +6937,7 @@
7113 82371AB/EB/MB PIIX4 ACPI
7120 82810 GMCH [Graphics Memory Controller Hub]
7121 82810 CGC [Chipset Graphics Controller]
+ 8086 4341 Cayman (CA810) Mainboard
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]
@@ -6889,9 +7026,6 @@
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
@@ -6933,6 +7067,8 @@
7478 AHA-2944/2944W / AIC-7874
7578 AHA-3944/3944W / AIC-7875
7678 AHA-4944W/UW / AIC-7876
+ 7710 ANA-7711F Network Accelerator Card (NAC) - Optical
+ 7711 ANA-7711C Network Accelerator Card (NAC) - Copper
7778 AIC-787x
7810 AIC-7810
7815 AIC-7815 RAID+Memory Controller IC
@@ -7038,11 +7174,18 @@
8014 ASC-29320LP U320
801e AIC-7901A U320
801f AIC-7902 U320
+ 8080 ASC-29320A U320 w/HostRAID
+ 808f AIC-7901 U320 w/HostRAID
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
+ 8095 ASC-39320(B) U320 w/HostRAID
+ 8096 ASC-39320A U320 w/HostRAID
+ 8097 ASC-29320ALP U320 w/HostRAID
+ 809c ASC-39320D(B) U320 w/HostRAID
+ 809d AIC-7902(B) U320 w/HostRAID
809e AIC-7901A U320 w/HostRAID
809f AIC-7902 U320 w/HostRAID
907f Atronics
diff --git a/hw/xfree86/scanpci/pciid2c.pl b/hw/xfree86/scanpci/pciid2c.pl
index a43bc5be6..71586d421 100644
--- a/hw/xfree86/scanpci/pciid2c.pl
+++ b/hw/xfree86/scanpci/pciid2c.pl
@@ -10,9 +10,34 @@
#
# Copyright © 2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+# and 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 copyright holder(s) and author(s).
+#
+
+#
# Author: David Dawes
#
-# $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/pciid2c.pl,v 1.2 2002/12/23 16:45:19 tsi Exp $
+# $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/pciid2c.pl,v 1.3 2003/08/24 17:37:10 dawes Exp $
#
if (@ARGV[0]) {
diff --git a/hw/xfree86/scanpci/xf86PciData.h b/hw/xfree86/scanpci/xf86PciData.h
index 0fa21b6db..2253de8e5 100644
--- a/hw/xfree86/scanpci/xf86PciData.h
+++ b/hw/xfree86/scanpci/xf86PciData.h
@@ -1,6 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.2 2002/07/15 20:46:02 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */
+/*
+ * Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef PCI_DATA_H_
#define PCI_DATA_H_
diff --git a/hw/xfree86/scanpci/xf86PciStdIds.h b/hw/xfree86/scanpci/xf86PciStdIds.h
index 58403ccf7..ff8f3d14a 100644
--- a/hw/xfree86/scanpci/xf86PciStdIds.h
+++ b/hw/xfree86/scanpci/xf86PciStdIds.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStdIds.h,v 1.10 2003/02/26 16:33:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStdIds.h,v 1.14 2003/10/30 15:26:34 tsi Exp $ */
/*
* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
@@ -189,7 +189,7 @@ static const char pci_device_1000_0020[] = "53c1010 Ultra3 SCSI Adapter";
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";
+static const char pci_device_1000_0030[] = "53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI";
#endif
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1000_0030_1028_1010[] = "LSI U320 SCSI Controller";
@@ -253,6 +253,7 @@ 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_4136[] = "Radeon IGP 320 M";
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]";
@@ -537,14 +538,19 @@ static const char pci_device_1002_4c66[] = "Radeon R250 Lf [Radeon Mobility 9000
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_4e44[] = "Radeon R300 ND [Radeon 9700 Pro]";
+static const char pci_device_1002_4e45[] = "Radeon R300 NE [Radeon 9500 Pro]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4e45_1002_0002[] = "Radeon R300 NE [Radeon 9500 Pro]";
+#endif
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_4e48[] = "Radeon R350 [Radeon 9800]";
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_4e65[] = "Radeon R300 [Radeon 9500 Pro] (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_4e68[] = "Radeon R350 [Radeon 9800] (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";
@@ -789,6 +795,9 @@ 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";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5346_1002_0048[] = "RAGE 128 16MB VGA TVOUT AMC PAL";
+#endif
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";
@@ -847,7 +856,9 @@ 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]";
+static const char pci_device_1002_700f[] = "PCI Bridge [IGP 320M]";
+static const char pci_device_1002_7010[] = "PCI Bridge [IGP 340M]";
+static const char pci_device_1002_cab2[] = "RS200/RS200M AGP Bridge [IGP 340M]";
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_1003[] = "ULSI Systems";
static const char pci_device_1003_0201[] = "US201";
@@ -1021,6 +1032,7 @@ static const char pci_device_1011_0014[] = "DECchip 21041 [Tulip Pass 3]";
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_0017[] = "PV-PCI Graphics Controller (ZLXp-L)";
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";
@@ -1716,8 +1728,9 @@ static const char pci_subsys_1028_0004_1028_00d0[] = "PowerEdge Expandable RAID
#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_0007[] = "Remote Access Controller:DRAC III";
+static const char pci_device_1028_0008[] = "Remote Access Controller";
+static const char pci_device_1028_0009[] = "BMC/SMIC device not present";
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";
@@ -1728,7 +1741,8 @@ static const char pci_subsys_1028_000a_1028_011b[] = "PowerEdge Expandable RAID
#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_000c[] = "Remote Access Controller:ERA or ERA/O";
+static const char pci_device_1028_000d[] = "BMC/SMIC device";
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
@@ -1741,6 +1755,7 @@ 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_0100[] = "MGA 1064SG [Mystique]";
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]";
@@ -2244,6 +2259,7 @@ 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_0648[] = "SiS 645xx";
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";
@@ -2251,6 +2267,7 @@ 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_0755[] = "SiS 755 Host Bridge";
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";
@@ -2309,18 +2326,18 @@ static const char pci_subsys_1039_6326_1092_4920[] = "SpeedStar A70";
#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";
+static const char pci_device_1039_7001[] = "USB 1.0 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";
+static const char pci_device_1039_7002[] = "USB 2.0 Controller";
#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_7012[] = "Sound Controller";
static const char pci_device_1039_7013[] = "Intel 537 [56k Winmodem]";
-static const char pci_device_1039_7016[] = "SiS7016 10/100 Ethernet Adapter";
+static const char pci_device_1039_7016[] = "10/100 Ethernet Adapter";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1039_7016_1039_7016[] = "SiS7016 10/100 Ethernet Adapter";
#endif
@@ -2472,6 +2489,7 @@ 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_12b4[] = "zx1 QuickSilver AGP8x LBA";
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
@@ -2488,8 +2506,8 @@ 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_1000[] = "PC Tech RZ1000";
+static const char pci_device_1042_1001[] = "PC Tech RZ1001";
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";
@@ -2974,6 +2992,9 @@ 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";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_3376_1043_809e[] = "A7V8X motherboard";
+#endif
static const char pci_device_105a_4d30[] = "20267";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_105a_4d30_105a_4d33[] = "Ultra100";
@@ -3000,6 +3021,9 @@ static const char pci_device_105a_4d68[] = "20268";
static const char pci_subsys_105a_4d68_105a_4d68[] = "Ultra100TX2";
#endif
static const char pci_device_105a_4d69[] = "20269";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d69_105a_4d68[] = "Ultra133TX2";
+#endif
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";
@@ -3111,6 +3135,9 @@ static const char pci_subsys_105d_493d_13cc_0009[] = "Barco Metheus 5 Megapixel,
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 INIT_SUBSYS_INFO
+static const char pci_subsys_105d_5348_105d_0037[] = "Revolution IV-FP AGP (For SGI 1600SW)";
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_105e[] = "Vtech Computers Ltd";
#endif
@@ -3328,6 +3355,9 @@ static const char pci_device_1077_2100[] = "QLA2100 64-bit Fibre Channel Adapter
static const char pci_subsys_1077_2100_1077_0001[] = "QLA2100 64-bit Fibre Channel Adapter";
#endif
static const char pci_device_1077_2200[] = "QLA2200";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1077_2200_1077_0002[] = "QLA2200";
+#endif
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
@@ -3540,6 +3570,7 @@ 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_0240[] = "Adaptec AAR-1210SA SATA HostRAID Controller";
static const char pci_device_1095_0640[] = "PCI0640";
static const char pci_device_1095_0643[] = "PCI0643";
static const char pci_device_1095_0646[] = "PCI0646";
@@ -3926,6 +3957,7 @@ 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_3052[] = "SmartPCI562 56K Modem";
static const char pci_device_10a5_5449[] = "SmartPCI561 modem";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -3949,6 +3981,9 @@ 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";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10a9_0009_10a9_8002[] = "Acenic Gigabit Ethernet";
+#endif
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";
@@ -3960,6 +3995,7 @@ 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_100a[] = "IOC4 I/O controller";
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";
@@ -4130,6 +4166,9 @@ 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
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9054_12d9_0002[] = "PCI Prosody Card rev 1.5";
+#endif
static const char pci_device_10b5_9060[] = "9060";
static const char pci_device_10b5_906d[] = "9060SD";
#ifdef INIT_SUBSYS_INFO
@@ -4143,6 +4182,9 @@ static const char pci_subsys_10b5_9080_10b5_9080[] = "9080 [real subsystem ID no
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_10b5_9080_129d_0002[] = "Aculab PCI Prosidy card";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9080_12d9_0002[] = "PCI Prosody Card";
+#endif
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_10b6[] = "Madge Networks";
@@ -4200,6 +4242,7 @@ static const char pci_device_10b6_1001[] = "Collage 155 ATM Server Adapter";
#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_0910[] = "3C910-A01";
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
@@ -4491,6 +4534,7 @@ 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
+#ifdef VENDOR_INCLUDE_NONVIDEO
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
@@ -4561,6 +4605,7 @@ 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_5450[] = "Lucent Technologies Soft Modem AMR";
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";
@@ -4576,6 +4621,7 @@ 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
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_10ba[] = "Mitsubishi Electric Corp.";
static const char pci_device_10ba_0301[] = "AccelGraphics AccelECLIPSE";
@@ -4895,6 +4941,9 @@ static const char pci_subsys_10de_0028_1043_0205[] = "PCI-V3800";
static const char pci_subsys_10de_0028_1043_4000[] = "AGP-V3800PRO";
#endif
#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1048_0c21[] = "Synergy II";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_10de_0028_1092_4804[] = "Viper V770";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -5099,6 +5148,9 @@ 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_10b0_0002[] = "Gainward Pro/600 TV";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_10de_0171_1462_8661[] = "G4MX440-VTP";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -5490,6 +5542,12 @@ static const char pci_subsys_1102_0002_1102_8051[] = "CT4850 SBLive! Value";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1102_0002_1102_8061[] = "SBLive! Player 5.1";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8064[] = "SB Live! 5.1 Model SB0100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8065[] = "SBLive! 5.1 Digital Model SB0220";
+#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";
@@ -5512,7 +5570,7 @@ 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";
+static const char pci_device_1102_8938[] = "Ectiva EV1938";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_1103[] = "Triones Technologies, Inc.";
@@ -5528,6 +5586,7 @@ 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";
+static const char pci_device_1103_0009[] = "HPT372N";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_1104[] = "RasterOps Corp.";
@@ -5538,6 +5597,7 @@ static const char pci_device_1105_1105[] = "REALmagic Xcard MPEG 1/2/3/4 DVD Dec
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
+#ifdef VENDOR_INCLUDE_NONVIDEO
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";
@@ -5557,13 +5617,19 @@ static const char pci_subsys_1106_0305_147b_a401[] = "KT7/KT7-RAID/KT7A/KT7A-RAI
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";
+static const char pci_device_1106_0561[] = "VT82C576MV";
+static const char pci_device_1106_0571[] = "VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0571_1019_0985[] = "P6VXA Motherboard";
+#endif
#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";
+static const char pci_subsys_1106_0571_1043_808c[] = "A7V8X motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0571_1106_0571[] = "VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE";
#endif
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_0571_1179_0001[] = "Magnia Z310";
@@ -5589,9 +5655,18 @@ 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]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0605_1043_802c[] = "CUV4X mainboard";
+#endif
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_1019_0985[] = "P6VXA Motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1043_802c[] = "CUV4X mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_0686_1043_8033[] = "A7V Mainboard";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -5617,6 +5692,9 @@ 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_1019_0985[] = "P6VXA Motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_0691_1179_0001[] = "Magnia Z310";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -5627,13 +5705,19 @@ 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_1571[] = "VT82C576M/VT82C586";
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_1019_0985[] = "P6VXA Motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3038_1043_808c[] = "A7V8X motherboard";
+#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";
@@ -5652,6 +5736,9 @@ 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_1019_0985[] = "P6VXA Motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_3057_1043_8033[] = "A7V Mainboard";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -5667,9 +5754,14 @@ static const char pci_subsys_1106_3057_1043_8042[] = "A7V133/A7V133-C Mainboard"
static const char pci_subsys_1106_3057_1179_0001[] = "Magnia Z310";
#endif
static const char pci_device_1106_3058[] = "VT82C686 AC97 Audio Controller";
+#endif
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_3058_0e11_b194[] = "Soundmax integrated digital audio";
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3058_1019_0985[] = "P6VXA Motherboard";
+#endif
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_3058_1106_4511[] = "Onboard Audio on EP7KXA";
#endif
@@ -5682,7 +5774,10 @@ static const char pci_subsys_1106_3058_1462_3091[] = "MS-6309 Onboard Audio";
#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";
+static const char pci_device_1106_3059[] = "VT8233/A/8235 AC97 Audio Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3059_1043_8095[] = "A7V8X Motherboard (Realtek ALC650 codec)";
+#endif
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_3059_1458_a002[] = "GA-7VAX Onboard Audio (Realtek ALC650)";
#endif
@@ -5696,6 +5791,9 @@ static const char pci_subsys_1106_3065_1186_1400[] = "DFE-530TX rev A";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_1106_3065_1186_1401[] = "DFE-530TX rev B";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3065_13b9_1421[] = "LD-10/100AL PCI Fast Ethernet Adapter (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
@@ -5714,12 +5812,15 @@ 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_1043_808c[] = "A7V8X motherboard";
+#endif
+#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_3116[] = "VT8375 [KM266/KL266] 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]";
@@ -5730,10 +5831,16 @@ 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_1043_808c[] = "A7V8X motherboard";
+#endif
+#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_1043_807f[] = "A7V8X motherboard";
+#endif
+#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]";
@@ -5746,6 +5853,9 @@ 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]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_8598_1019_0985[] = "P6VXA Motherboard";
+#endif
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]";
@@ -5757,6 +5867,7 @@ 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";
+#endif
#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!)";
@@ -5780,6 +5891,12 @@ static const char pci_device_1109_1400[] = "EM110TX [EX110TX]";
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_0006[] = "FSC PINC (I/O-APIC)";
+static const char pci_device_110a_0015[] = "FSC Multiprocessor Interrupt Controller";
+static const char pci_device_110a_001d[] = "FSC Copernicus Management Controller";
+static const char pci_device_110a_007b[] = "FSC Remote Service Controller, mailbox device";
+static const char pci_device_110a_007c[] = "FSC Remote Service Controller, shared memory device";
+static const char pci_device_110a_007d[] = "FSC Remote Service Controller, SMIC device";
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";
@@ -6578,6 +6695,7 @@ static const char pci_device_1165_0001[] = "Motion TPEG Recorder/Player with aud
#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_0006[] = "CNB20HE 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";
@@ -7179,6 +7297,11 @@ static const char pci_subsys_11c1_0442_1668_0440[] = "LT WinModem 56k Data+Fax+V
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";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0445_8086_2203[] = "PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
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";
@@ -8157,6 +8280,7 @@ static const char pci_subsys_1260_3873_1737_3874[] = "WMP11 Wireless 802.11b PCI
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_3890[] = "D-Links DWL-g650 A1";
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
@@ -8213,6 +8337,7 @@ 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_0730[] = "SM731 Cougar3DR";
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";
@@ -8232,6 +8357,7 @@ 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_1171[] = "ES1373 [AudioPCI] (also Creative Labs CT5803)";
static const char pci_device_1274_1371[] = "ES1371 [AudioPCI-97]";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -8463,6 +8589,7 @@ static const char pci_vendor_1277[] = "Comstream";
#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";
+static const char pci_device_1278_0710[] = "TPE5 PowerPC PCI board";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_1279[] = "Transmeta Corporation";
@@ -8971,6 +9098,9 @@ static const char pci_subsys_12ae_0001_1410_0104[] = "Gigabit Ethernet-SX PCI Ad
#endif
static const char pci_device_12ae_0002[] = "AceNIC Gigabit Ethernet (Copper)";
#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12ae_0002_10a9_8002[] = "Acenic Gigabit Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_12ae_0002_12ae_0002[] = "Gigabit Ethernet-T (3C986-T)";
#endif
#endif
@@ -9208,6 +9338,7 @@ 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)";
+static const char pci_device_12d4_0200[] = "T1 Card";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_12d5[] = "Equator Technologies";
@@ -9223,6 +9354,8 @@ static const char pci_vendor_12d8[] = "Pericom Semiconductor";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_12d9[] = "Aculab PLC";
+static const char pci_device_12d9_0002[] = "PCI Prosody";
+static const char pci_device_12d9_0004[] = "cPCI Prosody";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_12da[] = "True Time Inc.";
@@ -9516,6 +9649,7 @@ 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";
+static const char pci_device_1307_004d[] = "PCI-QUAD04";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_1308[] = "Jato Technologies Inc.";
@@ -9683,6 +9817,7 @@ static const char pci_vendor_1331[] = "Radisys Corp.";
#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";
+static const char pci_device_1332_5425[] = "MM-5425CN PCI 64/66 Memory Module with Battery Backup";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_1334[] = "Redcreek Communications, Inc";
@@ -9940,6 +10075,7 @@ static const char pci_vendor_1384[] = "Reality Simulation Systems Inc";
#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_4105[] = "MA311 802.11b wireless adapter";
static const char pci_device_1385_620a[] = "GA620";
static const char pci_device_1385_622a[] = "GA622";
static const char pci_device_1385_630a[] = "GA630";
@@ -10283,7 +10419,7 @@ static const char pci_vendor_13e7[] = "NAC Incorporated";
static const char pci_vendor_13e8[] = "Chip Express Corporation";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
-static const char pci_vendor_13e9[] = "Chip Express Corporation";
+static const char pci_vendor_13e9[] = "Intraserver Technology Inc";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_13ea[] = "Dallas Semiconductor";
@@ -10346,6 +10482,9 @@ static const char pci_subsys_13f6_0111_1043_80e2[] = "CMI8738 6ch-MX";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_13f6_0111_13f6_0111[] = "CMI8738/C3DX PCI Audio Device";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13f6_0111_1681_a000[] = "Gamesurround MUSE XL";
+#endif
static const char pci_device_13f6_0211[] = "CM8738";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -10739,6 +10878,7 @@ static const char pci_vendor_146b[] = "Parascan Technologies Ltd";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_146c[] = "Ruby Tech Corp.";
+static const char pci_device_146c_1430[] = "FE-1430TX Fast Ethernet PCI Adapter";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_146d[] = "Tachyon, INC.";
@@ -10887,6 +11027,7 @@ static const char pci_vendor_149c[] = "OVISLINK Corp.";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_149d[] = "NEWTEK Inc";
+static const char pci_device_149d_0001[] = "Video Toaster for PC";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_149e[] = "Mapletree Networks Inc.";
@@ -11240,6 +11381,15 @@ static const char pci_subsys_14e4_1645_1028_0121[] = "Broadcom BCM5701 1000Base-
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_10a9_8010[] = "SGI IO9 Gigabit Ethernet (Copper)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_10a9_8011[] = "SGI Gigabit Ethernet (Copper)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_10a9_8012[] = "SGI Gigabit Ethernet (Fiber)";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_14e4_1645_10b7_1004[] = "3C996-SX 1000Base-SX";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -11295,6 +11445,9 @@ 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_10a9_8010[] = "SGI IO9 Gigabit Ethernet (Copper)";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_14e4_1647_14e4_0009[] = "BCM5703 1000BaseTX";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -11341,6 +11494,7 @@ 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_169c[] = "NetXtreme BCM5788 Gigabit Ethernet";
static const char pci_device_14e4_16a6[] = "NetXtreme BCM5702 Gigabit Ethernet";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -11406,7 +11560,11 @@ 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_4320[] = "BCM94306 802.11g";
static const char pci_device_14e4_4401[] = "BCM4401 100Base-T";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_4401_1043_80a8[] = "A7V8X motherboard";
+#endif
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";
@@ -11589,6 +11747,9 @@ 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_1620[] = "ADSL AccessRunner V2 PCI Arbitration Device";
+static const char pci_device_14f1_1621[] = "AccessRunner V2 PCI ADSL Interface Device";
+static const char pci_device_14f1_1622[] = "AccessRunner V2 PCI ADSL Yukon WAN Adapter";
static const char pci_device_14f1_1803[] = "HCF 56k Modem";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -12640,6 +12801,7 @@ 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_3052[] = "SmartLink SmartPCI562 56K Modem";
static const char pci_device_163c_5449[] = "SmartPCI561 Modem";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -12671,6 +12833,10 @@ static const char pci_device_16ab_1102[] = "PCMCIA-to-PCI Wireless Network Bridg
static const char pci_vendor_16be[] = "Creatix Polymedia GmbH";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_16ca[] = "CENATEK Inc";
+static const char pci_device_16ca_0001[] = "Rocket Drive DL";
+#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
@@ -12779,6 +12945,10 @@ 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_1fc0[] = "Tumsan Oy";
+static const char pci_device_1fc0_0300[] = "E2200 Dual E1/Rawpipe Card";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_2000[] = "Smart Link Ltd.";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -12823,6 +12993,8 @@ 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_101a[] = "E.Band [AudioTrak Inca88]";
+static const char pci_device_3388_101b[] = "E.Band [AudioTrak Inca88]";
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";
@@ -13232,7 +13404,7 @@ 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_8d04[] = "VT8375 [ProSavage8 KM266/KL266]";
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";
@@ -13261,6 +13433,7 @@ static const char pci_subsys_5333_9102_1092_5a57[] = "Viper II Z200";
static const char pci_device_5333_ca00[] = "SonicVibes";
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_544c[] = "Teralogic Inc";
+static const char pci_device_544c_0350[] = "TL880-based HDTV/ATSC tuner";
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const char pci_vendor_5455[] = "Technische University Berlin";
@@ -13472,6 +13645,7 @@ 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_1043[] = "PRO/Wireless LAN 2100 3B Mini PCI Adapter";
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
@@ -13483,6 +13657,12 @@ static const char pci_subsys_8086_1130_1043_8027[] = "TUSL2-C Mainboard";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_1130_104d_80df[] = "Vaio PCG-FX403";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1130_8086_4532[] = "D815EEA2 mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1130_8086_4557[] = "D815EGEW Mainboard";
+#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
@@ -13491,6 +13671,12 @@ static const char pci_subsys_8086_1132_1025_1016[] = "Travelmate 612 TX";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_1132_104d_80df[] = "Vaio PCG-FX403";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1132_8086_4532[] = "D815EEA2 Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1132_8086_4557[] = "D815EGEW Mainboard";
+#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";
@@ -14098,6 +14284,12 @@ static const char pci_subsys_8086_2442_104d_80df[] = "Vaio PCG-FX403";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2442_147b_0507[] = "TH7II-RAID";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2442_8086_4532[] = "D815EEA2 mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2442_8086_4557[] = "D815EGEW Mainboard";
+#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";
@@ -14114,6 +14306,12 @@ static const char pci_subsys_8086_2443_104d_80df[] = "Vaio PCG-FX403";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2443_147b_0507[] = "TH7II-RAID";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2443_8086_4532[] = "D815EEA2 mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2443_8086_4557[] = "D815EGEW Mainboard";
+#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";
@@ -14124,6 +14322,9 @@ static const char pci_subsys_8086_2444_104d_80df[] = "Vaio PCG-FX403";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2444_147b_0507[] = "TH7II-RAID";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2444_8086_4532[] = "D815EEA2 mainboard";
+#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";
@@ -14140,6 +14341,9 @@ static const char pci_subsys_8086_2445_1462_3370[] = "STAC9721 AC";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2445_147b_0507[] = "TH7II-RAID";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2445_8086_4557[] = "D815EGEW Mainboard";
+#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";
@@ -14189,12 +14393,24 @@ static const char pci_subsys_8086_2449_1014_0244[] = "EtherExpress PRO/100 VE";
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_1014_0265[] = "PRO/100 VE Desktop Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_0267[] = "PRO/100 VE Desktop Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_026a[] = "PRO/100 VE Desktop Connection";
+#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_1179_ff01[] = "PRO/100 VE Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2449_1186_7801[] = "EtherExpress PRO/100 VE";
#endif
#ifdef INIT_SUBSYS_INFO
@@ -14244,8 +14460,14 @@ static const char pci_subsys_8086_244b_1043_8027[] = "TUSL2-C Mainboard";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_244b_147b_0507[] = "TH7II-RAID";
#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_244b_8086_4532[] = "D815EEA2 mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_244b_8086_4557[] = "D815EGEW Mainboard";
+#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_244e[] = "82801BA/CA/DB/EB 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";
@@ -14253,7 +14475,7 @@ 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_2480[] = "82801CA LPC Interface Controller";
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";
@@ -14267,7 +14489,7 @@ static const char pci_subsys_8086_2482_15d9_3480[] = "P4DP6";
#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";
+static const char pci_device_8086_2483[] = "82801CA/CAM SMBus Controller";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2483_1014_0220[] = "ThinkPad A/T/X Series";
#endif
@@ -14293,7 +14515,7 @@ static const char pci_subsys_8086_2484_15d9_3480[] = "P4DP6";
#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";
+static const char pci_device_8086_2485[] = "82801CA/CAM AC'97 Audio Controller";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2485_1014_0222[] = "ThinkPad T23 (2647-4MG) or A30p (2653-64G)";
#endif
@@ -14309,7 +14531,7 @@ static const char pci_subsys_8086_2485_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/G
#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";
+static const char pci_device_8086_2486[] = "82801CA/CAM AC'97 Modem Controller";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_2486_1014_0223[] = "ThinkPad A/T/X Series";
#endif
@@ -14357,12 +14579,12 @@ static const char pci_subsys_8086_248a_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/G
#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";
+static const char pci_device_8086_248b[] = "82801CA Ultra ATA Storage Controller";
#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)";
+static const char pci_device_8086_24c0[] = "82801DB LPC Interface Controller";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_24c0_1462_5800[] = "845PE Max (MS-6580)";
#endif
@@ -14370,7 +14592,7 @@ 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";
+static const char pci_device_8086_24c3[] = "82801DB/DBM SMBus Controller";
#ifdef INIT_SUBSYS_INFO
static const char pci_subsys_8086_24c3_1462_5800[] = "845PE Max (MS-6580)";
#endif
@@ -14378,23 +14600,37 @@ 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";
+static const char pci_device_8086_24c5[] = "82801DB AC'97 Audio Controller";
#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_24c6[] = "82801DB AC'97 Modem Controller";
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";
+static const char pci_device_8086_24ca[] = "82801DBM Ultra ATA Storage Controller";
+static const char pci_device_8086_24cb[] = "82801DB Ultra ATA Storage Controller";
#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";
+static const char pci_device_8086_24cc[] = "82801DBM LPC Interface Controller";
+static const char pci_device_8086_24cd[] = "82801DB USB2";
#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_24d0[] = "82801EB LPC Interface Controller";
+static const char pci_device_8086_24d1[] = "82801EB Ultra ATA Storage Controller";
+static const char pci_device_8086_24d2[] = "82801EB USB";
+static const char pci_device_8086_24d3[] = "82801EB SMBus Controller";
+static const char pci_device_8086_24d4[] = "82801EB USB";
+static const char pci_device_8086_24d5[] = "82801EB AC'97 Audio Controller";
+static const char pci_device_8086_24d6[] = "82801EB AC'97 Modem Controller";
+static const char pci_device_8086_24d7[] = "82801EB USB";
+static const char pci_device_8086_24db[] = "82801EB Ultra ATA Storage Controller";
+static const char pci_device_8086_24dc[] = "82801EB LPC Interface Controller";
+static const char pci_device_8086_24dd[] = "82801EB USB2";
+static const char pci_device_8086_24de[] = "82801EB USB";
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";
@@ -14418,29 +14654,45 @@ static const char pci_device_8086_2531[] = "82860 860 (Wombat) Chipset Host Brid
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";
+static const char pci_device_8086_2540[] = "E7500 Memory Controller Hub";
#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";
+static const char pci_device_8086_2541[] = "E7000 Series Host RASUM Controller";
#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_2543[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge";
+static const char pci_device_8086_2544[] = "E7000 Series Hub Interface B RASUM Controller";
+static const char pci_device_8086_2545[] = "E7000 Series Hub Interface C PCI-to-PCI Bridge";
+static const char pci_device_8086_2546[] = "E7000 Series Hub Interface C RASUM Controller";
+static const char pci_device_8086_2547[] = "E7000 Series Hub Interface D PCI-to-PCI Bridge";
+static const char pci_device_8086_2548[] = "E7000 Series Hub Interface D RASUM Controller";
+static const char pci_device_8086_254c[] = "E7501 Memory Controller Hub";
+static const char pci_device_8086_2550[] = "E7505 Memory Controller Hub";
+static const char pci_device_8086_2551[] = "E7000 Series RAS Controller";
+static const char pci_device_8086_2552[] = "E7000 Series Processor to AGP Controller";
+static const char pci_device_8086_2553[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge";
+static const char pci_device_8086_2554[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller";
+static const char pci_device_8086_255d[] = "E7205 Memory Controller Hub";
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_2570[] = "82865G/PE/P Processor to I/O Controller";
+static const char pci_device_8086_2571[] = "82865G/PE/P Processor to AGP Controller";
+static const char pci_device_8086_2572[] = "82865G Integrated Graphics Device";
+static const char pci_device_8086_2573[] = "82865G/PE/P Processor to PCI to CSA Bridge";
+static const char pci_device_8086_2576[] = "82864G/PE/P Processor to I/O Memory Interface";
+static const char pci_device_8086_2578[] = "82875P Memory Controller Hub";
+static const char pci_device_8086_2579[] = "82875P Processor to AGP Controller";
+static const char pci_device_8086_257b[] = "82875P Processor to PCI to CSA Bridge";
+static const char pci_device_8086_257e[] = "82875P Processor to I/O Memory Interface";
static const char pci_device_8086_3092[] = "Integrated RAID";
+static const char pci_device_8086_3340[] = "82855PM Processor to I/O Controller";
+static const char pci_device_8086_3341[] = "82855PM Processor to AGP Controller";
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";
@@ -14454,8 +14706,8 @@ static const char pci_device_8086_3577[] = "82830 CGC [Chipset Graphics Controll
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_3580[] = "82852/855GM Host Bridge";
+static const char pci_device_8086_3582[] = "82852/855GM Integrated Graphics Device";
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
@@ -14473,6 +14725,9 @@ 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]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7121_8086_4341[] = "Cayman (CA810) Mainboard";
+#endif
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]";
@@ -14603,13 +14858,6 @@ 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";
@@ -14683,6 +14931,8 @@ 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_7710[] = "ANA-7711F Network Accelerator Card (NAC) - Optical";
+static const char pci_device_9004_7711[] = "ANA-7711C Network Accelerator Card (NAC) - Copper";
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";
@@ -14884,11 +15134,18 @@ 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_8080[] = "ASC-29320A U320 w/HostRAID";
+static const char pci_device_9005_808f[] = "AIC-7901 U320 w/HostRAID";
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_8095[] = "ASC-39320(B) U320 w/HostRAID";
+static const char pci_device_9005_8096[] = "ASC-39320A U320 w/HostRAID";
+static const char pci_device_9005_8097[] = "ASC-29320ALP U320 w/HostRAID";
+static const char pci_device_9005_809c[] = "ASC-39320D(B) U320 w/HostRAID";
+static const char pci_device_9005_809d[] = "AIC-7902(B) 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
@@ -15478,6 +15735,10 @@ 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_4e45_1002_0002 =
+ {0x1002, 0x0002, pci_subsys_1002_4e45_1002_0002, 0};
+#undef pci_ss_info_1002_0002
+#define pci_ss_info_1002_0002 pci_ss_info_1002_4e45_1002_0002
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
@@ -15734,6 +15995,10 @@ 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_5346_1002_0048 =
+ {0x1002, 0x0048, pci_subsys_1002_5346_1002_0048, 0};
+#undef pci_ss_info_1002_0048
+#define pci_ss_info_1002_0048 pci_ss_info_1002_5346_1002_0048
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
@@ -17523,6 +17788,10 @@ 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_3376_1043_809e =
+ {0x1043, 0x809e, pci_subsys_105a_3376_1043_809e, 0};
+#undef pci_ss_info_1043_809e
+#define pci_ss_info_1043_809e pci_ss_info_105a_3376_1043_809e
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
@@ -17551,6 +17820,10 @@ 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_4d69_105a_4d68 =
+ {0x105a, 0x4d68, pci_subsys_105a_4d69_105a_4d68, 0};
+#undef pci_ss_info_105a_4d68
+#define pci_ss_info_105a_4d68 pci_ss_info_105a_4d69_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
@@ -17676,6 +17949,10 @@ 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
+static const pciSubsystemInfo pci_ss_info_105d_5348_105d_0037 =
+ {0x105d, 0x0037, pci_subsys_105d_5348_105d_0037, 0};
+#undef pci_ss_info_105d_0037
+#define pci_ss_info_105d_0037 pci_ss_info_105d_5348_105d_0037
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo pci_ss_info_1073_0004_1073_0004 =
{0x1073, 0x0004, pci_subsys_1073_0004_1073_0004, 0};
@@ -17735,6 +18012,10 @@ 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
+static const pciSubsystemInfo pci_ss_info_1077_2200_1077_0002 =
+ {0x1077, 0x0002, pci_subsys_1077_2200_1077_0002, 0};
+#undef pci_ss_info_1077_0002
+#define pci_ss_info_1077_0002 pci_ss_info_1077_2200_1077_0002
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo pci_ss_info_108d_0004_108d_0004 =
@@ -18173,6 +18454,12 @@ static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1722 =
#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_10a9_0009_10a9_8002 =
+ {0x10a9, 0x8002, pci_subsys_10a9_0009_10a9_8002, 0};
+#undef pci_ss_info_10a9_8002
+#define pci_ss_info_10a9_8002 pci_ss_info_10a9_0009_10a9_8002
+#endif
+#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
@@ -18319,6 +18606,10 @@ 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_9054_12d9_0002 =
+ {0x12d9, 0x0002, pci_subsys_10b5_9054_12d9_0002, 0};
+#undef pci_ss_info_12d9_0002
+#define pci_ss_info_12d9_0002 pci_ss_info_10b5_9054_12d9_0002
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
@@ -18331,6 +18622,10 @@ 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
+static const pciSubsystemInfo pci_ss_info_10b5_9080_12d9_0002 =
+ {0x12d9, 0x0002, pci_subsys_10b5_9080_12d9_0002, 0};
+#undef pci_ss_info_12d9_0002
+#define pci_ss_info_12d9_0002 pci_ss_info_10b5_9080_12d9_0002
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo pci_ss_info_10b6_0002_10b6_0002 =
@@ -18678,6 +18973,7 @@ static const pciSubsystemInfo pci_ss_info_10b8_0006_13a2_8006 =
#undef pci_ss_info_13a2_8006
#define pci_ss_info_13a2_8006 pci_ss_info_10b8_0006_13a2_8006
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
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
@@ -18710,6 +19006,7 @@ 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
+#endif
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
@@ -18946,6 +19243,10 @@ 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_1048_0c21 =
+ {0x1048, 0x0c21, pci_subsys_10de_0028_1048_0c21, 0};
+#undef pci_ss_info_1048_0c21
+#define pci_ss_info_1048_0c21 pci_ss_info_10de_0028_1048_0c21
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
@@ -19178,6 +19479,10 @@ 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_10b0_0002 =
+ {0x10b0, 0x0002, pci_subsys_10de_0171_10b0_0002, 0};
+#undef pci_ss_info_10b0_0002
+#define pci_ss_info_10b0_0002 pci_ss_info_10de_0171_10b0_0002
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
@@ -19403,6 +19708,14 @@ 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_0002_1102_8064 =
+ {0x1102, 0x8064, pci_subsys_1102_0002_1102_8064, 0};
+#undef pci_ss_info_1102_8064
+#define pci_ss_info_1102_8064 pci_ss_info_1102_0002_1102_8064
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8065 =
+ {0x1102, 0x8065, pci_subsys_1102_0002_1102_8065, 0};
+#undef pci_ss_info_1102_8065
+#define pci_ss_info_1102_8065 pci_ss_info_1102_0002_1102_8065
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
@@ -19434,6 +19747,7 @@ static const pciSubsystemInfo pci_ss_info_1103_0004_1103_0005 =
#undef pci_ss_info_1103_0005
#define pci_ss_info_1103_0005 pci_ss_info_1103_0004_1103_0005
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
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
@@ -19450,10 +19764,18 @@ 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_1019_0985 =
+ {0x1019, 0x0985, pci_subsys_1106_0571_1019_0985, 0};
+#undef pci_ss_info_1019_0985
+#define pci_ss_info_1019_0985 pci_ss_info_1106_0571_1019_0985
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_1043_808c =
+ {0x1043, 0x808c, pci_subsys_1106_0571_1043_808c, 0};
+#undef pci_ss_info_1043_808c
+#define pci_ss_info_1043_808c pci_ss_info_1106_0571_1043_808c
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
@@ -19478,6 +19800,18 @@ 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_0605_1043_802c =
+ {0x1043, 0x802c, pci_subsys_1106_0605_1043_802c, 0};
+#undef pci_ss_info_1043_802c
+#define pci_ss_info_1043_802c pci_ss_info_1106_0605_1043_802c
+static const pciSubsystemInfo pci_ss_info_1106_0686_1019_0985 =
+ {0x1019, 0x0985, pci_subsys_1106_0686_1019_0985, 0};
+#undef pci_ss_info_1019_0985
+#define pci_ss_info_1019_0985 pci_ss_info_1106_0686_1019_0985
+static const pciSubsystemInfo pci_ss_info_1106_0686_1043_802c =
+ {0x1043, 0x802c, pci_subsys_1106_0686_1043_802c, 0};
+#undef pci_ss_info_1043_802c
+#define pci_ss_info_1043_802c pci_ss_info_1106_0686_1043_802c
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
@@ -19510,6 +19844,10 @@ 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_1019_0985 =
+ {0x1019, 0x0985, pci_subsys_1106_0691_1019_0985, 0};
+#undef pci_ss_info_1019_0985
+#define pci_ss_info_1019_0985 pci_ss_info_1106_0691_1019_0985
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
@@ -19522,6 +19860,14 @@ 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_1019_0985 =
+ {0x1019, 0x0985, pci_subsys_1106_3038_1019_0985, 0};
+#undef pci_ss_info_1019_0985
+#define pci_ss_info_1019_0985 pci_ss_info_1106_3038_1019_0985
+static const pciSubsystemInfo pci_ss_info_1106_3038_1043_808c =
+ {0x1043, 0x808c, pci_subsys_1106_3038_1043_808c, 0};
+#undef pci_ss_info_1043_808c
+#define pci_ss_info_1043_808c pci_ss_info_1106_3038_1043_808c
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
@@ -19538,6 +19884,10 @@ 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_1019_0985 =
+ {0x1019, 0x0985, pci_subsys_1106_3057_1019_0985, 0};
+#undef pci_ss_info_1019_0985
+#define pci_ss_info_1019_0985 pci_ss_info_1106_3057_1019_0985
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
@@ -19558,10 +19908,16 @@ 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
+#endif
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
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1106_3058_1019_0985 =
+ {0x1019, 0x0985, pci_subsys_1106_3058_1019_0985, 0};
+#undef pci_ss_info_1019_0985
+#define pci_ss_info_1019_0985 pci_ss_info_1106_3058_1019_0985
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
@@ -19578,6 +19934,10 @@ 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_1043_8095 =
+ {0x1043, 0x8095, pci_subsys_1106_3059_1043_8095, 0};
+#undef pci_ss_info_1043_8095
+#define pci_ss_info_1043_8095 pci_ss_info_1106_3059_1043_8095
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
@@ -19594,6 +19954,10 @@ 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_3065_13b9_1421 =
+ {0x13b9, 0x1421, pci_subsys_1106_3065_13b9_1421, 0};
+#undef pci_ss_info_13b9_1421
+#define pci_ss_info_13b9_1421 pci_ss_info_1106_3065_13b9_1421
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
@@ -19606,18 +19970,35 @@ 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_1043_808c =
+ {0x1043, 0x808c, pci_subsys_1106_3104_1043_808c, 0};
+#undef pci_ss_info_1043_808c
+#define pci_ss_info_1043_808c pci_ss_info_1106_3104_1043_808c
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_1043_808c =
+ {0x1043, 0x808c, pci_subsys_1106_3177_1043_808c, 0};
+#undef pci_ss_info_1043_808c
+#define pci_ss_info_1043_808c pci_ss_info_1106_3177_1043_808c
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_1043_807f =
+ {0x1043, 0x807f, pci_subsys_1106_3189_1043_807f, 0};
+#undef pci_ss_info_1043_807f
+#define pci_ss_info_1043_807f pci_ss_info_1106_3189_1043_807f
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
+static const pciSubsystemInfo pci_ss_info_1106_8598_1019_0985 =
+ {0x1019, 0x0985, pci_subsys_1106_8598_1019_0985, 0};
+#undef pci_ss_info_1019_0985
+#define pci_ss_info_1019_0985 pci_ss_info_1106_8598_1019_0985
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
#endif
static const pciSubsystemInfo pci_ss_info_1113_1211_103c_1207 =
@@ -20321,6 +20702,12 @@ 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
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0445_8086_2203 =
+ {0x8086, 0x2203, pci_subsys_11c1_0445_8086_2203, 0};
+#undef pci_ss_info_8086_2203
+#define pci_ss_info_8086_2203 pci_ss_info_11c1_0445_8086_2203
+#ifdef VENDOR_INCLUDE_NONVIDEO
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
@@ -21467,6 +21854,10 @@ 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_10a9_8002 =
+ {0x10a9, 0x8002, pci_subsys_12ae_0002_10a9_8002, 0};
+#undef pci_ss_info_10a9_8002
+#define pci_ss_info_10a9_8002 pci_ss_info_12ae_0002_10a9_8002
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
@@ -21827,6 +22218,10 @@ 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
+static const pciSubsystemInfo pci_ss_info_13f6_0111_1681_a000 =
+ {0x1681, 0xa000, pci_subsys_13f6_0111_1681_a000, 0};
+#undef pci_ss_info_1681_a000
+#define pci_ss_info_1681_a000 pci_ss_info_13f6_0111_1681_a000
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo pci_ss_info_1415_9501_15ed_2000 =
@@ -21965,6 +22360,18 @@ static const pciSubsystemInfo pci_ss_info_14e4_1645_1028_0121 =
#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_10a9_8010 =
+ {0x10a9, 0x8010, pci_subsys_14e4_1645_10a9_8010, 0};
+#undef pci_ss_info_10a9_8010
+#define pci_ss_info_10a9_8010 pci_ss_info_14e4_1645_10a9_8010
+static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8011 =
+ {0x10a9, 0x8011, pci_subsys_14e4_1645_10a9_8011, 0};
+#undef pci_ss_info_10a9_8011
+#define pci_ss_info_10a9_8011 pci_ss_info_14e4_1645_10a9_8011
+static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8012 =
+ {0x10a9, 0x8012, pci_subsys_14e4_1645_10a9_8012, 0};
+#undef pci_ss_info_10a9_8012
+#define pci_ss_info_10a9_8012 pci_ss_info_14e4_1645_10a9_8012
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
@@ -22033,6 +22440,10 @@ static const pciSubsystemInfo pci_ss_info_14e4_1647_0e11_009a =
#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_10a9_8010 =
+ {0x10a9, 0x8010, pci_subsys_14e4_1647_10a9_8010, 0};
+#undef pci_ss_info_10a9_8010
+#define pci_ss_info_10a9_8010 pci_ss_info_14e4_1647_10a9_8010
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
@@ -22159,6 +22570,10 @@ 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
+static const pciSubsystemInfo pci_ss_info_14e4_4401_1043_80a8 =
+ {0x1043, 0x80a8, pci_subsys_14e4_4401_1043_80a8, 0};
+#undef pci_ss_info_1043_80a8
+#define pci_ss_info_1043_80a8 pci_ss_info_14e4_4401_1043_80a8
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
#endif
@@ -22888,6 +23303,14 @@ 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_1130_8086_4532 =
+ {0x8086, 0x4532, pci_subsys_8086_1130_8086_4532, 0};
+#undef pci_ss_info_8086_4532
+#define pci_ss_info_8086_4532 pci_ss_info_8086_1130_8086_4532
+static const pciSubsystemInfo pci_ss_info_8086_1130_8086_4557 =
+ {0x8086, 0x4557, pci_subsys_8086_1130_8086_4557, 0};
+#undef pci_ss_info_8086_4557
+#define pci_ss_info_8086_4557 pci_ss_info_8086_1130_8086_4557
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
@@ -22896,6 +23319,14 @@ 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_1132_8086_4532 =
+ {0x8086, 0x4532, pci_subsys_8086_1132_8086_4532, 0};
+#undef pci_ss_info_8086_4532
+#define pci_ss_info_8086_4532 pci_ss_info_8086_1132_8086_4532
+static const pciSubsystemInfo pci_ss_info_8086_1132_8086_4557 =
+ {0x8086, 0x4557, pci_subsys_8086_1132_8086_4557, 0};
+#undef pci_ss_info_8086_4557
+#define pci_ss_info_8086_4557 pci_ss_info_8086_1132_8086_4557
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
@@ -23632,6 +24063,14 @@ 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_2442_8086_4532 =
+ {0x8086, 0x4532, pci_subsys_8086_2442_8086_4532, 0};
+#undef pci_ss_info_8086_4532
+#define pci_ss_info_8086_4532 pci_ss_info_8086_2442_8086_4532
+static const pciSubsystemInfo pci_ss_info_8086_2442_8086_4557 =
+ {0x8086, 0x4557, pci_subsys_8086_2442_8086_4557, 0};
+#undef pci_ss_info_8086_4557
+#define pci_ss_info_8086_4557 pci_ss_info_8086_2442_8086_4557
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
@@ -23652,6 +24091,14 @@ 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_2443_8086_4532 =
+ {0x8086, 0x4532, pci_subsys_8086_2443_8086_4532, 0};
+#undef pci_ss_info_8086_4532
+#define pci_ss_info_8086_4532 pci_ss_info_8086_2443_8086_4532
+static const pciSubsystemInfo pci_ss_info_8086_2443_8086_4557 =
+ {0x8086, 0x4557, pci_subsys_8086_2443_8086_4557, 0};
+#undef pci_ss_info_8086_4557
+#define pci_ss_info_8086_4557 pci_ss_info_8086_2443_8086_4557
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
@@ -23664,6 +24111,10 @@ 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_2444_8086_4532 =
+ {0x8086, 0x4532, pci_subsys_8086_2444_8086_4532, 0};
+#undef pci_ss_info_8086_4532
+#define pci_ss_info_8086_4532 pci_ss_info_8086_2444_8086_4532
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
@@ -23684,6 +24135,10 @@ 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_2445_8086_4557 =
+ {0x8086, 0x4557, pci_subsys_8086_2445_8086_4557, 0};
+#undef pci_ss_info_8086_4557
+#define pci_ss_info_8086_4557 pci_ss_info_8086_2445_8086_4557
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
@@ -23744,6 +24199,18 @@ 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_1014_0265 =
+ {0x1014, 0x0265, pci_subsys_8086_2449_1014_0265, 0};
+#undef pci_ss_info_1014_0265
+#define pci_ss_info_1014_0265 pci_ss_info_8086_2449_1014_0265
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0267 =
+ {0x1014, 0x0267, pci_subsys_8086_2449_1014_0267, 0};
+#undef pci_ss_info_1014_0267
+#define pci_ss_info_1014_0267 pci_ss_info_8086_2449_1014_0267
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_026a =
+ {0x1014, 0x026a, pci_subsys_8086_2449_1014_026a, 0};
+#undef pci_ss_info_1014_026a
+#define pci_ss_info_1014_026a pci_ss_info_8086_2449_1014_026a
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
@@ -23752,6 +24219,10 @@ 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_1179_ff01 =
+ {0x1179, 0xff01, pci_subsys_8086_2449_1179_ff01, 0};
+#undef pci_ss_info_1179_ff01
+#define pci_ss_info_1179_ff01 pci_ss_info_8086_2449_1179_ff01
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
@@ -23816,6 +24287,14 @@ 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_244b_8086_4532 =
+ {0x8086, 0x4532, pci_subsys_8086_244b_8086_4532, 0};
+#undef pci_ss_info_8086_4532
+#define pci_ss_info_8086_4532 pci_ss_info_8086_244b_8086_4532
+static const pciSubsystemInfo pci_ss_info_8086_244b_8086_4557 =
+ {0x8086, 0x4557, pci_subsys_8086_244b_8086_4557, 0};
+#undef pci_ss_info_8086_4557
+#define pci_ss_info_8086_4557 pci_ss_info_8086_244b_8086_4557
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
@@ -24024,6 +24503,10 @@ 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_7121_8086_4341 =
+ {0x8086, 0x4341, pci_subsys_8086_7121_8086_4341, 0};
+#undef pci_ss_info_8086_4341
+#define pci_ss_info_8086_4341 pci_ss_info_8086_7121_8086_4341
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
@@ -24089,14 +24572,6 @@ 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
@@ -24499,6 +24974,7 @@ static const pciSubsystemInfo *pci_ss_list_1000_1960[] = {
#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_4136 NULL
#define pci_ss_list_1002_4144 NULL
#define pci_ss_list_1002_4145 NULL
#define pci_ss_list_1002_4146 NULL
@@ -24674,13 +25150,18 @@ static const pciSubsystemInfo *pci_ss_list_1002_4c59[] = {
#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
+static const pciSubsystemInfo *pci_ss_list_1002_4e45[] = {
+ &pci_ss_info_1002_4e45_1002_0002,
+ NULL
+};
#define pci_ss_list_1002_4e46 NULL
#define pci_ss_list_1002_4e47 NULL
+#define pci_ss_list_1002_4e48 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_4e68 NULL
#define pci_ss_list_1002_5041 NULL
#define pci_ss_list_1002_5042 NULL
#define pci_ss_list_1002_5043 NULL
@@ -24818,7 +25299,10 @@ static const pciSubsystemInfo *pci_ss_list_1002_524c[] = {
NULL
};
#define pci_ss_list_1002_5345 NULL
-#define pci_ss_list_1002_5346 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5346[] = {
+ &pci_ss_info_1002_5346_1002_0048,
+ NULL
+};
#define pci_ss_list_1002_5347 NULL
#define pci_ss_list_1002_5348 NULL
#define pci_ss_list_1002_534b NULL
@@ -24860,6 +25344,8 @@ static const pciSubsystemInfo *pci_ss_list_1002_5654[] = {
#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_1002_7010 NULL
+#define pci_ss_list_1002_cab2 NULL
#define pci_ss_list_1003_0201 NULL
#define pci_ss_list_1004_0005 NULL
#define pci_ss_list_1004_0006 NULL
@@ -24964,6 +25450,7 @@ static const pciSubsystemInfo *pci_ss_list_1011_0014[] = {
NULL
};
#define pci_ss_list_1011_0016 NULL
+#define pci_ss_list_1011_0017 NULL
static const pciSubsystemInfo *pci_ss_list_1011_0019[] = {
&pci_ss_info_1011_0019_1011_500a,
&pci_ss_info_1011_0019_1011_500b,
@@ -25429,6 +25916,7 @@ static const pciSubsystemInfo *pci_ss_list_1028_0004[] = {
#define pci_ss_list_1028_0006 NULL
#define pci_ss_list_1028_0007 NULL
#define pci_ss_list_1028_0008 NULL
+#define pci_ss_list_1028_0009 NULL
static const pciSubsystemInfo *pci_ss_list_1028_000a[] = {
&pci_ss_info_1028_000a_1028_0106,
&pci_ss_info_1028_000a_1028_011b,
@@ -25436,11 +25924,13 @@ static const pciSubsystemInfo *pci_ss_list_1028_000a[] = {
NULL
};
#define pci_ss_list_1028_000c NULL
+#define pci_ss_list_1028_000d 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_0100 NULL
#define pci_ss_list_102b_0518 NULL
#define pci_ss_list_102b_0519 NULL
static const pciSubsystemInfo *pci_ss_list_102b_051a[] = {
@@ -25698,6 +26188,7 @@ static const pciSubsystemInfo *pci_ss_list_1039_0300[] = {
#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_0648 NULL
#define pci_ss_list_1039_0650 NULL
#define pci_ss_list_1039_0651 NULL
#define pci_ss_list_1039_0730 NULL
@@ -25705,6 +26196,7 @@ static const pciSubsystemInfo *pci_ss_list_1039_0300[] = {
#define pci_ss_list_1039_0735 NULL
#define pci_ss_list_1039_0740 NULL
#define pci_ss_list_1039_0745 NULL
+#define pci_ss_list_1039_0755 NULL
static const pciSubsystemInfo *pci_ss_list_1039_0900[] = {
&pci_ss_info_1039_0900_1039_0900,
NULL
@@ -25841,6 +26333,7 @@ static const pciSubsystemInfo *pci_ss_list_103c_1048[] = {
#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_12b4 NULL
#define pci_ss_list_103c_2910 NULL
#define pci_ss_list_103c_2925 NULL
#define pci_ss_list_1042_1000 NULL
@@ -26117,7 +26610,10 @@ static const pciSubsystemInfo *pci_ss_list_105a_0d38[] = {
NULL
};
#define pci_ss_list_105a_1275 NULL
-#define pci_ss_list_105a_3376 NULL
+static const pciSubsystemInfo *pci_ss_list_105a_3376[] = {
+ &pci_ss_info_105a_3376_1043_809e,
+ NULL
+};
static const pciSubsystemInfo *pci_ss_list_105a_4d30[] = {
&pci_ss_info_105a_4d30_105a_4d33,
&pci_ss_info_105a_4d30_105a_4d39,
@@ -26137,7 +26633,10 @@ 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_4d69[] = {
+ &pci_ss_info_105a_4d69_105a_4d68,
+ NULL
+};
static const pciSubsystemInfo *pci_ss_list_105a_5275[] = {
&pci_ss_info_105a_5275_105a_0275,
NULL
@@ -26187,7 +26686,10 @@ static const pciSubsystemInfo *pci_ss_list_105d_493d[] = {
&pci_ss_info_105d_493d_13cc_000a,
NULL
};
-#define pci_ss_list_105d_5348 NULL
+static const pciSubsystemInfo *pci_ss_list_105d_5348[] = {
+ &pci_ss_info_105d_5348_105d_0037,
+ NULL
+};
#define pci_ss_list_1060_0001 NULL
#define pci_ss_list_1060_0002 NULL
#define pci_ss_list_1060_0101 NULL
@@ -26324,7 +26826,10 @@ static const pciSubsystemInfo *pci_ss_list_1077_2100[] = {
&pci_ss_info_1077_2100_1077_0001,
NULL
};
-#define pci_ss_list_1077_2200 NULL
+static const pciSubsystemInfo *pci_ss_list_1077_2200[] = {
+ &pci_ss_info_1077_2200_1077_0002,
+ NULL
+};
#define pci_ss_list_1077_2300 NULL
#define pci_ss_list_1077_2312 NULL
#endif
@@ -26457,6 +26962,7 @@ static const pciSubsystemInfo *pci_ss_list_108d_0019[] = {
#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_0240 NULL
#define pci_ss_list_1095_0640 NULL
#define pci_ss_list_1095_0643 NULL
#define pci_ss_list_1095_0646 NULL
@@ -26609,6 +27115,7 @@ static const pciSubsystemInfo *pci_ss_list_109e_0879[] = {
#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_3052 NULL
#define pci_ss_list_10a5_5449 NULL
#define pci_ss_list_10a8_0000 NULL
#define pci_ss_list_10a9_0001 NULL
@@ -26619,7 +27126,11 @@ static const pciSubsystemInfo *pci_ss_list_109e_0879[] = {
#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
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10a9_0009[] = {
+ &pci_ss_info_10a9_0009_10a9_8002,
+ NULL
+};
#define pci_ss_list_10a9_0010 NULL
#define pci_ss_list_10a9_0011 NULL
#define pci_ss_list_10a9_0012 NULL
@@ -26631,10 +27142,12 @@ static const pciSubsystemInfo *pci_ss_list_109e_0879[] = {
#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_100a 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
+#endif
#define pci_ss_list_10aa_0000 NULL
#define pci_ss_list_10ad_0001 NULL
#define pci_ss_list_10ad_0003 NULL
@@ -26702,6 +27215,7 @@ static const pciSubsystemInfo *pci_ss_list_10b5_9050[] = {
};
static const pciSubsystemInfo *pci_ss_list_10b5_9054[] = {
&pci_ss_info_10b5_9054_10b5_2455,
+ &pci_ss_info_10b5_9054_12d9_0002,
NULL
};
#define pci_ss_list_10b5_9060 NULL
@@ -26713,6 +27227,7 @@ static const pciSubsystemInfo *pci_ss_list_10b5_906d[] = {
static const pciSubsystemInfo *pci_ss_list_10b5_9080[] = {
&pci_ss_info_10b5_9080_10b5_9080,
&pci_ss_info_10b5_9080_129d_0002,
+ &pci_ss_info_10b5_9080_12d9_0002,
NULL
};
#endif
@@ -26759,6 +27274,7 @@ static const pciSubsystemInfo *pci_ss_list_10b6_000c[] = {
#define pci_ss_list_10b6_1001 NULL
#endif
#define pci_ss_list_10b7_0001 NULL
+#define pci_ss_list_10b7_0910 NULL
#define pci_ss_list_10b7_1006 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_10b7_1007[] = {
@@ -26926,6 +27442,7 @@ static const pciSubsystemInfo *pci_ss_list_10b8_0006[] = {
#define pci_ss_list_10b8_a011 NULL
#define pci_ss_list_10b8_b106 NULL
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_10b9_0111[] = {
&pci_ss_info_10b9_0111_10b9_0111,
NULL
@@ -26995,6 +27512,7 @@ static const pciSubsystemInfo *pci_ss_list_10b9_5229[] = {
#define pci_ss_list_10b9_5251 NULL
#define pci_ss_list_10b9_5253 NULL
#define pci_ss_list_10b9_5261 NULL
+#define pci_ss_list_10b9_5450 NULL
static const pciSubsystemInfo *pci_ss_list_10b9_5451[] = {
&pci_ss_info_10b9_5451_1014_0506,
NULL
@@ -27010,6 +27528,7 @@ static const pciSubsystemInfo *pci_ss_list_10b9_7101[] = {
&pci_ss_info_10b9_7101_10b9_7101,
NULL
};
+#endif
#define pci_ss_list_10ba_0301 NULL
#define pci_ss_list_10bd_0e34 NULL
#define pci_ss_list_10c3_1100 NULL
@@ -27123,6 +27642,7 @@ static const pciSubsystemInfo *pci_ss_list_10de_0028[] = {
&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_1048_0c21,
&pci_ss_info_10de_0028_1092_4804,
&pci_ss_info_10de_0028_1092_4a00,
&pci_ss_info_10de_0028_1092_4a02,
@@ -27239,6 +27759,7 @@ static const pciSubsystemInfo *pci_ss_list_10de_0152[] = {
#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_10b0_0002,
&pci_ss_info_10de_0171_1462_8661,
&pci_ss_info_10de_0171_1462_8730,
&pci_ss_info_10de_0171_147b_8f00,
@@ -27441,6 +27962,8 @@ static const pciSubsystemInfo *pci_ss_list_1102_0002[] = {
&pci_ss_info_1102_0002_1102_8040,
&pci_ss_info_1102_0002_1102_8051,
&pci_ss_info_1102_0002_1102_8061,
+ &pci_ss_info_1102_0002_1102_8064,
+ &pci_ss_info_1102_0002_1102_8065,
NULL
};
static const pciSubsystemInfo *pci_ss_list_1102_0004[] = {
@@ -27476,12 +27999,14 @@ static const pciSubsystemInfo *pci_ss_list_1103_0004[] = {
#define pci_ss_list_1103_0006 NULL
#define pci_ss_list_1103_0007 NULL
#define pci_ss_list_1103_0008 NULL
+#define pci_ss_list_1103_0009 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
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_1106_0305[] = {
&pci_ss_info_1106_0305_1043_8033,
&pci_ss_info_1106_0305_1043_803e,
@@ -27494,7 +28019,9 @@ static const pciSubsystemInfo *pci_ss_list_1106_0305[] = {
#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_1019_0985,
&pci_ss_info_1106_0571_1043_8052,
+ &pci_ss_info_1106_0571_1043_808c,
&pci_ss_info_1106_0571_1106_0571,
&pci_ss_info_1106_0571_1179_0001,
&pci_ss_info_1106_0571_1458_5002,
@@ -27515,9 +28042,14 @@ static const pciSubsystemInfo *pci_ss_list_1106_0596[] = {
#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
+static const pciSubsystemInfo *pci_ss_list_1106_0605[] = {
+ &pci_ss_info_1106_0605_1043_802c,
+ NULL
+};
#define pci_ss_list_1106_0680 NULL
static const pciSubsystemInfo *pci_ss_list_1106_0686[] = {
+ &pci_ss_info_1106_0686_1019_0985,
+ &pci_ss_info_1106_0686_1043_802c,
&pci_ss_info_1106_0686_1043_8033,
&pci_ss_info_1106_0686_1043_803e,
&pci_ss_info_1106_0686_1043_8040,
@@ -27529,6 +28061,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_0686[] = {
NULL
};
static const pciSubsystemInfo *pci_ss_list_1106_0691[] = {
+ &pci_ss_info_1106_0691_1019_0985,
&pci_ss_info_1106_0691_1179_0001,
&pci_ss_info_1106_0691_1458_0691,
NULL
@@ -27542,6 +28075,8 @@ static const pciSubsystemInfo *pci_ss_list_1106_0691[] = {
#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_1019_0985,
+ &pci_ss_info_1106_3038_1043_808c,
&pci_ss_info_1106_3038_1179_0001,
NULL
};
@@ -27556,6 +28091,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3043[] = {
#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_1019_0985,
&pci_ss_info_1106_3057_1043_8033,
&pci_ss_info_1106_3057_1043_803e,
&pci_ss_info_1106_3057_1043_8040,
@@ -27565,6 +28101,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3057[] = {
};
static const pciSubsystemInfo *pci_ss_list_1106_3058[] = {
&pci_ss_info_1106_3058_0e11_b194,
+ &pci_ss_info_1106_3058_1019_0985,
&pci_ss_info_1106_3058_1106_4511,
&pci_ss_info_1106_3058_1458_7600,
&pci_ss_info_1106_3058_1462_3091,
@@ -27572,6 +28109,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3058[] = {
NULL
};
static const pciSubsystemInfo *pci_ss_list_1106_3059[] = {
+ &pci_ss_info_1106_3059_1043_8095,
&pci_ss_info_1106_3059_1458_a002,
NULL
};
@@ -27579,6 +28117,7 @@ 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,
+ &pci_ss_info_1106_3065_13b9_1421,
NULL
};
#define pci_ss_list_1106_3068 NULL
@@ -27596,6 +28135,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3099[] = {
#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_1043_808c,
&pci_ss_info_1106_3104_1458_5004,
NULL
};
@@ -27612,10 +28152,12 @@ static const pciSubsystemInfo *pci_ss_list_1106_3104[] = {
#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_1043_808c,
&pci_ss_info_1106_3177_1458_5001,
NULL
};
static const pciSubsystemInfo *pci_ss_list_1106_3189[] = {
+ &pci_ss_info_1106_3189_1043_807f,
&pci_ss_info_1106_3189_1458_5000,
NULL
};
@@ -27628,7 +28170,10 @@ static const pciSubsystemInfo *pci_ss_list_1106_3189[] = {
#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
+static const pciSubsystemInfo *pci_ss_list_1106_8598[] = {
+ &pci_ss_info_1106_8598_1019_0985,
+ NULL
+};
#define pci_ss_list_1106_8601 NULL
#define pci_ss_list_1106_8605 NULL
#define pci_ss_list_1106_8691 NULL
@@ -27640,6 +28185,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3189[] = {
#define pci_ss_list_1106_b103 NULL
#define pci_ss_list_1106_b112 NULL
#define pci_ss_list_1106_b168 NULL
+#endif
#define pci_ss_list_1107_0576 NULL
#define pci_ss_list_1108_0100 NULL
#define pci_ss_list_1108_0101 NULL
@@ -27652,6 +28198,12 @@ static const pciSubsystemInfo *pci_ss_list_1106_3189[] = {
#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_0006 NULL
+#define pci_ss_list_110a_0015 NULL
+#define pci_ss_list_110a_001d NULL
+#define pci_ss_list_110a_007b NULL
+#define pci_ss_list_110a_007c NULL
+#define pci_ss_list_110a_007d NULL
#define pci_ss_list_110a_2102 NULL
#define pci_ss_list_110a_4942 NULL
#define pci_ss_list_110a_6120 NULL
@@ -28049,6 +28601,7 @@ static const pciSubsystemInfo *pci_ss_list_1163_2000[] = {
};
#define pci_ss_list_1165_0001 NULL
#define pci_ss_list_1166_0005 NULL
+#define pci_ss_list_1166_0006 NULL
#define pci_ss_list_1166_0007 NULL
#define pci_ss_list_1166_0008 NULL
#define pci_ss_list_1166_0009 NULL
@@ -28266,7 +28819,10 @@ static const pciSubsystemInfo *pci_ss_list_11c1_0442[] = {
};
#define pci_ss_list_11c1_0443 NULL
#define pci_ss_list_11c1_0444 NULL
-#define pci_ss_list_11c1_0445 NULL
+static const pciSubsystemInfo *pci_ss_list_11c1_0445[] = {
+ &pci_ss_info_11c1_0445_8086_2203,
+ NULL
+};
#define pci_ss_list_11c1_0446 NULL
#define pci_ss_list_11c1_0447 NULL
static const pciSubsystemInfo *pci_ss_list_11c1_0448[] = {
@@ -28625,6 +29181,7 @@ static const pciSubsystemInfo *pci_ss_list_1260_3873[] = {
&pci_ss_info_1260_3873_8086_2513,
NULL
};
+#define pci_ss_list_1260_3890 NULL
#define pci_ss_list_1260_8130 NULL
#define pci_ss_list_1260_8131 NULL
#endif
@@ -28640,11 +29197,13 @@ static const pciSubsystemInfo *pci_ss_list_1266_1910[] = {
#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_0730 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
+#define pci_ss_list_1274_1171 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_1274_1371[] = {
&pci_ss_info_1274_1371_0e11_0024,
@@ -28716,6 +29275,7 @@ static const pciSubsystemInfo *pci_ss_list_1274_5880[] = {
};
#endif
#define pci_ss_list_1278_0701 NULL
+#define pci_ss_list_1278_0710 NULL
#define pci_ss_list_1279_0295 NULL
#define pci_ss_list_1279_0395 NULL
#define pci_ss_list_1279_0396 NULL
@@ -28896,6 +29456,7 @@ static const pciSubsystemInfo *pci_ss_list_12ae_0001[] = {
NULL
};
static const pciSubsystemInfo *pci_ss_list_12ae_0002[] = {
+ &pci_ss_info_12ae_0002_10a9_8002,
&pci_ss_info_12ae_0002_12ae_0002,
NULL
};
@@ -28969,6 +29530,9 @@ static const pciSubsystemInfo *pci_ss_list_12d2_0018[] = {
#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_12d4_0200 NULL
+#define pci_ss_list_12d9_0002 NULL
+#define pci_ss_list_12d9_0004 NULL
#define pci_ss_list_12e0_0010 NULL
#define pci_ss_list_12e0_0020 NULL
#define pci_ss_list_12e0_0030 NULL
@@ -29052,6 +29616,7 @@ static const pciSubsystemInfo *pci_ss_list_12eb_8803[] = {
#define pci_ss_list_1307_0036 NULL
#define pci_ss_list_1307_0037 NULL
#define pci_ss_list_1307_004c NULL
+#define pci_ss_list_1307_004d NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_1308_0001[] = {
&pci_ss_info_1308_0001_1308_0001,
@@ -29109,6 +29674,7 @@ static const pciSubsystemInfo *pci_ss_list_131f_2030[] = {
#define pci_ss_list_131f_2062 NULL
#endif
#define pci_ss_list_1332_5415 NULL
+#define pci_ss_list_1332_5425 NULL
#define pci_ss_list_134a_0001 NULL
#define pci_ss_list_134a_0002 NULL
#define pci_ss_list_134d_7890 NULL
@@ -29149,6 +29715,7 @@ static const pciSubsystemInfo *pci_ss_list_134d_7891[] = {
#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_4105 NULL
#define pci_ss_list_1385_620a NULL
#define pci_ss_list_1385_622a NULL
#define pci_ss_list_1385_630a NULL
@@ -29213,6 +29780,7 @@ static const pciSubsystemInfo *pci_ss_list_13f6_0111[] = {
&pci_ss_info_13f6_0111_1043_8077,
&pci_ss_info_13f6_0111_1043_80e2,
&pci_ss_info_13f6_0111_13f6_0111,
+ &pci_ss_info_13f6_0111_1681_a000,
NULL
};
#define pci_ss_list_13f6_0211 NULL
@@ -29262,7 +29830,9 @@ static const pciSubsystemInfo *pci_ss_list_1415_9511[] = {
#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_146c_1430 NULL
#define pci_ss_list_148d_1003 NULL
+#define pci_ss_list_149d_0001 NULL
#define pci_ss_list_14af_7102 NULL
#define pci_ss_list_14b3_0000 NULL
#define pci_ss_list_14b5_0200 NULL
@@ -29338,6 +29908,9 @@ static const pciSubsystemInfo *pci_ss_list_14e4_1645[] = {
&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_10a9_8010,
+ &pci_ss_info_14e4_1645_10a9_8011,
+ &pci_ss_info_14e4_1645_10a9_8012,
&pci_ss_info_14e4_1645_10b7_1004,
&pci_ss_info_14e4_1645_10b7_1006,
&pci_ss_info_14e4_1645_10b7_1007,
@@ -29359,6 +29932,7 @@ static const pciSubsystemInfo *pci_ss_list_14e4_1646[] = {
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_10a9_8010,
&pci_ss_info_14e4_1647_14e4_0009,
&pci_ss_info_14e4_1647_14e4_000a,
&pci_ss_info_14e4_1647_14e4_000b,
@@ -29382,6 +29956,7 @@ static const pciSubsystemInfo *pci_ss_list_14e4_1696[] = {
&pci_ss_info_14e4_1696_14e4_000d,
NULL
};
+#define pci_ss_list_14e4_169c NULL
static const pciSubsystemInfo *pci_ss_list_14e4_16a6[] = {
&pci_ss_info_14e4_16a6_0e11_00bb,
&pci_ss_info_14e4_16a6_1028_0126,
@@ -29417,7 +29992,11 @@ static const pciSubsystemInfo *pci_ss_list_14e4_16c7[] = {
#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_4320 NULL
+static const pciSubsystemInfo *pci_ss_list_14e4_4401[] = {
+ &pci_ss_info_14e4_4401_1043_80a8,
+ NULL
+};
#define pci_ss_list_14e4_4402 NULL
#define pci_ss_list_14e4_4410 NULL
#define pci_ss_list_14e4_4411 NULL
@@ -29507,6 +30086,9 @@ static const pciSubsystemInfo *pci_ss_list_14f1_1456[] = {
};
#define pci_ss_list_14f1_1610 NULL
#define pci_ss_list_14f1_1611 NULL
+#define pci_ss_list_14f1_1620 NULL
+#define pci_ss_list_14f1_1621 NULL
+#define pci_ss_list_14f1_1622 NULL
static const pciSubsystemInfo *pci_ss_list_14f1_1803[] = {
&pci_ss_info_14f1_1803_0e11_0023,
&pci_ss_info_14f1_1803_0e11_0043,
@@ -29661,11 +30243,13 @@ static const pciSubsystemInfo *pci_ss_list_1522_0100[] = {
#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_3052 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_16ca_0001 NULL
#define pci_ss_list_16ec_3685 NULL
#define pci_ss_list_173b_03e8 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -29703,10 +30287,13 @@ static const pciSubsystemInfo *pci_ss_list_1813_4100[] = {
#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_1fc0_0300 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
+#define pci_ss_list_3388_101a NULL
+#define pci_ss_list_3388_101b NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_3388_8011[] = {
&pci_ss_info_3388_8011_3388_8011,
@@ -29963,6 +30550,7 @@ static const pciSubsystemInfo *pci_ss_list_5333_9102[] = {
NULL
};
#define pci_ss_list_5333_ca00 NULL
+#define pci_ss_list_544c_0350 NULL
#define pci_ss_list_5455_4458 NULL
#define pci_ss_list_5544_0001 NULL
#define pci_ss_list_5555_0003 NULL
@@ -30082,17 +30670,22 @@ static const pciSubsystemInfo *pci_ss_list_8086_1040[] = {
&pci_ss_info_8086_1040_16be_1040,
NULL
};
+#define pci_ss_list_8086_1043 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,
+ &pci_ss_info_8086_1130_8086_4532,
+ &pci_ss_info_8086_1130_8086_4557,
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,
+ &pci_ss_info_8086_1132_8086_4532,
+ &pci_ss_info_8086_1132_8086_4557,
NULL
};
static const pciSubsystemInfo *pci_ss_list_8086_1161[] = {
@@ -30352,6 +30945,8 @@ static const pciSubsystemInfo *pci_ss_list_8086_2442[] = {
&pci_ss_info_8086_2442_1025_1016,
&pci_ss_info_8086_2442_104d_80df,
&pci_ss_info_8086_2442_147b_0507,
+ &pci_ss_info_8086_2442_8086_4532,
+ &pci_ss_info_8086_2442_8086_4557,
NULL
};
static const pciSubsystemInfo *pci_ss_list_8086_2443[] = {
@@ -30360,12 +30955,15 @@ static const pciSubsystemInfo *pci_ss_list_8086_2443[] = {
&pci_ss_info_8086_2443_1043_8027,
&pci_ss_info_8086_2443_104d_80df,
&pci_ss_info_8086_2443_147b_0507,
+ &pci_ss_info_8086_2443_8086_4532,
+ &pci_ss_info_8086_2443_8086_4557,
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,
+ &pci_ss_info_8086_2444_8086_4532,
NULL
};
static const pciSubsystemInfo *pci_ss_list_8086_2445[] = {
@@ -30374,6 +30972,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_2445[] = {
&pci_ss_info_8086_2445_104d_80df,
&pci_ss_info_8086_2445_1462_3370,
&pci_ss_info_8086_2445_147b_0507,
+ &pci_ss_info_8086_2445_8086_4557,
NULL
};
static const pciSubsystemInfo *pci_ss_list_8086_2446[] = {
@@ -30396,8 +30995,12 @@ static const pciSubsystemInfo *pci_ss_list_8086_2449[] = {
&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_1014_0265,
+ &pci_ss_info_8086_2449_1014_0267,
+ &pci_ss_info_8086_2449_1014_026a,
&pci_ss_info_8086_2449_109f_315d,
&pci_ss_info_8086_2449_109f_3181,
+ &pci_ss_info_8086_2449_1179_ff01,
&pci_ss_info_8086_2449_1186_7801,
&pci_ss_info_8086_2449_144d_2602,
&pci_ss_info_8086_2449_8086_3010,
@@ -30420,6 +31023,8 @@ 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,
+ &pci_ss_info_8086_244b_8086_4532,
+ &pci_ss_info_8086_244b_8086_4557,
NULL
};
#define pci_ss_list_8086_244c NULL
@@ -30515,14 +31120,28 @@ static const pciSubsystemInfo *pci_ss_list_8086_24c7[] = {
&pci_ss_info_8086_24c7_1462_5800,
NULL
};
+#define pci_ss_list_8086_24ca NULL
static const pciSubsystemInfo *pci_ss_list_8086_24cb[] = {
&pci_ss_info_8086_24cb_1462_5800,
NULL
};
+#define pci_ss_list_8086_24cc NULL
static const pciSubsystemInfo *pci_ss_list_8086_24cd[] = {
&pci_ss_info_8086_24cd_1462_3981,
NULL
};
+#define pci_ss_list_8086_24d0 NULL
+#define pci_ss_list_8086_24d1 NULL
+#define pci_ss_list_8086_24d2 NULL
+#define pci_ss_list_8086_24d3 NULL
+#define pci_ss_list_8086_24d4 NULL
+#define pci_ss_list_8086_24d5 NULL
+#define pci_ss_list_8086_24d6 NULL
+#define pci_ss_list_8086_24d7 NULL
+#define pci_ss_list_8086_24db NULL
+#define pci_ss_list_8086_24dc NULL
+#define pci_ss_list_8086_24dd NULL
+#define pci_ss_list_8086_24de NULL
static const pciSubsystemInfo *pci_ss_list_8086_2500[] = {
&pci_ss_info_8086_2500_1028_0095,
&pci_ss_info_8086_2500_1043_801c,
@@ -30558,6 +31177,13 @@ static const pciSubsystemInfo *pci_ss_list_8086_2541[] = {
#define pci_ss_list_8086_2546 NULL
#define pci_ss_list_8086_2547 NULL
#define pci_ss_list_8086_2548 NULL
+#define pci_ss_list_8086_254c NULL
+#define pci_ss_list_8086_2550 NULL
+#define pci_ss_list_8086_2551 NULL
+#define pci_ss_list_8086_2552 NULL
+#define pci_ss_list_8086_2553 NULL
+#define pci_ss_list_8086_2554 NULL
+#define pci_ss_list_8086_255d NULL
static const pciSubsystemInfo *pci_ss_list_8086_2560[] = {
&pci_ss_info_8086_2560_1462_5800,
NULL
@@ -30565,8 +31191,17 @@ static const pciSubsystemInfo *pci_ss_list_8086_2560[] = {
#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_2571 NULL
#define pci_ss_list_8086_2572 NULL
+#define pci_ss_list_8086_2573 NULL
+#define pci_ss_list_8086_2576 NULL
+#define pci_ss_list_8086_2578 NULL
+#define pci_ss_list_8086_2579 NULL
+#define pci_ss_list_8086_257b NULL
+#define pci_ss_list_8086_257e NULL
#define pci_ss_list_8086_3092 NULL
+#define pci_ss_list_8086_3340 NULL
+#define pci_ss_list_8086_3341 NULL
static const pciSubsystemInfo *pci_ss_list_8086_3575[] = {
&pci_ss_info_8086_3575_1014_021d,
&pci_ss_info_8086_3575_104d_80e7,
@@ -30596,7 +31231,10 @@ static const pciSubsystemInfo *pci_ss_list_8086_5201[] = {
#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
+static const pciSubsystemInfo *pci_ss_list_8086_7121[] = {
+ &pci_ss_info_8086_7121_8086_4341,
+ NULL
+};
#define pci_ss_list_8086_7122 NULL
#define pci_ss_list_8086_7123 NULL
#define pci_ss_list_8086_7124 NULL
@@ -30691,11 +31329,6 @@ static const pciSubsystemInfo *pci_ss_list_9004_5078[] = {
#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
@@ -30743,6 +31376,8 @@ static const pciSubsystemInfo *pci_ss_list_9004_6915[] = {
#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_7710 NULL
+#define pci_ss_list_9004_7711 NULL
#define pci_ss_list_9004_7778 NULL
#define pci_ss_list_9004_7810 NULL
static const pciSubsystemInfo *pci_ss_list_9004_7815[] = {
@@ -30891,11 +31526,18 @@ static const pciSubsystemInfo *pci_ss_list_9005_8011[] = {
#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_8080 NULL
+#define pci_ss_list_9005_808f 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_8095 NULL
+#define pci_ss_list_9005_8096 NULL
+#define pci_ss_list_9005_8097 NULL
+#define pci_ss_list_9005_809c NULL
+#define pci_ss_list_9005_809d NULL
#define pci_ss_list_9005_809e NULL
#define pci_ss_list_9005_809f NULL
#endif
@@ -31258,6 +31900,9 @@ static const pciSubsystemInfo *pci_ss_list_1014[] = {
&pci_ss_info_1014_0245,
&pci_ss_info_1014_0258,
&pci_ss_info_1014_0259,
+ &pci_ss_info_1014_0265,
+ &pci_ss_info_1014_0267,
+ &pci_ss_info_1014_026a,
&pci_ss_info_1014_0277,
&pci_ss_info_1014_0279,
&pci_ss_info_1014_028c,
@@ -31298,6 +31943,7 @@ static const pciSubsystemInfo *pci_ss_list_1014[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_1019[] = {
&pci_ss_info_1019_0970,
+ &pci_ss_info_1019_0985,
&pci_ss_info_1019_7018,
NULL
};
@@ -31635,6 +32281,7 @@ static const pciSubsystemInfo *pci_ss_list_1043[] = {
&pci_ss_info_1043_800b,
&pci_ss_info_1043_801c,
&pci_ss_info_1043_8027,
+ &pci_ss_info_1043_802c,
&pci_ss_info_1043_8033,
&pci_ss_info_1043_803e,
&pci_ss_info_1043_8040,
@@ -31645,6 +32292,10 @@ static const pciSubsystemInfo *pci_ss_list_1043[] = {
&pci_ss_info_1043_8064,
&pci_ss_info_1043_8077,
&pci_ss_info_1043_807f,
+ &pci_ss_info_1043_808c,
+ &pci_ss_info_1043_8095,
+ &pci_ss_info_1043_809e,
+ &pci_ss_info_1043_80a8,
&pci_ss_info_1043_80ad,
&pci_ss_info_1043_80e2,
NULL
@@ -31701,6 +32352,7 @@ static const pciSubsystemInfo *pci_ss_list_1048[] = {
&pci_ss_info_1048_0c10,
&pci_ss_info_1048_0c18,
&pci_ss_info_1048_0c1b,
+ &pci_ss_info_1048_0c21,
&pci_ss_info_1048_0c3a,
&pci_ss_info_1048_0c56,
&pci_ss_info_1048_1500,
@@ -31805,6 +32457,7 @@ static const pciSubsystemInfo *pci_ss_list_105d[] = {
&pci_ss_info_105d_000b,
&pci_ss_info_105d_0018,
&pci_ss_info_105d_002a,
+ &pci_ss_info_105d_0037,
&pci_ss_info_105d_003a,
&pci_ss_info_105d_092f,
NULL
@@ -31855,6 +32508,7 @@ static const pciSubsystemInfo *pci_ss_list_1073[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_1077[] = {
&pci_ss_info_1077_0001,
+ &pci_ss_info_1077_0002,
NULL
};
#endif
@@ -32042,7 +32696,15 @@ static const pciSubsystemInfo *pci_ss_list_109f[] = {
#define pci_ss_list_10a6 NULL
#define pci_ss_list_10a7 NULL
#define pci_ss_list_10a8 NULL
-#define pci_ss_list_10a9 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10a9[] = {
+ &pci_ss_info_10a9_8002,
+ &pci_ss_info_10a9_8010,
+ &pci_ss_info_10a9_8011,
+ &pci_ss_info_10a9_8012,
+ NULL
+};
+#endif
#define pci_ss_list_10aa NULL
#define pci_ss_list_10ab NULL
#define pci_ss_list_10ac NULL
@@ -32052,6 +32714,7 @@ static const pciSubsystemInfo *pci_ss_list_109f[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_10b0[] = {
&pci_ss_info_10b0_0001,
+ &pci_ss_info_10b0_0002,
NULL
};
#endif
@@ -32163,6 +32826,7 @@ static const pciSubsystemInfo *pci_ss_list_10b8[] = {
NULL
};
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_10b9[] = {
&pci_ss_info_10b9_0111,
&pci_ss_info_10b9_1521,
@@ -32172,6 +32836,7 @@ static const pciSubsystemInfo *pci_ss_list_10b9[] = {
&pci_ss_info_10b9_7101,
NULL
};
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_10ba[] = {
&pci_ss_info_10ba_0e00,
@@ -32383,6 +33048,8 @@ static const pciSubsystemInfo *pci_ss_list_1102[] = {
&pci_ss_info_1102_8040,
&pci_ss_info_1102_8051,
&pci_ss_info_1102_8061,
+ &pci_ss_info_1102_8064,
+ &pci_ss_info_1102_8065,
NULL
};
#endif
@@ -32395,6 +33062,7 @@ static const pciSubsystemInfo *pci_ss_list_1103[] = {
#endif
#define pci_ss_list_1104 NULL
#define pci_ss_list_1105 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_1106[] = {
&pci_ss_info_1106_0000,
&pci_ss_info_1106_0100,
@@ -32404,6 +33072,7 @@ static const pciSubsystemInfo *pci_ss_list_1106[] = {
&pci_ss_info_1106_4511,
NULL
};
+#endif
#define pci_ss_list_1107 NULL
#define pci_ss_list_1108 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -32673,6 +33342,7 @@ static const pciSubsystemInfo *pci_ss_list_1179[] = {
&pci_ss_info_1179_0203,
&pci_ss_info_1179_0204,
&pci_ss_info_1179_ff00,
+ &pci_ss_info_1179_ff01,
NULL
};
#endif
@@ -33322,6 +33992,7 @@ static const pciSubsystemInfo *pci_ss_list_12be[] = {
#define pci_ss_list_12d8 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciSubsystemInfo *pci_ss_list_12d9[] = {
+ &pci_ss_info_12d9_0002,
&pci_ss_info_12d9_000a,
NULL
};
@@ -33628,7 +34299,12 @@ static const pciSubsystemInfo *pci_ss_list_13a2[] = {
#define pci_ss_list_13b6 NULL
#define pci_ss_list_13b7 NULL
#define pci_ss_list_13b8 NULL
-#define pci_ss_list_13b9 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13b9[] = {
+ &pci_ss_info_13b9_1421,
+ NULL
+};
+#endif
#define pci_ss_list_13ba NULL
#define pci_ss_list_13bb NULL
#define pci_ss_list_13bc NULL
@@ -34749,6 +35425,7 @@ static const pciSubsystemInfo *pci_ss_list_1668[] = {
static const pciSubsystemInfo *pci_ss_list_1681[] = {
&pci_ss_info_1681_0040,
&pci_ss_info_1681_0050,
+ &pci_ss_info_1681_a000,
&pci_ss_info_1681_a011,
NULL
};
@@ -34762,6 +35439,7 @@ static const pciSubsystemInfo *pci_ss_list_16be[] = {
NULL
};
#endif
+#define pci_ss_list_16ca NULL
#define pci_ss_list_16ec NULL
#define pci_ss_list_16f6 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -34856,6 +35534,7 @@ static const pciSubsystemInfo *pci_ss_list_1de1[] = {
NULL
};
#endif
+#define pci_ss_list_1fc0 NULL
#define pci_ss_list_2000 NULL
#define pci_ss_list_2001 NULL
#define pci_ss_list_2003 NULL
@@ -35115,6 +35794,8 @@ static const pciSubsystemInfo *pci_ss_list_8086[] = {
&pci_ss_info_8086_425a,
&pci_ss_info_8086_4341,
&pci_ss_info_8086_4343,
+ &pci_ss_info_8086_4532,
+ &pci_ss_info_8086_4557,
&pci_ss_info_8086_4649,
&pci_ss_info_8086_464a,
&pci_ss_info_8086_4d4f,
@@ -35149,8 +35830,6 @@ static const pciSubsystemInfo *pci_ss_list_9004[] = {
&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,
@@ -36247,6 +36926,15 @@ static const pciDeviceInfo pci_dev_info_1001_9100 = {
0
};
#endif
+static const pciDeviceInfo pci_dev_info_1002_4136 = {
+ 0x4136, pci_device_1002_4136,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4136,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1002_4144 = {
0x4144, pci_device_1002_4144,
#ifdef INIT_SUBSYS_INFO
@@ -36814,6 +37502,15 @@ static const pciDeviceInfo pci_dev_info_1002_4e47 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1002_4e48 = {
+ 0x4e48, pci_device_1002_4e48,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e48,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1002_4e64 = {
0x4e64, pci_device_1002_4e64,
#ifdef INIT_SUBSYS_INFO
@@ -36850,6 +37547,15 @@ static const pciDeviceInfo pci_dev_info_1002_4e67 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1002_4e68 = {
+ 0x4e68, pci_device_1002_4e68,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e68,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1002_5041 = {
0x5041, pci_device_1002_5041,
#ifdef INIT_SUBSYS_INFO
@@ -37471,6 +38177,24 @@ static const pciDeviceInfo pci_dev_info_1002_700f = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1002_7010 = {
+ 0x7010, pci_device_1002_7010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_7010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_cab2 = {
+ 0xcab2, pci_device_1002_cab2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_cab2,
+#else
+ NULL,
+#endif
+ 0
+};
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_1003_0201 = {
0x0201, pci_device_1003_0201,
@@ -38060,6 +38784,15 @@ static const pciDeviceInfo pci_dev_info_1011_0016 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1011_0017 = {
+ 0x0017, pci_device_1011_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0017,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1011_0019 = {
0x0019, pci_device_1011_0019,
#ifdef INIT_SUBSYS_INFO
@@ -40392,6 +41125,15 @@ static const pciDeviceInfo pci_dev_info_1028_0008 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1028_0009 = {
+ 0x0009, pci_device_1028_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0009,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1028_000a = {
0x000a, pci_device_1028_000a,
#ifdef INIT_SUBSYS_INFO
@@ -40410,6 +41152,15 @@ static const pciDeviceInfo pci_dev_info_1028_000c = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1028_000d = {
+ 0x000d, pci_device_1028_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_000d,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1028_000e = {
0x000e, pci_device_1028_000e,
#ifdef INIT_SUBSYS_INFO
@@ -40457,6 +41208,15 @@ static const pciDeviceInfo pci_dev_info_102b_0010 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_102b_0100 = {
+ 0x0100, pci_device_102b_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0100,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_102b_0518 = {
0x0518, pci_device_102b_0518,
#ifdef INIT_SUBSYS_INFO
@@ -41282,6 +42042,15 @@ static const pciDeviceInfo pci_dev_info_1039_0646 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1039_0648 = {
+ 0x0648, pci_device_1039_0648,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0648,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1039_0650 = {
0x0650, pci_device_1039_0650,
#ifdef INIT_SUBSYS_INFO
@@ -41345,6 +42114,15 @@ static const pciDeviceInfo pci_dev_info_1039_0745 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1039_0755 = {
+ 0x0755, pci_device_1039_0755,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0755,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1039_0900 = {
0x0900, pci_device_1039_0900,
#ifdef INIT_SUBSYS_INFO
@@ -41867,6 +42645,15 @@ static const pciDeviceInfo pci_dev_info_103c_1290 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_103c_12b4 = {
+ 0x12b4, pci_device_103c_12b4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_12b4,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_103c_2910 = {
0x2910, pci_device_103c_2910,
#ifdef INIT_SUBSYS_INFO
@@ -45310,6 +46097,15 @@ static const pciDeviceInfo pci_dev_info_1093_c831 = {
};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1095_0240 = {
+ 0x0240, pci_device_1095_0240,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0240,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1095_0640 = {
0x0640, pci_device_1095_0640,
#ifdef INIT_SUBSYS_INFO
@@ -45584,6 +46380,15 @@ static const pciDeviceInfo pci_dev_info_109e_8474 = {
0
};
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10a5_3052 = {
+ 0x3052, pci_device_10a5_3052,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a5_3052,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_10a5_5449 = {
0x5449, pci_device_10a5_5449,
#ifdef INIT_SUBSYS_INFO
@@ -45786,6 +46591,15 @@ static const pciDeviceInfo pci_dev_info_10a9_1008 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_10a9_100a = {
+ 0x100a, pci_device_10a9_100a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_100a,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_10a9_2001 = {
0x2001, pci_device_10a9_2001,
#ifdef INIT_SUBSYS_INFO
@@ -46187,6 +47001,15 @@ static const pciDeviceInfo pci_dev_info_10b7_0001 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_10b7_0910 = {
+ 0x0910, pci_device_10b7_0910,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_0910,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_10b7_1006 = {
0x1006, pci_device_10b7_1006,
#ifdef INIT_SUBSYS_INFO
@@ -46721,6 +47544,7 @@ static const pciDeviceInfo pci_dev_info_10b8_b106 = {
0
};
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_10b9_0111 = {
0x0111, pci_device_10b9_0111,
#ifdef INIT_SUBSYS_INFO
@@ -47180,6 +48004,15 @@ static const pciDeviceInfo pci_dev_info_10b9_5261 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_10b9_5450 = {
+ 0x5450, pci_device_10b9_5450,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5450,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_10b9_5451 = {
0x5451, pci_device_10b9_5451,
#ifdef INIT_SUBSYS_INFO
@@ -47261,6 +48094,7 @@ static const pciDeviceInfo pci_dev_info_10b9_7101 = {
#endif
0
};
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_10ba_0301 = {
0x0301, pci_device_10ba_0301,
@@ -49144,6 +49978,15 @@ static const pciDeviceInfo pci_dev_info_1103_0008 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1103_0009 = {
+ 0x0009, pci_device_1103_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1103_0009,
+#else
+ NULL,
+#endif
+ 0
+};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_1105_1105 = {
@@ -49174,6 +50017,7 @@ static const pciDeviceInfo pci_dev_info_1105_8400 = {
0
};
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_1106_0102 = {
0x0102, pci_device_1106_0102,
#ifdef INIT_SUBSYS_INFO
@@ -49894,6 +50738,7 @@ static const pciDeviceInfo pci_dev_info_1106_b168 = {
#endif
0
};
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_1107_0576 = {
0x0576, pci_device_1107_0576,
@@ -50009,6 +50854,60 @@ static const pciDeviceInfo pci_dev_info_110a_0005 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_110a_0006 = {
+ 0x0006, pci_device_110a_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_0015 = {
+ 0x0015, pci_device_110a_0015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_0015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_001d = {
+ 0x001d, pci_device_110a_001d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_001d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_007b = {
+ 0x007b, pci_device_110a_007b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_007b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_007c = {
+ 0x007c, pci_device_110a_007c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_007c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_007d = {
+ 0x007d, pci_device_110a_007d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_007d,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_110a_2102 = {
0x2102, pci_device_110a_2102,
#ifdef INIT_SUBSYS_INFO
@@ -52132,6 +53031,15 @@ static const pciDeviceInfo pci_dev_info_1166_0005 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1166_0006 = {
+ 0x0006, pci_device_1166_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0006,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1166_0007 = {
0x0007, pci_device_1166_0007,
#ifdef INIT_SUBSYS_INFO
@@ -54782,6 +55690,15 @@ static const pciDeviceInfo pci_dev_info_1260_3873 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1260_3890 = {
+ 0x3890, pci_device_1260_3890,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1260_3890,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1260_8130 = {
0x8130, pci_device_1260_8130,
#ifdef INIT_SUBSYS_INFO
@@ -54868,6 +55785,15 @@ static const pciDeviceInfo pci_dev_info_126f_0720 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_126f_0730 = {
+ 0x0730, pci_device_126f_0730,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0730,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_126f_0810 = {
0x0810, pci_device_126f_0810,
#ifdef INIT_SUBSYS_INFO
@@ -54916,6 +55842,15 @@ static const pciDeviceInfo pci_dev_info_1273_0002 = {
};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1274_1171 = {
+ 0x1171, pci_device_1274_1171,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1274_1171,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1274_1371 = {
0x1371, pci_device_1274_1371,
#ifdef INIT_SUBSYS_INFO
@@ -54954,6 +55889,15 @@ static const pciDeviceInfo pci_dev_info_1278_0701 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1278_0710 = {
+ 0x0710, pci_device_1278_0710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1278_0710,
+#else
+ NULL,
+#endif
+ 0
+};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_1279_0295 = {
@@ -55634,6 +56578,37 @@ static const pciDeviceInfo pci_dev_info_12d2_00a0 = {
0
};
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12d4_0200 = {
+ 0x0200, pci_device_12d4_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d4_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12d9_0002 = {
+ 0x0002, pci_device_12d9_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d9_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d9_0004 = {
+ 0x0004, pci_device_12d9_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d9_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_12e0_0010 = {
0x0010, pci_device_12e0_0010,
#ifdef INIT_SUBSYS_INFO
@@ -56027,6 +57002,15 @@ static const pciDeviceInfo pci_dev_info_1307_004c = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1307_004d = {
+ 0x004d, pci_device_1307_004d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_004d,
+#else
+ NULL,
+#endif
+ 0
+};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_1308_0001 = {
@@ -56462,6 +57446,15 @@ static const pciDeviceInfo pci_dev_info_1332_5415 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1332_5425 = {
+ 0x5425, pci_device_1332_5425,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1332_5425,
+#else
+ NULL,
+#endif
+ 0
+};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_134a_0001 = {
@@ -56789,6 +57782,15 @@ static const pciDeviceInfo pci_dev_info_1385_4100 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_1385_4105 = {
+ 0x4105, pci_device_1385_4105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1385_4105,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_1385_620a = {
0x620a, pci_device_1385_620a,
#ifdef INIT_SUBSYS_INFO
@@ -57494,6 +58496,17 @@ static const pciDeviceInfo pci_dev_info_145f_0001 = {
};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_146c_1430 = {
+ 0x1430, pci_device_146c_1430,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_146c_1430,
+#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
@@ -57505,6 +58518,17 @@ static const pciDeviceInfo pci_dev_info_148d_1003 = {
};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_149d_0001 = {
+ 0x0001, pci_device_149d_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_149d_0001,
+#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
@@ -58016,6 +59040,15 @@ static const pciDeviceInfo pci_dev_info_14e4_1696 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_14e4_169c = {
+ 0x169c, pci_device_14e4_169c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_169c,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_14e4_16a6 = {
0x16a6, pci_device_14e4_16a6,
#ifdef INIT_SUBSYS_INFO
@@ -58097,6 +59130,15 @@ static const pciDeviceInfo pci_dev_info_14e4_4301 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_14e4_4320 = {
+ 0x4320, pci_device_14e4_4320,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4320,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_14e4_4401 = {
0x4401, pci_device_14e4_4401,
#ifdef INIT_SUBSYS_INFO
@@ -58497,6 +59539,33 @@ static const pciDeviceInfo pci_dev_info_14f1_1611 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_14f1_1620 = {
+ 0x1620, pci_device_14f1_1620,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1620,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1621 = {
+ 0x1621, pci_device_14f1_1621,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1621,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1622 = {
+ 0x1622, pci_device_14f1_1622,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1622,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_14f1_1803 = {
0x1803, pci_device_14f1_1803,
#ifdef INIT_SUBSYS_INFO
@@ -59491,6 +60560,15 @@ static const pciDeviceInfo pci_dev_info_1638_1100 = {
};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_163c_3052 = {
+ 0x3052, pci_device_163c_3052,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_163c_3052,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_163c_5449 = {
0x5449, pci_device_163c_5449,
#ifdef INIT_SUBSYS_INFO
@@ -59542,6 +60620,17 @@ static const pciDeviceInfo pci_dev_info_16ab_1102 = {
};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_16ca_0001 = {
+ 0x0001, pci_device_16ca_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_16ca_0001,
+#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
@@ -59780,6 +60869,17 @@ static const pciDeviceInfo pci_dev_info_1de1_dc29 = {
};
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1fc0_0300 = {
+ 0x0300, pci_device_1fc0_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1fc0_0300,
+#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
@@ -59818,6 +60918,24 @@ static const pciDeviceInfo pci_dev_info_3388_0021 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_3388_101a = {
+ 0x101a, pci_device_3388_101a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_101a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3388_101b = {
+ 0x101b, pci_device_3388_101b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_101b,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_3388_8011 = {
0x8011, pci_device_3388_8011,
#ifdef INIT_SUBSYS_INFO
@@ -61102,6 +62220,17 @@ static const pciDeviceInfo pci_dev_info_5333_ca00 = {
0
};
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_544c_0350 = {
+ 0x0350, pci_device_544c_0350,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_544c_0350,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo pci_dev_info_5455_4458 = {
0x4458, pci_device_5455_4458,
#ifdef INIT_SUBSYS_INFO
@@ -61590,6 +62719,15 @@ static const pciDeviceInfo pci_dev_info_8086_1040 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_1043 = {
+ 0x1043, pci_device_8086_1043,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1043,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_1059 = {
0x1059, pci_device_8086_1059,
#ifdef INIT_SUBSYS_INFO
@@ -62427,6 +63565,15 @@ static const pciDeviceInfo pci_dev_info_8086_24c7 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_24ca = {
+ 0x24ca, pci_device_8086_24ca,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24ca,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_24cb = {
0x24cb, pci_device_8086_24cb,
#ifdef INIT_SUBSYS_INFO
@@ -62436,6 +63583,15 @@ static const pciDeviceInfo pci_dev_info_8086_24cb = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_24cc = {
+ 0x24cc, pci_device_8086_24cc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24cc,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_24cd = {
0x24cd, pci_device_8086_24cd,
#ifdef INIT_SUBSYS_INFO
@@ -62445,6 +63601,114 @@ static const pciDeviceInfo pci_dev_info_8086_24cd = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_24d0 = {
+ 0x24d0, pci_device_8086_24d0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24d1 = {
+ 0x24d1, pci_device_8086_24d1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24d2 = {
+ 0x24d2, pci_device_8086_24d2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24d3 = {
+ 0x24d3, pci_device_8086_24d3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24d4 = {
+ 0x24d4, pci_device_8086_24d4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24d5 = {
+ 0x24d5, pci_device_8086_24d5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24d6 = {
+ 0x24d6, pci_device_8086_24d6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24d7 = {
+ 0x24d7, pci_device_8086_24d7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24d7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24db = {
+ 0x24db, pci_device_8086_24db,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24db,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24dc = {
+ 0x24dc, pci_device_8086_24dc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24dc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24dd = {
+ 0x24dd, pci_device_8086_24dd,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24dd,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24de = {
+ 0x24de, pci_device_8086_24de,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24de,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_2500 = {
0x2500, pci_device_8086_2500,
#ifdef INIT_SUBSYS_INFO
@@ -62616,6 +63880,69 @@ static const pciDeviceInfo pci_dev_info_8086_2548 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_254c = {
+ 0x254c, pci_device_8086_254c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_254c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2550 = {
+ 0x2550, pci_device_8086_2550,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2550,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2551 = {
+ 0x2551, pci_device_8086_2551,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2551,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2552 = {
+ 0x2552, pci_device_8086_2552,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2552,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2553 = {
+ 0x2553, pci_device_8086_2553,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2553,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2554 = {
+ 0x2554, pci_device_8086_2554,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2554,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_255d = {
+ 0x255d, pci_device_8086_255d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_255d,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_2560 = {
0x2560, pci_device_8086_2560,
#ifdef INIT_SUBSYS_INFO
@@ -62652,6 +63979,15 @@ static const pciDeviceInfo pci_dev_info_8086_2570 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_2571 = {
+ 0x2571, pci_device_8086_2571,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2571,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_2572 = {
0x2572, pci_device_8086_2572,
#ifdef INIT_SUBSYS_INFO
@@ -62661,6 +63997,60 @@ static const pciDeviceInfo pci_dev_info_8086_2572 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_2573 = {
+ 0x2573, pci_device_8086_2573,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2573,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2576 = {
+ 0x2576, pci_device_8086_2576,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2576,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2578 = {
+ 0x2578, pci_device_8086_2578,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2578,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2579 = {
+ 0x2579, pci_device_8086_2579,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2579,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_257b = {
+ 0x257b, pci_device_8086_257b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_257b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_257e = {
+ 0x257e, pci_device_8086_257e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_257e,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_3092 = {
0x3092, pci_device_8086_3092,
#ifdef INIT_SUBSYS_INFO
@@ -62670,6 +64060,24 @@ static const pciDeviceInfo pci_dev_info_8086_3092 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_8086_3340 = {
+ 0x3340, pci_device_8086_3340,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3340,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3341 = {
+ 0x3341, pci_device_8086_3341,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3341,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_8086_3575 = {
0x3575, pci_device_8086_3575,
#ifdef INIT_SUBSYS_INFO
@@ -63440,15 +64848,6 @@ static const pciDeviceInfo pci_dev_info_9004_5578 = {
#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
@@ -63674,6 +65073,24 @@ static const pciDeviceInfo pci_dev_info_9004_7678 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_9004_7710 = {
+ 0x7710, pci_device_9004_7710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7710,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7711 = {
+ 0x7711, pci_device_9004_7711,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7711,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_9004_7778 = {
0x7778, pci_device_9004_7778,
#ifdef INIT_SUBSYS_INFO
@@ -64243,6 +65660,24 @@ static const pciDeviceInfo pci_dev_info_9005_801f = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_9005_8080 = {
+ 0x8080, pci_device_9005_8080,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8080,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_808f = {
+ 0x808f, pci_device_9005_808f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_808f,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_9005_8090 = {
0x8090, pci_device_9005_8090,
#ifdef INIT_SUBSYS_INFO
@@ -64288,6 +65723,51 @@ static const pciDeviceInfo pci_dev_info_9005_8094 = {
#endif
0
};
+static const pciDeviceInfo pci_dev_info_9005_8095 = {
+ 0x8095, pci_device_9005_8095,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8095,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8096 = {
+ 0x8096, pci_device_9005_8096,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8096,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8097 = {
+ 0x8097, pci_device_9005_8097,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8097,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_809c = {
+ 0x809c, pci_device_9005_809c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_809c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_809d = {
+ 0x809d, pci_device_9005_809d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_809d,
+#else
+ NULL,
+#endif
+ 0
+};
static const pciDeviceInfo pci_dev_info_9005_809e = {
0x809e, pci_device_9005_809e,
#ifdef INIT_SUBSYS_INFO
@@ -64862,6 +66342,7 @@ static const pciDeviceInfo *pci_dev_list_1001[] = {
};
#endif
static const pciDeviceInfo *pci_dev_list_1002[] = {
+ &pci_dev_info_1002_4136,
&pci_dev_info_1002_4144,
&pci_dev_info_1002_4145,
&pci_dev_info_1002_4146,
@@ -64925,10 +66406,12 @@ static const pciDeviceInfo *pci_dev_list_1002[] = {
&pci_dev_info_1002_4e45,
&pci_dev_info_1002_4e46,
&pci_dev_info_1002_4e47,
+ &pci_dev_info_1002_4e48,
&pci_dev_info_1002_4e64,
&pci_dev_info_1002_4e65,
&pci_dev_info_1002_4e66,
&pci_dev_info_1002_4e67,
+ &pci_dev_info_1002_4e68,
&pci_dev_info_1002_5041,
&pci_dev_info_1002_5042,
&pci_dev_info_1002_5043,
@@ -64998,6 +66481,8 @@ static const pciDeviceInfo *pci_dev_list_1002[] = {
&pci_dev_info_1002_5655,
&pci_dev_info_1002_5656,
&pci_dev_info_1002_700f,
+ &pci_dev_info_1002_7010,
+ &pci_dev_info_1002_cab2,
NULL
};
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -65094,6 +66579,7 @@ static const pciDeviceInfo *pci_dev_list_1011[] = {
&pci_dev_info_1011_000f,
&pci_dev_info_1011_0014,
&pci_dev_info_1011_0016,
+ &pci_dev_info_1011_0017,
&pci_dev_info_1011_0019,
&pci_dev_info_1011_001a,
&pci_dev_info_1011_0021,
@@ -65402,8 +66888,10 @@ static const pciDeviceInfo *pci_dev_list_1028[] = {
&pci_dev_info_1028_0006,
&pci_dev_info_1028_0007,
&pci_dev_info_1028_0008,
+ &pci_dev_info_1028_0009,
&pci_dev_info_1028_000a,
&pci_dev_info_1028_000c,
+ &pci_dev_info_1028_000d,
&pci_dev_info_1028_000e,
&pci_dev_info_1028_000f,
NULL
@@ -65418,6 +66906,7 @@ static const pciDeviceInfo *pci_dev_list_102a[] = {
#endif
static const pciDeviceInfo *pci_dev_list_102b[] = {
&pci_dev_info_102b_0010,
+ &pci_dev_info_102b_0100,
&pci_dev_info_102b_0518,
&pci_dev_info_102b_0519,
&pci_dev_info_102b_051a,
@@ -65543,6 +67032,7 @@ static const pciDeviceInfo *pci_dev_list_1039[] = {
&pci_dev_info_1039_0635,
&pci_dev_info_1039_0645,
&pci_dev_info_1039_0646,
+ &pci_dev_info_1039_0648,
&pci_dev_info_1039_0650,
&pci_dev_info_1039_0651,
&pci_dev_info_1039_0730,
@@ -65550,6 +67040,7 @@ static const pciDeviceInfo *pci_dev_list_1039[] = {
&pci_dev_info_1039_0735,
&pci_dev_info_1039_0740,
&pci_dev_info_1039_0745,
+ &pci_dev_info_1039_0755,
&pci_dev_info_1039_0900,
&pci_dev_info_1039_0961,
&pci_dev_info_1039_0962,
@@ -65613,6 +67104,7 @@ static const pciDeviceInfo *pci_dev_list_103c[] = {
&pci_dev_info_103c_122a,
&pci_dev_info_103c_122e,
&pci_dev_info_103c_1290,
+ &pci_dev_info_103c_12b4,
&pci_dev_info_103c_2910,
&pci_dev_info_103c_2925,
NULL
@@ -66213,6 +67705,7 @@ static const pciDeviceInfo *pci_dev_list_1093[] = {
#define pci_dev_list_1094 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1095[] = {
+ &pci_dev_info_1095_0240,
&pci_dev_info_1095_0640,
&pci_dev_info_1095_0643,
&pci_dev_info_1095_0646,
@@ -66269,6 +67762,7 @@ static const pciDeviceInfo *pci_dev_list_109e[] = {
#define pci_dev_list_10a4 NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_10a5[] = {
+ &pci_dev_info_10a5_3052,
&pci_dev_info_10a5_5449,
NULL
};
@@ -66303,6 +67797,7 @@ static const pciDeviceInfo *pci_dev_list_10a9[] = {
&pci_dev_info_10a9_1006,
&pci_dev_info_10a9_1007,
&pci_dev_info_10a9_1008,
+ &pci_dev_info_10a9_100a,
&pci_dev_info_10a9_2001,
&pci_dev_info_10a9_2002,
&pci_dev_info_10a9_8001,
@@ -66388,6 +67883,7 @@ static const pciDeviceInfo *pci_dev_list_10b6[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_10b7[] = {
&pci_dev_info_10b7_0001,
+ &pci_dev_info_10b7_0910,
&pci_dev_info_10b7_1006,
&pci_dev_info_10b7_1007,
&pci_dev_info_10b7_3390,
@@ -66455,6 +67951,7 @@ static const pciDeviceInfo *pci_dev_list_10b8[] = {
NULL
};
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_10b9[] = {
&pci_dev_info_10b9_0111,
&pci_dev_info_10b9_1435,
@@ -66507,6 +68004,7 @@ static const pciDeviceInfo *pci_dev_list_10b9[] = {
&pci_dev_info_10b9_5251,
&pci_dev_info_10b9_5253,
&pci_dev_info_10b9_5261,
+ &pci_dev_info_10b9_5450,
&pci_dev_info_10b9_5451,
&pci_dev_info_10b9_5453,
&pci_dev_info_10b9_5455,
@@ -66518,6 +68016,7 @@ static const pciDeviceInfo *pci_dev_list_10b9[] = {
&pci_dev_info_10b9_7101,
NULL
};
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_10ba[] = {
&pci_dev_info_10ba_0301,
@@ -66897,6 +68396,7 @@ static const pciDeviceInfo *pci_dev_list_1103[] = {
&pci_dev_info_1103_0006,
&pci_dev_info_1103_0007,
&pci_dev_info_1103_0008,
+ &pci_dev_info_1103_0009,
NULL
};
#endif
@@ -66909,6 +68409,7 @@ static const pciDeviceInfo *pci_dev_list_1105[] = {
NULL
};
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1106[] = {
&pci_dev_info_1106_0102,
&pci_dev_info_1106_0130,
@@ -66992,6 +68493,7 @@ static const pciDeviceInfo *pci_dev_list_1106[] = {
&pci_dev_info_1106_b168,
NULL
};
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1107[] = {
&pci_dev_info_1107_0576,
@@ -67021,6 +68523,12 @@ static const pciDeviceInfo *pci_dev_list_1109[] = {
static const pciDeviceInfo *pci_dev_list_110a[] = {
&pci_dev_info_110a_0002,
&pci_dev_info_110a_0005,
+ &pci_dev_info_110a_0006,
+ &pci_dev_info_110a_0015,
+ &pci_dev_info_110a_001d,
+ &pci_dev_info_110a_007b,
+ &pci_dev_info_110a_007c,
+ &pci_dev_info_110a_007d,
&pci_dev_info_110a_2102,
&pci_dev_info_110a_4942,
&pci_dev_info_110a_6120,
@@ -67469,6 +68977,7 @@ static const pciDeviceInfo *pci_dev_list_1165[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1166[] = {
&pci_dev_info_1166_0005,
+ &pci_dev_info_1166_0006,
&pci_dev_info_1166_0007,
&pci_dev_info_1166_0008,
&pci_dev_info_1166_0009,
@@ -68223,6 +69732,7 @@ static const pciDeviceInfo *pci_dev_list_125d[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1260[] = {
&pci_dev_info_1260_3873,
+ &pci_dev_info_1260_3890,
&pci_dev_info_1260_8130,
&pci_dev_info_1260_8131,
NULL
@@ -68258,6 +69768,7 @@ 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_0730,
&pci_dev_info_126f_0810,
&pci_dev_info_126f_0811,
&pci_dev_info_126f_0820,
@@ -68275,6 +69786,7 @@ static const pciDeviceInfo *pci_dev_list_1273[] = {
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1274[] = {
+ &pci_dev_info_1274_1171,
&pci_dev_info_1274_1371,
&pci_dev_info_1274_5000,
&pci_dev_info_1274_5880,
@@ -68287,6 +69799,7 @@ static const pciDeviceInfo *pci_dev_list_1274[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1278[] = {
&pci_dev_info_1278_0701,
+ &pci_dev_info_1278_0710,
NULL
};
#endif
@@ -68515,12 +70028,23 @@ static const pciDeviceInfo *pci_dev_list_12d2[] = {
NULL
};
#define pci_dev_list_12d3 NULL
-#define pci_dev_list_12d4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12d4[] = {
+ &pci_dev_info_12d4_0200,
+ NULL
+};
+#endif
#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
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12d9[] = {
+ &pci_dev_info_12d9_0002,
+ &pci_dev_info_12d9_0004,
+ NULL
+};
+#endif
#define pci_dev_list_12da NULL
#define pci_dev_list_12db NULL
#define pci_dev_list_12dc NULL
@@ -68621,6 +70145,7 @@ static const pciDeviceInfo *pci_dev_list_1307[] = {
&pci_dev_info_1307_0036,
&pci_dev_info_1307_0037,
&pci_dev_info_1307_004c,
+ &pci_dev_info_1307_004d,
NULL
};
#endif
@@ -68730,6 +70255,7 @@ static const pciDeviceInfo *pci_dev_list_131f[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1332[] = {
&pci_dev_info_1332_5415,
+ &pci_dev_info_1332_5425,
NULL
};
#endif
@@ -68862,6 +70388,7 @@ static const pciDeviceInfo *pci_dev_list_135e[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_1385[] = {
&pci_dev_info_1385_4100,
+ &pci_dev_info_1385_4105,
&pci_dev_info_1385_620a,
&pci_dev_info_1385_622a,
&pci_dev_info_1385_630a,
@@ -69257,7 +70784,12 @@ static const pciDeviceInfo *pci_dev_list_145f[] = {
#define pci_dev_list_1469 NULL
#define pci_dev_list_146a NULL
#define pci_dev_list_146b NULL
-#define pci_dev_list_146c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_146c[] = {
+ &pci_dev_info_146c_1430,
+ NULL
+};
+#endif
#define pci_dev_list_146d NULL
#define pci_dev_list_146e NULL
#define pci_dev_list_146f NULL
@@ -69311,7 +70843,12 @@ static const pciDeviceInfo *pci_dev_list_148d[] = {
#define pci_dev_list_149a NULL
#define pci_dev_list_149b NULL
#define pci_dev_list_149c NULL
-#define pci_dev_list_149d NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_149d[] = {
+ &pci_dev_info_149d_0001,
+ NULL
+};
+#endif
#define pci_dev_list_149e NULL
#define pci_dev_list_149f NULL
#define pci_dev_list_14a0 NULL
@@ -69470,6 +71007,7 @@ static const pciDeviceInfo *pci_dev_list_14e4[] = {
&pci_dev_info_14e4_1653,
&pci_dev_info_14e4_165d,
&pci_dev_info_14e4_1696,
+ &pci_dev_info_14e4_169c,
&pci_dev_info_14e4_16a6,
&pci_dev_info_14e4_16a7,
&pci_dev_info_14e4_16a8,
@@ -69479,6 +71017,7 @@ static const pciDeviceInfo *pci_dev_list_14e4[] = {
&pci_dev_info_14e4_4211,
&pci_dev_info_14e4_4212,
&pci_dev_info_14e4_4301,
+ &pci_dev_info_14e4_4320,
&pci_dev_info_14e4_4401,
&pci_dev_info_14e4_4402,
&pci_dev_info_14e4_4410,
@@ -69544,6 +71083,9 @@ static const pciDeviceInfo *pci_dev_list_14f1[] = {
&pci_dev_info_14f1_1456,
&pci_dev_info_14f1_1610,
&pci_dev_info_14f1_1611,
+ &pci_dev_info_14f1_1620,
+ &pci_dev_info_14f1_1621,
+ &pci_dev_info_14f1_1622,
&pci_dev_info_14f1_1803,
&pci_dev_info_14f1_1815,
&pci_dev_info_14f1_2003,
@@ -70012,6 +71554,7 @@ static const pciDeviceInfo *pci_dev_list_1638[] = {
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_163c[] = {
+ &pci_dev_info_163c_3052,
&pci_dev_info_163c_5449,
NULL
};
@@ -70037,6 +71580,12 @@ static const pciDeviceInfo *pci_dev_list_16ab[] = {
#endif
#define pci_dev_list_16be NULL
#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_16ca[] = {
+ &pci_dev_info_16ca_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_16ec[] = {
&pci_dev_info_16ec_3685,
NULL
@@ -70129,6 +71678,12 @@ static const pciDeviceInfo *pci_dev_list_1de1[] = {
NULL
};
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1fc0[] = {
+ &pci_dev_info_1fc0_0300,
+ NULL
+};
+#endif
#define pci_dev_list_2000 NULL
#define pci_dev_list_2001 NULL
#define pci_dev_list_2003 NULL
@@ -70152,6 +71707,8 @@ 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_101a,
+ &pci_dev_info_3388_101b,
&pci_dev_info_3388_8011,
&pci_dev_info_3388_8012,
&pci_dev_info_3388_8013,
@@ -70378,7 +71935,12 @@ static const pciDeviceInfo *pci_dev_list_5333[] = {
&pci_dev_info_5333_ca00,
NULL
};
-#define pci_dev_list_544c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_544c[] = {
+ &pci_dev_info_544c_0350,
+ NULL
+};
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
static const pciDeviceInfo *pci_dev_list_5455[] = {
&pci_dev_info_5455_4458,
@@ -70471,6 +72033,7 @@ static const pciDeviceInfo *pci_dev_list_8086[] = {
&pci_dev_info_8086_103d,
&pci_dev_info_8086_103e,
&pci_dev_info_8086_1040,
+ &pci_dev_info_8086_1043,
&pci_dev_info_8086_1059,
&pci_dev_info_8086_1130,
&pci_dev_info_8086_1131,
@@ -70564,8 +72127,22 @@ static const pciDeviceInfo *pci_dev_list_8086[] = {
&pci_dev_info_8086_24c5,
&pci_dev_info_8086_24c6,
&pci_dev_info_8086_24c7,
+ &pci_dev_info_8086_24ca,
&pci_dev_info_8086_24cb,
+ &pci_dev_info_8086_24cc,
&pci_dev_info_8086_24cd,
+ &pci_dev_info_8086_24d0,
+ &pci_dev_info_8086_24d1,
+ &pci_dev_info_8086_24d2,
+ &pci_dev_info_8086_24d3,
+ &pci_dev_info_8086_24d4,
+ &pci_dev_info_8086_24d5,
+ &pci_dev_info_8086_24d6,
+ &pci_dev_info_8086_24d7,
+ &pci_dev_info_8086_24db,
+ &pci_dev_info_8086_24dc,
+ &pci_dev_info_8086_24dd,
+ &pci_dev_info_8086_24de,
&pci_dev_info_8086_2500,
&pci_dev_info_8086_2501,
&pci_dev_info_8086_250b,
@@ -70585,12 +72162,28 @@ static const pciDeviceInfo *pci_dev_list_8086[] = {
&pci_dev_info_8086_2546,
&pci_dev_info_8086_2547,
&pci_dev_info_8086_2548,
+ &pci_dev_info_8086_254c,
+ &pci_dev_info_8086_2550,
+ &pci_dev_info_8086_2551,
+ &pci_dev_info_8086_2552,
+ &pci_dev_info_8086_2553,
+ &pci_dev_info_8086_2554,
+ &pci_dev_info_8086_255d,
&pci_dev_info_8086_2560,
&pci_dev_info_8086_2561,
&pci_dev_info_8086_2562,
&pci_dev_info_8086_2570,
+ &pci_dev_info_8086_2571,
&pci_dev_info_8086_2572,
+ &pci_dev_info_8086_2573,
+ &pci_dev_info_8086_2576,
+ &pci_dev_info_8086_2578,
+ &pci_dev_info_8086_2579,
+ &pci_dev_info_8086_257b,
+ &pci_dev_info_8086_257e,
&pci_dev_info_8086_3092,
+ &pci_dev_info_8086_3340,
+ &pci_dev_info_8086_3341,
&pci_dev_info_8086_3575,
&pci_dev_info_8086_3576,
&pci_dev_info_8086_3577,
@@ -70693,7 +72286,6 @@ static const pciDeviceInfo *pci_dev_list_9004[] = {
&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,
@@ -70719,6 +72311,8 @@ static const pciDeviceInfo *pci_dev_list_9004[] = {
&pci_dev_info_9004_7478,
&pci_dev_info_9004_7578,
&pci_dev_info_9004_7678,
+ &pci_dev_info_9004_7710,
+ &pci_dev_info_9004_7711,
&pci_dev_info_9004_7778,
&pci_dev_info_9004_7810,
&pci_dev_info_9004_7815,
@@ -70787,11 +72381,18 @@ static const pciDeviceInfo *pci_dev_list_9005[] = {
&pci_dev_info_9005_8014,
&pci_dev_info_9005_801e,
&pci_dev_info_9005_801f,
+ &pci_dev_info_9005_8080,
+ &pci_dev_info_9005_808f,
&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_8095,
+ &pci_dev_info_9005_8096,
+ &pci_dev_info_9005_8097,
+ &pci_dev_info_9005_809c,
+ &pci_dev_info_9005_809d,
&pci_dev_info_9005_809e,
&pci_dev_info_9005_809f,
NULL
@@ -71461,7 +73062,9 @@ static const pciVendorInfo pciVendorInfoList[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x10b8, pci_vendor_10b8, pci_dev_list_10b8},
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x10b9, pci_vendor_10b9, pci_dev_list_10b9},
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x10ba, pci_vendor_10ba, pci_dev_list_10ba},
#endif
@@ -71682,7 +73285,9 @@ static const pciVendorInfo pciVendorInfoList[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x1105, pci_vendor_1105, pci_dev_list_1105},
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x1106, pci_vendor_1106, pci_dev_list_1106},
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x1107, pci_vendor_1107, pci_dev_list_1107},
#endif
@@ -75465,6 +77070,9 @@ static const pciVendorInfo pciVendorInfoList[] = {
{0x16be, pci_vendor_16be, pci_dev_list_16be},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16ca, pci_vendor_16ca, pci_dev_list_16ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x16ec, pci_vendor_16ec, pci_dev_list_16ec},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -75540,6 +77148,9 @@ static const pciVendorInfo pciVendorInfoList[] = {
{0x1de1, pci_vendor_1de1, pci_dev_list_1de1},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1fc0, pci_vendor_1fc0, pci_dev_list_1fc0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x2000, pci_vendor_2000, pci_dev_list_2000},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -76387,7 +77998,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x10b8, pci_vendor_10b8, pci_ss_list_10b8},
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x10b9, pci_vendor_10b9, pci_ss_list_10b9},
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x10ba, pci_vendor_10ba, pci_ss_list_10ba},
#endif
@@ -76608,7 +78221,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x1105, pci_vendor_1105, pci_ss_list_1105},
#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x1106, pci_vendor_1106, pci_ss_list_1106},
+#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
{0x1107, pci_vendor_1107, pci_ss_list_1107},
#endif
@@ -80391,6 +82006,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
{0x16be, pci_vendor_16be, pci_ss_list_16be},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16ca, pci_vendor_16ca, pci_ss_list_16ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x16ec, pci_vendor_16ec, pci_ss_list_16ec},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
@@ -80466,6 +82084,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
{0x1de1, pci_vendor_1de1, pci_ss_list_1de1},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1fc0, pci_vendor_1fc0, pci_ss_list_1fc0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
{0x2000, pci_vendor_2000, pci_ss_list_2000},
#endif
#ifdef VENDOR_INCLUDE_NONVIDEO
diff --git a/hw/xfree86/scanpci/xf86PciStr.h b/hw/xfree86/scanpci/xf86PciStr.h
index 4704a0c31..bb36d510a 100644
--- a/hw/xfree86/scanpci/xf86PciStr.h
+++ b/hw/xfree86/scanpci/xf86PciStr.h
@@ -1,9 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStr.h,v 1.1 2002/07/15 20:46:04 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStr.h,v 1.2 2003/08/24 17:37:10 dawes Exp $ */
/*
- * Copyright © 2002 by The XFree86 Project, Inc
+ * Copyright (c) 2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
*/
-
+
/*
* Structs used to hold the pre-parsed pci.ids data. These are private
* to the scanpci and pcidata modules.
diff --git a/hw/xfree86/scanpci/xf86ScanPci.c b/hw/xfree86/scanpci/xf86ScanPci.c
index 0370a6e5f..534c8973f 100644
--- a/hw/xfree86/scanpci/xf86ScanPci.c
+++ b/hw/xfree86/scanpci/xf86ScanPci.c
@@ -1,14 +1,37 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.c,v 1.12 2002/07/15 20:46:04 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.c,v 1.14 2003/09/23 05:21:46 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
*
*/
-
+/*
+ * Copyright (c) 1995-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
/*
* This file is used to build both the scanpci and pcidata modules.
@@ -167,7 +190,8 @@ ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
return 2;
}
for (k = 0; pciVendorInfoList[k].VendorName; k++) {
- if (svendor == pciVendorInfoList[k].VendorID) {
+ if (svendor &&
+ svendor == pciVendorInfoList[k].VendorID) {
if (svname) {
*svname = pciVendorInfoList[k].VendorName;
}
diff --git a/hw/xfree86/scanpci/xf86ScanPci.h b/hw/xfree86/scanpci/xf86ScanPci.h
index 8dba8937d..3a154174a 100644
--- a/hw/xfree86/scanpci/xf86ScanPci.h
+++ b/hw/xfree86/scanpci/xf86ScanPci.h
@@ -1,6 +1,30 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.h,v 1.2 2002/07/15 20:46:04 dawes Exp $ */
-
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */
+/*
+ * Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR 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 copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
#ifndef SCANPCI_H_
#define SCANPCI_H_
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
index 065885abc..093f35b30 100644
--- a/hw/xfree86/shadowfb/shadow.c
+++ b/hw/xfree86/shadowfb/shadow.c
@@ -6,7 +6,7 @@
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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/shadow.c,v 1.21 2003/11/10 18:22:38 tsi Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -372,7 +372,7 @@ ShadowCopyWindow(
RegionRec rgnDst;
if (pPriv->vtSema) {
- REGION_INIT(pWin->drawable.pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pWin->drawable.pScreen, &rgnDst);
REGION_COPY(pWin->drawable.pScreen, &rgnDst, prgn);
REGION_TRANSLATE(pWin->drawable.pScreen, &rgnDst,
@@ -646,7 +646,11 @@ ShadowFillSpans(
}
box.y2++;
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+
+ if(!pGC->miTranslate) {
+ TRANSLATE_BOX(box, pDraw);
+ }
+ TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box)) {
if(pPriv->preRefresh)
@@ -698,7 +702,11 @@ ShadowSetSpans(
}
box.y2++;
- TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+
+ if(!pGC->miTranslate) {
+ TRANSLATE_BOX(box, pDraw);
+ }
+ TRIM_BOX(box, pGC);
if(BOX_NOT_EMPTY(box)) {
if(pPriv->preRefresh)
@@ -1779,9 +1787,15 @@ ShadowPushPixels(
SHADOW_GC_OP_PROLOGUE(pGC);
if(IS_VISIBLE(pDraw)) {
- box.x1 = xOrg + pDraw->x;
+ box.x1 = xOrg;
+ box.y1 = yOrg;
+
+ if(!pGC->miTranslate) {
+ box.x1 += pDraw->x;
+ box.y1 += pDraw->y;
+ }
+
box.x2 = box.x1 + dx;
- box.y1 = yOrg + pDraw->y;
box.y2 = box.y1 + dy;
TRIM_BOX(box, pGC);
diff --git a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c b/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c
index 6e81fd247..e70fb2db7 100644
--- a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c
+++ b/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c
@@ -27,7 +27,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.11 2002/10/23 16:23:36 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.12 2003/10/07 21:39:43 herrb Exp $ */
/*
static char sccsid[] = "@(#)kbd_mode.c 7.1 87/04/13";
@@ -65,7 +65,8 @@ static char sccsid[] = "@(#)kbd_mode.c 7.1 87/04/13";
#include <stdlib.h>
#include <unistd.h>
-static void die(), usage();
+static void die(char*);
+static void usage(void);
static int kbd_fd;
int
@@ -125,15 +126,14 @@ main(argc, argv)
}
static void
-die(msg)
- char *msg;
+die(char *msg)
{
fprintf(stderr, "%s\n", msg);
exit(1);
}
static void
-usage()
+usage(void)
{
int translate;
diff --git a/hw/xfree86/utils/pcitweak/pcitweak.c b/hw/xfree86/utils/pcitweak/pcitweak.c
index 42a9f9712..7ef1150b0 100644
--- a/hw/xfree86/utils/pcitweak/pcitweak.c
+++ b/hw/xfree86/utils/pcitweak/pcitweak.c
@@ -1,11 +1,36 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.c,v 1.17 2003/08/24 17:37:01 dawes Exp $ */
/*
- * pcitweak.c
+ * Copyright (c) 1999-2002 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 COPYRIGHT HOLDER(S) OR 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.
*
- * Copyright 1999 by The XFree86 Project, Inc.
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and 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 copyright holder(s) and author(s).
+ */
+
+/*
+ * pcitweak.c
*
* 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"
diff --git a/hw/xfree86/utils/pcitweak/pcitweak.man.pre b/hw/xfree86/utils/pcitweak/pcitweak.man.pre
index f4bd8d405..14cfa885f 100644
--- a/hw/xfree86/utils/pcitweak/pcitweak.man.pre
+++ b/hw/xfree86/utils/pcitweak/pcitweak.man.pre
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.3 2001/01/27 18:20:56 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.4 2003/05/29 21:48:09 herrb Exp $
.TH PCITWEAK 1 __vendorversion__
.SH NAME
pcitweak - read/write PCI config space
@@ -21,7 +21,7 @@ pcitweak - read/write PCI config space
.SH DESCRIPTION
.I Pcitweak
is a utility that can be used to examine or change registers in the PCI
-configuration space. On most platfoms
+configuration space. On most platforms
.I pcitweak
can only be run by the root user.
.SH OPTIONS
diff --git a/hw/xfree86/utils/xorgcfg/card-cfg.c b/hw/xfree86/utils/xorgcfg/card-cfg.c
index a96797f1c..5299025f1 100644
--- a/hw/xfree86/utils/xorgcfg/card-cfg.c
+++ b/hw/xfree86/utils/xorgcfg/card-cfg.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.12 2003/11/03 05:11:58 tsi Exp $
*/
#include "xf86config.h"
@@ -368,7 +368,7 @@ CardModel(XF86SetupInfo *info)
static Widget model;
if (first) {
- Widget label, viewport;
+ Widget viewport;
first = 0;
@@ -376,7 +376,7 @@ CardModel(XF86SetupInfo *info)
model = XtCreateWidget("cardModel", formWidgetClass,
configp, NULL, 0);
- label = XtCreateManagedWidget("label", labelWidgetClass,
+ (void) XtCreateManagedWidget("label", labelWidgetClass,
model, NULL, 0);
filter = XtVaCreateManagedWidget("filter", asciiTextWidgetClass,
model,
diff --git a/hw/xfree86/utils/xorgcfg/config.c b/hw/xfree86/utils/xorgcfg/config.c
index 929999f9e..8c2da3d9b 100644
--- a/hw/xfree86/utils/xorgcfg/config.c
+++ b/hw/xfree86/utils/xorgcfg/config.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.c,v 1.9 2003/11/03 05:11:58 tsi Exp $
*/
#include "config.h"
@@ -106,7 +106,7 @@ void
StartConfig(void)
{
static int first = 1;
- Widget pane, top, label, bottom, cancel;
+ Widget pane, top, bottom, cancel;
const char *filename;
if (!first)
@@ -144,7 +144,7 @@ StartConfig(void)
shell, NULL, 0);
top = XtCreateManagedWidget("top", formWidgetClass,
pane, NULL, 0);
- label = XtCreateManagedWidget("label", labelWidgetClass,
+ (void) XtCreateManagedWidget("label", labelWidgetClass,
top, NULL, 0);
ident_widget = XtVaCreateManagedWidget("identifier", asciiTextWidgetClass,
top,
@@ -199,11 +199,11 @@ ConfigError(void)
static int first = 1;
if (first) {
- Widget label, command;
+ Widget command;
errcurrent = XtCreateWidget("error", formWidgetClass,
configp, NULL, 0);
- label = XtCreateManagedWidget("label", labelWidgetClass,
+ (void) XtCreateManagedWidget("label", labelWidgetClass,
errcurrent, NULL, 0);
command = XtCreateManagedWidget("command", commandWidgetClass,
errcurrent, NULL, 0);
diff --git a/hw/xfree86/utils/xorgcfg/config.h b/hw/xfree86/utils/xorgcfg/config.h
index 34b8d7e52..6d1193a3d 100644
--- a/hw/xfree86/utils/xorgcfg/config.h
+++ b/hw/xfree86/utils/xorgcfg/config.h
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.17 2003/06/10 17:03:55 dawes Exp $
*/
#include <X11/IntrinsicP.h>
@@ -97,6 +97,7 @@
#define CONFIG_ACCESSX 3
extern int config_mode;
+#ifndef __UNIXOS2__
#define CONFPATH "%A," "%R," \
"/etc/X11/%R," "%P/etc/X11/%R," \
"%E," "%F," \
@@ -113,6 +114,26 @@ extern int config_mode;
"%P/etc/X11/%X," \
"%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
"%P/lib/X11/%X"
+#else
+#define CONFPATH "%&"XF86CONFIGDIR"/%R," "%&"XF86CONFIGDIR"/%X," \
+ "%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 "%&"XF86CONFIGDIR"/%X," "%&"XF86CONFIGDIR"/%X," \
+ "/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"
+#endif
/*
* Types
diff --git a/hw/xfree86/utils/xorgcfg/expert.c b/hw/xfree86/utils/xorgcfg/expert.c
index b9890b32b..a3dfcbe2d 100644
--- a/hw/xfree86/utils/xorgcfg/expert.c
+++ b/hw/xfree86/utils/xorgcfg/expert.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.15 2003/11/03 05:11:58 tsi Exp $
*/
#include "config.h"
@@ -498,12 +498,12 @@ CreateFiles(TreeNode *files)
static void
CreateFilesField(TreeNode *node, char *name, char *value)
{
- Widget box, label, text;
+ Widget box, text;
box = XtVaCreateManagedWidget(name, boxWidgetClass, tree,
XtNtreeParent, node->node, NULL, 0);
node->node = box;
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ (void) XtVaCreateManagedWidget("label", labelWidgetClass, box,
XtNlabel, name, NULL, 0);
text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
XtNeditType, XawtextEdit, XtNstring, value,
@@ -542,7 +542,6 @@ static void
CreateFontPath(TreeNode *fontpath, char *path)
{
TreeNode *prev = NULL, *node;
- Widget w;
if (path == NULL) {
if (XF86Font_path) {
@@ -568,7 +567,7 @@ CreateFontPath(TreeNode *fontpath, char *path)
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);
+ (void) CreateFontPathField(node, s, False);
if (fontpath->child == NULL)
fontpath->child = node;
else
@@ -579,7 +578,7 @@ CreateFontPath(TreeNode *fontpath, char *path)
}
node = NewNode(fontpath, NULL, NULL, fontpath->node, NULL);
- w = CreateFontPathField(node, "", True);
+ (void) CreateFontPathField(node, "", True);
if (fontpath->child == NULL)
fontpath->child = node;
else
@@ -719,7 +718,6 @@ static void
CreateModulePath(TreeNode *modulepath, char *path)
{
TreeNode *prev = NULL, *node;
- Widget w;
if (path == NULL) {
if (XF86Module_path) {
@@ -745,7 +743,7 @@ CreateModulePath(TreeNode *modulepath, char *path)
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);
+ (void) CreateModulePathField(node, s, False);
if (modulepath->child == NULL)
modulepath->child = node;
else
@@ -756,7 +754,7 @@ CreateModulePath(TreeNode *modulepath, char *path)
}
node = NewNode(modulepath, NULL, NULL, modulepath->node, NULL);
- w = CreateModulePathField(node, "", True);
+ (void) CreateModulePathField(node, "", True);
if (modulepath->child == NULL)
modulepath->child = node;
else
@@ -2130,7 +2128,7 @@ CreateMonitorModes(TreeNode *parent, XF86ConfModesLinkPtr lnk)
static void
CreateMonitorModesField(TreeNode *node, Bool addnew)
{
- Widget box, command, label;
+ Widget box, command;
box = XtVaCreateWidget("modes", formWidgetClass, tree,
XtNtreeParent, node->treeParent, NULL, 0);
@@ -2142,7 +2140,7 @@ CreateMonitorModesField(TreeNode *node, Bool addnew)
command = XtCreateManagedWidget("remove", commandWidgetClass, box,
NULL, 0);
XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("mode", labelWidgetClass, box,
+ (void) XtVaCreateManagedWidget("mode", labelWidgetClass, box,
XtNlabel, lnk->ml_modes_str, NULL, 0);
}
else {
@@ -2983,7 +2981,7 @@ CreateScreenAdaptor(TreeNode *parent, XF86ConfAdaptorLinkPtr lnk)
static void
CreateScreenAdaptorField(TreeNode *node, Bool addnew)
{
- Widget box, command, label;
+ Widget box, command;
box = XtVaCreateWidget("adaptor", formWidgetClass, tree,
XtNtreeParent, node->treeParent, NULL, 0);
@@ -2995,7 +2993,7 @@ CreateScreenAdaptorField(TreeNode *node, Bool addnew)
command = XtCreateManagedWidget("remove", commandWidgetClass, box,
NULL, 0);
XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ (void) XtVaCreateManagedWidget("label", labelWidgetClass, box,
XtNlabel, lnk->al_adaptor_str, NULL, 0);
}
else {
@@ -3756,7 +3754,7 @@ CreateAdjacency(TreeNode *parent, XF86ConfAdjacencyPtr adj)
static void
CreateAdjacencyField(TreeNode *node, Bool addnew)
{
- Widget box, command, label, sme;
+ Widget box, command, sme;
XF86ConfScreenPtr ptr = XF86Config->conf_screen_lst;
box = XtVaCreateWidget("adjacency", formWidgetClass, tree,
@@ -3786,7 +3784,7 @@ CreateAdjacencyField(TreeNode *node, Bool addnew)
command = XtCreateManagedWidget("remove", commandWidgetClass, box,
NULL, 0);
XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
- label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ (void) XtVaCreateManagedWidget("label", labelWidgetClass, box,
XtNlabel, adj->adj_screen->scrn_identifier,
NULL, 0);
diff --git a/hw/xfree86/utils/xorgcfg/help.c b/hw/xfree86/utils/xorgcfg/help.c
index 2b25e8ede..2ae68a082 100644
--- a/hw/xfree86/utils/xorgcfg/help.c
+++ b/hw/xfree86/utils/xorgcfg/help.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.8 2003/11/03 05:11:58 tsi Exp $
*/
#include <X11/IntrinsicP.h>
@@ -205,11 +205,11 @@ 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 int entity : 1; /* it changes the type of the text */
+ unsigned int nest : 1; /* does not close tags automatically */
+ unsigned int end : 1; /* need a close markup */
+ unsigned int adnl : 1; /* add newline before/after tag contents */
+ unsigned 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*);
diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c
index a53bffa01..e3f4e9f47 100644
--- a/hw/xfree86/utils/xorgcfg/loadmod.c
+++ b/hw/xfree86/utils/xorgcfg/loadmod.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c,v 1.18 2003/06/12 14:12:38 eich Exp $
*/
#ifdef USE_MODULES
@@ -67,6 +67,7 @@ Bool xf86LoaderCheckSymbol(const char*);
void xf86LoaderRefSymLists(const char **, ...);
void xf86LoaderReqSymLists(const char **, ...);
void xf86Msg(int, const char*, ...);
+void xf86MsgVerb(int, int, const char*, ...);
void xf86PrintChipsets(const char*, const char*, SymTabPtr);
void xf86ErrorFVerb(int verb, const char *format, ...);
pciVideoPtr *xf86GetPciVideoInfo(void);
@@ -77,6 +78,7 @@ void *xf86LoadDrvSubModule(DriverPtr drv, const char*);
void xf86DrvMsg(int, int, const char*, ...);
pciConfigPtr *xf86GetPciConfigInfo(void);
Bool xf86IsPrimaryPci(pcVideoPtr*);
+Bool xf86CheckPciSlot(int bus, int device, int func);
#endif
extern char *loaderPath, **loaderList, **ploaderList;
@@ -180,7 +182,7 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86memchr)
SYMFUNC(xf86memcmp)
SYMFUNC(xf86memcpy)
-#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__x86_64__)
+#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__AMD64__)
/*
* Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle
* structure copies. This causes a problem both here and in shared
@@ -301,6 +303,7 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86LoaderRefSymLists)
SYMFUNC(xf86LoaderReqSymLists)
SYMFUNC(xf86Msg)
+ SYMFUNC(xf86MsgVerb)
SYMFUNC(ErrorF)
SYMFUNC(xf86PrintChipsets)
SYMFUNC(xf86ErrorFVerb)
@@ -313,6 +316,10 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86DrvMsg)
SYMFUNC(xf86GetPciConfigInfo)
SYMFUNC(xf86IsPrimaryPci)
+ SYMFUNC(xf86CheckPciSlot)
+ SYMFUNC(XNFalloc)
+ SYMFUNC(XNFrealloc)
+ SYMFUNC(XNFcalloc)
{0,0}
};
@@ -502,9 +509,20 @@ xf86cfgCheckModule(void)
numFontModules = 0;
fonts = FontModuleList;
if (fonts) {
+ Bool dup = FALSE;
while (fonts->name) {
- if (strcmp(fonts->name, *ploaderList) == 0)
+ if (strcasecmp(fonts->name, *ploaderList) == 0) {
pfont_module = fonts;
+ /* HACK:
+ * fonts->names points into modules.
+ * Duplicate string of all remaining names to survive
+ * unloading. Since new fonts are appended to list
+ * this will only happen once per renderer.
+ */
+ dup = TRUE;
+ }
+ if (dup)
+ fonts->name = strdup(fonts->name);
++numFontModules;
++fonts;
}
@@ -655,4 +673,10 @@ xf86IsPrimaryPci(pciVideoPtr pPci)
{
return (True);
}
+
+Bool
+xf86CheckPciSlot(int bus, int device, int func)
+{
+ return (False);
+}
#endif
diff --git a/hw/xfree86/utils/xorgcfg/monitor-cfg.c b/hw/xfree86/utils/xorgcfg/monitor-cfg.c
index 430833381..6ed095416 100644
--- a/hw/xfree86/utils/xorgcfg/monitor-cfg.c
+++ b/hw/xfree86/utils/xorgcfg/monitor-cfg.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c,v 1.8 2003/09/11 10:08:38 eich Exp $
*/
#include "xf86config.h"
@@ -69,6 +69,10 @@ static char *hmodes[] = {
"Monitor that can do 1280x1024 @ 60 Hz",
"Monitor that can do 1280x1024 @ 74 Hz",
"Monitor that can do 1280x1024 @ 76 Hz",
+ "Monitor that can do 1280x1024 @ 85 Hz",
+ "Monitor that can do 1600x1200 @ 85 Hz",
+ "Monitor that can do 1920x1440 @ 85 Hz",
+ "Monitor that can do 2048x1536 @ 85 Hz"
};
static char *hmodes_trans[] = {
@@ -82,6 +86,10 @@ static char *hmodes_trans[] = {
"31.5 - 64.3",
"31.5 - 79.0",
"31.5 - 82.0",
+ "31.5 - 92.0",
+ "31.5 - 108.0",
+ "31.5 - 128.5",
+ "31.5 - 137.0"
};
static char *vmodes [] = { "50 - 70", "50 - 90", "50 - 100", "40 - 150", };
diff --git a/hw/xfree86/utils/xorgcfg/mouse-cfg.c b/hw/xfree86/utils/xorgcfg/mouse-cfg.c
index 761da248a..17a1c0caf 100644
--- a/hw/xfree86/utils/xorgcfg/mouse-cfg.c
+++ b/hw/xfree86/utils/xorgcfg/mouse-cfg.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c,v 1.12 2003/11/03 05:11:58 tsi Exp $
*/
#include "xf86config.h"
@@ -55,6 +55,9 @@ static struct MouseProtocol {
char *name;
int type;
} protocols[] = {
+#ifdef __UNIXOS2__
+ {"OS2Mouse", MTYPE_AUTOMOUSE},
+#endif
#ifdef SCO
{"OsMouse", MTYPE_AUTOMOUSE},
#endif
@@ -322,7 +325,7 @@ MouseDeviceAndProtocol(XF86SetupInfo *info)
int i;
if (first) {
- Widget label, viewport;
+ Widget viewport;
struct dirent *ent;
DIR *dir;
char **list;
@@ -359,7 +362,7 @@ MouseDeviceAndProtocol(XF86SetupInfo *info)
}
}
- label = XtCreateManagedWidget("labelD", labelWidgetClass,
+ (void) XtCreateManagedWidget("labelD", labelWidgetClass,
mouse_dp, NULL, 0);
text = XtVaCreateManagedWidget("device", asciiTextWidgetClass,
mouse_dp,
@@ -376,7 +379,7 @@ MouseDeviceAndProtocol(XF86SetupInfo *info)
XtAddCallback(listD, XtNcallback, MouseDeviceCallback, (XtPointer)text);
/* PROTOCOL */
- label = XtCreateManagedWidget("labelP", labelWidgetClass,
+ (void) XtCreateManagedWidget("labelP", labelWidgetClass,
mouse_dp, NULL, 0);
viewport = XtCreateManagedWidget("viewportP", viewportWidgetClass,
mouse_dp, NULL, 0);
diff --git a/hw/xfree86/utils/xorgcfg/screen-cfg.c b/hw/xfree86/utils/xorgcfg/screen-cfg.c
index 5aa71188a..9390afc6d 100644
--- a/hw/xfree86/utils/xorgcfg/screen-cfg.c
+++ b/hw/xfree86/utils/xorgcfg/screen-cfg.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.14 2003/11/03 05:11:58 tsi Exp $
*/
#include "xf86config.h"
@@ -73,6 +73,8 @@ static char *standard_modes[] = {
"1800x1400",
"512x384",
"1400x1050",
+ "2048x1536",
+ "1920x1440",
};
static char **modes;
@@ -519,6 +521,8 @@ ScreenDialog(XF86SetupInfo *info)
XtMapWidget(ccw);
}
}
+#else
+ (void)labelRotate;
#endif
if (rotate == CW) {
XtVaSetValues(cw, XtNstate, True, NULL, 0);
diff --git a/hw/xfree86/utils/xorgcfg/stubs.c b/hw/xfree86/utils/xorgcfg/stubs.c
index 5962908d1..6496bc868 100644
--- a/hw/xfree86/utils/xorgcfg/stubs.c
+++ b/hw/xfree86/utils/xorgcfg/stubs.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/stubs.c,v 1.4 2003/03/25 04:18:25 dawes Exp $
*/
#include <stdio.h>
@@ -36,6 +36,11 @@
/*
* Implementation
*/
+
+#ifdef __UNIXOS2__
+static char dummy;
+#endif
+
#if !defined(USE_MODULES)
/* these are defined in libdummy.a */
int
diff --git a/hw/xfree86/utils/xorgcfg/text-mode.c b/hw/xfree86/utils/xorgcfg/text-mode.c
index ef4da2877..2011d1abd 100644
--- a/hw/xfree86/utils/xorgcfg/text-mode.c
+++ b/hw/xfree86/utils/xorgcfg/text-mode.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.26 2003/11/14 02:40:22 dawes Exp $
*/
#include <stdio.h>
@@ -46,7 +46,15 @@
#include "xf86config.h"
#include "loader.h"
-#define XKB_RULES_DIR "/usr/X11R6/lib/X11/xkb/rules"
+#ifndef PROJECT_ROOT
+#define PROJECT_ROOT "/usr/X11R6"
+#endif
+
+#ifndef __UNIXOS2__
+#define XKB_RULES_DIR PROJECT_ROOT "/lib/X11/xkb/rules"
+#else
+#define XKB_RULES_DIR XF86CONFIGDIR "/xkb/rules"
+#endif
#define CONTROL_A 1
#define CONTROL_D 4
@@ -196,7 +204,11 @@ TextMode(void)
"This program will create the XF86Config file, based on "
"menu selections you make.\n"
"\n"
+#ifndef __UNIXOS2__
"The XF86Config file usually resides in /usr/X11R6/etc/X11 "
+#else
+ "The XF86Config file usually resides in "XF86CONFIGDIR" "
+#endif
"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 "
@@ -285,7 +297,11 @@ WriteXF86Config(void)
refresh();
xf86config = DialogInput("Write XF86Config", "Write configuration to file:",
10, 60, XF86Config_path ? XF86Config_path :
+#ifndef __UNIXOS2__
"/etc/X11/XF86Config", " Ok ", " Cancel ", 0);
+#else
+ XF86CONFIGDIR"/XF86Config", " Ok ", " Cancel ", 0);
+#endif
if (xf86config == NULL)
return (-1);
@@ -301,7 +317,7 @@ WriteXF86Config(void)
XtCalloc(1, sizeof(XF86ConfModuleRec));
XF86Config->conf_modules->mod_comment =
- XtNewString("\t# Load \"freetype\"\n"
+ XtNewString("\tLoad \"freetype\"\n"
"\t# Load \"xtt\"\n");
for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
@@ -330,6 +346,9 @@ WriteXF86Config(void)
}
static char *protocols[] = {
+#ifdef __UNIXOS2__
+ "OS2Mouse",
+#endif
#ifdef SCO
"OsMouse",
#endif
@@ -521,6 +540,8 @@ MouseConfig(void)
str = "/dev/wsmouse";
#elif defined(__FreeBSD__)
str = "/dev/sysmouse";
+#elif defined(__UNIXOS2__)
+ str = "mouse$";
#else
str = "/dev/mouse";
#endif
@@ -805,6 +826,10 @@ static char *hsync[] = {
"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",
+ "31.5 - 92.0; Monitor that can do 1280x1024 @ 85 Hz",
+ "31.5 - 108.0; Monitor that can do 1600x1200 @ 85 Hz",
+ "31.5 - 128.5; Monitor that can do 1920x1440 @ 85 Hz",
+ "31.5 - 137.0; Monitor that can do 2048x1536 @ 85 Hz"
};
static char *vrefresh[] = {
@@ -1358,6 +1383,9 @@ static char *depths[] = {
};
static char *modes[] = {
+ "2048x1536",
+ "1920x1440",
+ "1800x1400",
"1600x1200",
"1400x1050",
"1280x1024",
diff --git a/hw/xfree86/utils/xorgcfg/vidmode.c b/hw/xfree86/utils/xorgcfg/vidmode.c
index d28ac0899..3a51310d9 100644
--- a/hw/xfree86/utils/xorgcfg/vidmode.c
+++ b/hw/xfree86/utils/xorgcfg/vidmode.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/vidmode.c,v 1.8 2003/11/03 05:11:58 tsi Exp $
*/
/*
@@ -130,11 +130,10 @@ 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 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 Widget values[VSYNC + 1], repeater, monitor,
+ monitorb, add, text, vesap, forceshell, testshell, addshell;
static int MajorVersion, MinorVersion, EventBase, ErrorBase;
static XtIntervalId timeout;
@@ -449,7 +448,7 @@ VideoModeInitialize(void)
vtune = XtCreateWidget("vidtune", formWidgetClass,
work, NULL, 0);
- vesab = XtVaCreateManagedWidget("vesaB", menuButtonWidgetClass, vtune,
+ (void) 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++) {
@@ -556,7 +555,7 @@ VideoModeInitialize(void)
form = XtCreateManagedWidget("form", formWidgetClass, vtune, NULL, 0);
for (i = 2; i < VSYNC + 1; i++) {
- labels[i] = XtCreateManagedWidget(names[i], labelWidgetClass,
+ (void) XtCreateManagedWidget(names[i], labelWidgetClass,
form, NULL, 0);
values[i] = XtCreateManagedWidget(vnames[i], labelWidgetClass,
form, NULL, 0);
@@ -888,15 +887,6 @@ GetModeLine(Bool save)
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);
}
diff --git a/hw/xfree86/utils/xorgcfg/xf86config.c b/hw/xfree86/utils/xorgcfg/xf86config.c
index b2b0b871c..cb4054a5e 100644
--- a/hw/xfree86/utils/xorgcfg/xf86config.c
+++ b/hw/xfree86/utils/xorgcfg/xf86config.c
@@ -26,7 +26,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86config.c,v 1.6 2003/11/03 05:11:59 tsi Exp $
*/
#include "xf86config.h"
@@ -206,7 +206,10 @@ xf86removeMonitor(XF86ConfigPtr config, XF86ConfMonitorPtr monitor)
while (scr != NULL) {
if (scr->scrn_monitor == monitor) {
xf86removeScreen(config, scr);
+ if (scr == psc)
scr = psc = config->conf_screen_lst;
+ else
+ scr = psc;
continue;
}
psc = scr;
diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
index 18e8032e1..07659d943 100644
--- a/hw/xfree86/vbe/vbe.c
+++ b/hw/xfree86/vbe/vbe.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.c,v 1.1 2003/02/17 17:06:45 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.c,v 1.3 2003/11/03 05:11:53 tsi Exp $ */
/*
* XFree86 vbe module
@@ -106,11 +106,13 @@ VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags)
}
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);
+ "VbeVersion is %d, OemStringPtr is 0x%08lx,\n"
+ "\tOemVendorNamePtr is 0x%08lx, OemProductNamePtr is 0x%08lx,\n"
+ "\tOemProductRevPtr is 0x%08lx\n",
+ vbe->VbeVersion, (unsigned long)vbe->OemStringPtr,
+ (unsigned long)vbe->OemVendorNamePtr,
+ (unsigned long)vbe->OemProductNamePtr,
+ (unsigned long)vbe->OemProductRevPtr);
xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE Version %i.%i\n",
VERSION(vbe->VbeVersion));
@@ -341,7 +343,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
VbeInfoBlock *block = NULL;
int i, pStr, pModes;
char *str;
- CARD16 major, minor, *modes;
+ CARD16 major, *modes;
bzero(pVbe->memory, sizeof(VbeInfoBlock));
@@ -378,7 +380,6 @@ VBEGetVBEInfo(vbeInfoPtr pVbe)
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));
diff --git a/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h
index 5bca184f5..30756119d 100644
--- a/hw/xfree86/vbe/vbe.h
+++ b/hw/xfree86/vbe/vbe.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.h,v 1.1 2003/02/17 17:06:45 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.h,v 1.3 2003/11/14 14:58:45 tsi Exp $ */
/*
* XFree86 vbe module
@@ -60,7 +60,11 @@ typedef struct vbeControllerInfoBlock {
CARD8 OemData[256];
} vbeControllerInfoRec, *vbeControllerInfoPtr;
-#pragma pack()
+#ifdef __GNUC__
+#pragma pack() /* All GCC versions recognise this syntax */
+#else
+#pragma pack(0)
+#endif
#ifndef __GNUC__
#define __attribute__(a)
@@ -237,8 +241,8 @@ typedef enum {
} vbeScanwidthCommand;
#define VBESetLogicalScanline(pVbe, width) \
- VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, \
- width, NULL, NULL, NULL)
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, width, \
+ NULL, NULL, NULL)
#define VBESetLogicalScanlineBytes(pVbe, width) \
VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET_BYTES, width, \
NULL, NULL, NULL)
@@ -246,8 +250,8 @@ typedef enum {
VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET, 0, \
pixels, bytes, max)
#define VBEGetMaxLogicalScanline(pVbe, pixels, bytes, max) \
- VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, \
- NULL, pixels, bytes, max)
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, 0, \
+ pixels, bytes, max)
Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe,
vbeScanwidthCommand command, int width,
int *pixels, int *bytes, int *max);
diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c
index 4d4f1bfac..ae16d7b75 100644
--- a/hw/xfree86/vbe/vbeModes.c
+++ b/hw/xfree86/vbe/vbeModes.c
@@ -27,7 +27,7 @@
*
* 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 $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbeModes.c,v 1.4 2003/11/06 18:38:14 tsi Exp $
*/
#include "xf86.h"
@@ -120,7 +120,7 @@ static DisplayModePtr
CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
int flags)
{
- CARD16 major, minor;
+ CARD16 major;
VbeModeInfoBlock *mode;
DisplayModePtr pMode, p;
VbeModeInfoData *data;
@@ -128,7 +128,6 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
ModeStatus status = MODE_OK;
major = (unsigned)(vbe->VESAVersion >> 8);
- minor = vbe->VESAVersion & 0xff;
if ((mode = VBEGetModeInfo(pVbe, id)) == NULL)
return NULL;
@@ -193,7 +192,7 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
xf86ErrorFVerb(DEBUG_VERB,
" WinBSegment: 0x%x\n", mode->WinBSegment);
xf86ErrorFVerb(DEBUG_VERB,
- " WinFuncPtr: 0x%x\n", mode->WinFuncPtr);
+ " WinFuncPtr: 0x%lx\n", (unsigned long)mode->WinFuncPtr);
xf86ErrorFVerb(DEBUG_VERB,
" BytesPerScanline: %d\n", mode->BytesPerScanline);
xf86ErrorFVerb(DEBUG_VERB,
@@ -236,7 +235,8 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
" DirectColorModeInfo: %d\n", mode->DirectColorModeInfo);
if (major >= 2) {
xf86ErrorFVerb(DEBUG_VERB,
- " PhysBasePtr: 0x%x\n", mode->PhysBasePtr);
+ " PhysBasePtr: 0x%lx\n",
+ (unsigned long)mode->PhysBasePtr);
if (major >= 3) {
xf86ErrorFVerb(DEBUG_VERB,
" LinBytesPerScanLine: %d\n", mode->LinBytesPerScanLine);
@@ -261,7 +261,7 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
xf86ErrorFVerb(DEBUG_VERB,
" LinRsvdFieldPosition: %d\n", mode->LinRsvdFieldPosition);
xf86ErrorFVerb(DEBUG_VERB,
- " MaxPixelClock: %d\n", mode->MaxPixelClock);
+ " MaxPixelClock: %ld\n", (unsigned long)mode->MaxPixelClock);
}
}
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index e598d91a2..e1fd9716a 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.57 2003/02/24 21:29:36 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.58 2003/11/03 05:11:53 tsi Exp $ */
/*
*
@@ -221,14 +221,12 @@ stdWriteFCR(vgaHWPtr hwp, CARD8 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);
+ (void) 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);
}
@@ -236,14 +234,12 @@ stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 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);
+ (void) 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);
}
@@ -263,9 +259,7 @@ stdReadMiscOut(vgaHWPtr hwp)
static void
stdEnablePalette(vgaHWPtr hwp)
{
- CARD8 tmp;
-
- tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+ (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x00);
hwp->paletteEnabled = TRUE;
}
@@ -273,9 +267,7 @@ stdEnablePalette(vgaHWPtr hwp)
static void
stdDisablePalette(vgaHWPtr hwp)
{
- CARD8 tmp;
-
- tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+ (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x20);
hwp->paletteEnabled = FALSE;
}
@@ -436,14 +428,12 @@ mmioWriteFCR(vgaHWPtr hwp, CARD8 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);
+ (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
moutb(VGA_ATTR_INDEX, index);
moutb(VGA_ATTR_DATA_W, value);
}
@@ -451,14 +441,12 @@ mmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 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);
+ (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
moutb(VGA_ATTR_INDEX, index);
return minb(VGA_ATTR_DATA_R);
}
@@ -478,9 +466,7 @@ mmioReadMiscOut(vgaHWPtr hwp)
static void
mmioEnablePalette(vgaHWPtr hwp)
{
- CARD8 tmp;
-
- tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+ (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
moutb(VGA_ATTR_INDEX, 0x00);
hwp->paletteEnabled = TRUE;
}
@@ -488,9 +474,7 @@ mmioEnablePalette(vgaHWPtr hwp)
static void
mmioDisablePalette(vgaHWPtr hwp)
{
- CARD8 tmp;
-
- tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+ (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
moutb(VGA_ATTR_INDEX, 0x20);
hwp->paletteEnabled = FALSE;
}
diff --git a/hw/xfree86/x86emu/fpu.c b/hw/xfree86/x86emu/fpu.c
index 08aea4229..0f679bde6 100644
--- a/hw/xfree86/x86emu/fpu.c
+++ b/hw/xfree86/x86emu/fpu.c
@@ -36,6 +36,7 @@
* emulation of the FPU instructions.
*
****************************************************************************/
+/* $XFree86: xc/extras/x86emu/src/x86emu/fpu.c,v 1.2 2003/10/22 20:03:06 tsi Exp $ */
#include "x86emu/x86emui.h"
@@ -95,8 +96,8 @@ static char *x86emu_fpu_op_d9_tab1[] = {
void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
- uint destoffset;
- u8 stkelem;
+ uint destoffset = 0;
+ u8 stkelem = 0;
START_OF_INSTR();
FETCH_DECODE_MODRM(mod, rh, rl);
@@ -289,6 +290,9 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
}
}
}
+#else
+ (void)destoffset;
+ (void)stkelem;
#endif /* X86EMU_FPU_PRESENT */
DECODE_CLEAR_SEGOVR();
END_OF_INSTR_NO_TRACE();
@@ -322,8 +326,8 @@ char *x86emu_fpu_op_da_tab[] = {
void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
- uint destoffset;
- u8 stkelem;
+ uint destoffset = 0;
+ u8 stkelem = 0;
START_OF_INSTR();
FETCH_DECODE_MODRM(mod, rh, rl);
@@ -379,6 +383,9 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
break;
}
}
+#else
+ (void)destoffset;
+ (void)stkelem;
#endif
DECODE_CLEAR_SEGOVR();
END_OF_INSTR_NO_TRACE();
@@ -403,7 +410,7 @@ char *x86emu_fpu_op_db_tab[] = {
void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
- uint destoffset;
+ uint destoffset = 0;
START_OF_INSTR();
FETCH_DECODE_MODRM(mod, rh, rl);
@@ -499,6 +506,8 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
break;
}
}
+#else
+ (void)destoffset;
#endif
DECODE_CLEAR_SEGOVR();
END_OF_INSTR_NO_TRACE();
@@ -530,8 +539,8 @@ char *x86emu_fpu_op_dc_tab[] = {
void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
- uint destoffset;
- u8 stkelem;
+ uint destoffset = 0;
+ u8 stkelem = 0;
START_OF_INSTR();
FETCH_DECODE_MODRM(mod, rh, rl);
@@ -613,6 +622,9 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
break;
}
}
+#else
+ (void)destoffset;
+ (void)stkelem;
#endif
DECODE_CLEAR_SEGOVR();
END_OF_INSTR_NO_TRACE();
@@ -640,8 +652,8 @@ static char *x86emu_fpu_op_dd_tab[] = {
void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
- uint destoffset;
- u8 stkelem;
+ uint destoffset = 0;
+ u8 stkelem = 0;
START_OF_INSTR();
FETCH_DECODE_MODRM(mod, rh, rl);
@@ -713,6 +725,9 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
break;
}
}
+#else
+ (void)destoffset;
+ (void)stkelem;
#endif
DECODE_CLEAR_SEGOVR();
END_OF_INSTR_NO_TRACE();
@@ -747,8 +762,8 @@ static char *x86emu_fpu_op_de_tab[] =
void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
- uint destoffset;
- u8 stkelem;
+ uint destoffset = 0;
+ u8 stkelem = 0;
START_OF_INSTR();
FETCH_DECODE_MODRM(mod, rh, rl);
@@ -832,6 +847,9 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
break;
}
}
+#else
+ (void)destoffset;
+ (void)stkelem;
#endif
DECODE_CLEAR_SEGOVR();
END_OF_INSTR_NO_TRACE();
@@ -866,8 +884,8 @@ static char *x86emu_fpu_op_df_tab[] = {
void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
- uint destoffset;
- u8 stkelem;
+ uint destoffset = 0;
+ u8 stkelem = 0;
START_OF_INSTR();
FETCH_DECODE_MODRM(mod, rh, rl);
@@ -939,6 +957,9 @@ void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
break;
}
}
+#else
+ (void)destoffset;
+ (void)stkelem;
#endif
DECODE_CLEAR_SEGOVR();
END_OF_INSTR_NO_TRACE();
diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c
index 3714070dd..94041f6c8 100644
--- a/hw/xfree86/x86emu/ops.c
+++ b/hw/xfree86/x86emu/ops.c
@@ -70,7 +70,7 @@
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/ops.c,v 1.7 2002/07/15 16:49:10 dawes Exp $ */
+/* $XFree86: xc/extras/x86emu/src/x86emu/ops.c,v 1.9 2003/10/22 20:03:06 tsi Exp $ */
#include "x86emu/x86emui.h"
@@ -4538,7 +4538,11 @@ static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
imm = (s8)fetch_byte_imm();
DECODE_PRINTF2("PUSH\t%d\n", imm);
TRACE_AND_STEP();
- push_word(imm);
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long((s32)imm);
+ } else {
+ push_word(imm);
+ }
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
@@ -9417,11 +9421,9 @@ Handles opcode 0xd5
****************************************************************************/
static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
{
- u8 a;
-
START_OF_INSTR();
DECODE_PRINTF("AAD\n");
- a = fetch_byte_imm();
+ (void) fetch_byte_imm();
TRACE_AND_STEP();
M.x86.R_AX = aad_word(M.x86.R_AX);
DECODE_CLEAR_SEGOVR();
diff --git a/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c
index ae295f782..55f361677 100644
--- a/hw/xfree86/x86emu/ops2.c
+++ b/hw/xfree86/x86emu/ops2.c
@@ -37,7 +37,7 @@
* instructions.
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/src/x86emu/ops2.c,v 1.5 2002/07/15 16:49:10 dawes Exp $ */
+/* $XFree86: xc/extras/x86emu/src/x86emu/ops2.c,v 1.6 2003/10/22 20:03:06 tsi Exp $ */
#include "x86emu/x86emui.h"
@@ -145,6 +145,7 @@ static void x86emuOp2_long_jump(u8 op2)
break;
}
DECODE_PRINTF(name);
+ (void)name;
target = (s16) fetch_word_imm();
target += (s16) M.x86.R_IP;
DECODE_PRINTF2("%04x\n", target);
@@ -237,6 +238,7 @@ static void x86emuOp2_set_byte(u8 op2)
break;
}
DECODE_PRINTF(name);
+ (void)name;
FETCH_DECODE_MODRM(mod, rh, rl);
switch (mod) {
case 0:
diff --git a/hw/xfree86/x86emu/x86emu/fpu_regs.h b/hw/xfree86/x86emu/x86emu/fpu_regs.h
index 56e9a04d7..b975b87e0 100644
--- a/hw/xfree86/x86emu/x86emu/fpu_regs.h
+++ b/hw/xfree86/x86emu/x86emu/fpu_regs.h
@@ -35,14 +35,13 @@
* Description: Header file for FPU register definitions.
*
****************************************************************************/
+/* $XFree86: xc/extras/x86emu/include/x86emu/fpu_regs.h,v 1.3 2003/10/28 16:01:40 tsi Exp $ */
#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 {
@@ -87,8 +86,6 @@ struct x86_fpu_registers {
short x86_fpu_tos, x86_fpu_bos;
};
-#pragma pack()
-
/*
* There are two versions of the following macro.
*
diff --git a/hw/xfree86/x86emu/x86emu/regs.h b/hw/xfree86/x86emu/x86emu/regs.h
index 12426278d..3a4580138 100644
--- a/hw/xfree86/x86emu/x86emu/regs.h
+++ b/hw/xfree86/x86emu/x86emu/regs.h
@@ -35,15 +35,13 @@
* 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 $ */
+/* $XFree86: xc/extras/x86emu/include/x86emu/regs.h,v 1.6 2003/10/28 16:01:40 tsi 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
@@ -305,8 +303,6 @@ typedef struct {
X86EMU_regs x86;
} X86EMU_sysEnv;
-#pragma pack()
-
/*----------------------------- Global Variables --------------------------*/
#ifdef __cplusplus
diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h
index 847ce835d..3a0dc17fc 100644
--- a/hw/xfree86/x86emu/x86emu/types.h
+++ b/hw/xfree86/x86emu/x86emu/types.h
@@ -36,7 +36,7 @@
*
****************************************************************************/
-/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.5 2002/07/23 14:22:45 tsi Exp $ */
+/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.7 2003/07/07 15:34:21 eich Exp $ */
#ifndef __X86EMU_TYPES_H
#define __X86EMU_TYPES_H
@@ -70,12 +70,13 @@
/* Taken from Xmd.h */
#undef NUM32
-#if defined(__alpha) || defined(__alpha__) || \
+#if defined (_LP64) || \
+ defined(__alpha) || defined(__alpha__) || \
defined(__ia64__) || defined(ia64) || \
defined(__sparc64__) || \
defined(__s390x__) || \
(defined(__hppa__) && defined(__LP64)) || \
- defined(__x86_64__) || defined(x86_64) || \
+ defined(__AMD64__) || defined(AMD64) || \
(defined(__sgi) && (_MIPS_SZLONG == 64))
#define NUM32 int
#else
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
index 015b539e5..83850767a 100644
--- a/hw/xfree86/xaa/xaaBitBlt.c
+++ b/hw/xfree86/xaa/xaaBitBlt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.3 1998/12/06 06:08:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.4 2003/11/10 18:22:39 tsi Exp $ */
/*
This is a lighter version of cfbBitBlt. We calculate the boxes
@@ -161,7 +161,7 @@ XAABitBlt(
/* Check to see if the region is empty */
if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
- REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pGC->pScreen, &rgnDst);
} else {
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
}
diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c
index 74dcdfd31..d3d1c8a5c 100644
--- a/hw/xfree86/xaa/xaaCpyPlane.c
+++ b/hw/xfree86/xaa/xaaCpyPlane.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.13 2001/10/01 13:44:15 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.14 2003/11/10 18:22:40 tsi Exp $ */
/*
A CopyPlane function that handles bitmap->screen copies and
@@ -186,7 +186,7 @@ XAAPushPixelsSolidColorExpansion(
if(!pClipBoxes) return;
} else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
- nboxes = XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect);
+ nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
pbox = pClipBoxes;
while(nboxes--) {
diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c
index 1c5ecf38e..b77be1ad6 100644
--- a/hw/xfree86/xaa/xaaCpyWin.c
+++ b/hw/xfree86/xaa/xaaCpyWin.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.3 2003/02/17 16:08:29 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.4 2003/11/10 18:22:40 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -47,7 +47,7 @@ XAACopyWindow(
pwinRoot = WindowTable[pScreen->myNum];
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c
index 164887afe..5566f51e6 100644
--- a/hw/xfree86/xaa/xaaFillPoly.c
+++ b/hw/xfree86/xaa/xaaFillPoly.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.15 2001/10/28 03:34:04 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.16 2003/03/23 03:41:44 mvojkovi Exp $ */
/*
* Copyright 1996 The XFree86 Project
@@ -770,7 +770,11 @@ XAAFillPolygonStippled(
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;
}
diff --git a/hw/xfree86/xaa/xaaFillRect.c b/hw/xfree86/xaa/xaaFillRect.c
index 1d9cd54c1..cda56e327 100644
--- a/hw/xfree86/xaa/xaaFillRect.c
+++ b/hw/xfree86/xaa/xaaFillRect.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.15 2001/12/13 18:01:51 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.16 2003/11/10 18:22:40 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -1018,7 +1018,7 @@ XAAClipAndRenderRects(
int
XAAGetRectClipBoxes(
- RegionPtr prgnClip,
+ GCPtr pGC,
BoxPtr pboxClippedBase,
int nrectFill,
xRectangle *prectInit
@@ -1026,7 +1026,7 @@ XAAGetRectClipBoxes(
int Right, Bottom;
BoxPtr pextent, pboxClipped = pboxClippedBase;
xRectangle *prect = prectInit;
-
+ RegionPtr prgnClip = pGC->pCompositeClip;
if (REGION_NUM_RECTS(prgnClip) == 1) {
pextent = REGION_RECTS(prgnClip);
diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c
index 6da601faf..c3db7ff57 100644
--- a/hw/xfree86/xaa/xaaImage.c
+++ b/hw/xfree86/xaa/xaaImage.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.20 2000/09/25 23:56:14 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.21 2003/11/10 18:22:41 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -444,8 +444,7 @@ XAAPutImage(
if(!pClipBoxes) return;
} else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
- nboxes =
- XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect);
+ nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
pbox = pClipBoxes;
if(format == XYBitmap) {
diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c
index 914631b58..e1c57588a 100644
--- a/hw/xfree86/xaa/xaaNonTEText.c
+++ b/hw/xfree86/xaa/xaaNonTEText.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.12 2000/04/07 19:11:10 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.14 2003/11/14 21:54:51 dawes Exp $ */
/********************************************************************
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
index 9651ca6a3..d527b7c15 100644
--- a/hw/xfree86/xaa/xaaOverlay.c
+++ b/hw/xfree86/xaa/xaaOverlay.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.14 2002/12/10 04:18:20 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.15 2003/11/10 18:22:41 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -57,7 +57,7 @@ XAACopyWindow8_32(
if(doUnderlay)
freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c
index 82a2011a4..5cce3e7ed 100644
--- a/hw/xfree86/xaa/xaaOverlayDF.c
+++ b/hw/xfree86/xaa/xaaOverlayDF.c
@@ -3,7 +3,7 @@
Written by Mark Vojkovich
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.1 1999/03/28 15:33:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.2 2003/11/10 18:22:41 tsi Exp $ */
#include "misc.h"
@@ -355,7 +355,7 @@ XAAOverCopyWindow(
infoRec->ScratchGC.alu = GXcopy;
infoRec->ScratchGC.planemask = ~0;
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
@@ -388,7 +388,7 @@ XAAOverCopyWindow(
REGION_UNINIT(pScreen, &rgnDst);
if(pWin->drawable.depth == 8) {
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
miSegregateChildren(pWin, &rgnDst, pScrn->depth);
if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
index e6163b33a..c7756ba93 100644
--- a/hw/xfree86/xaa/xaaPCache.c
+++ b/hw/xfree86/xaa/xaaPCache.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.30 2000/09/25 23:56:14 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.33 2003/11/03 05:11:54 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -321,13 +321,11 @@ ConvertAllPartialsTo8x8(
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 */
@@ -763,6 +761,7 @@ XAAInitPixmapCache(
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.
+ 4) Don't have any of there are no 256x256s.
256x256 -
1) Don't take up more than a quarter of the memory enless there
@@ -786,6 +785,13 @@ XAAInitPixmapCache(
else Target256 = ntotal >> 4;
if(Target256 < 4) Target256 = 0;
+ if(Num512 && Num256 < 4) {
+ while(Num512 && Num256 < Target256) {
+ SubdivideList(&List512, &List256);
+ Num256 += 4; Num512--;
+ }
+ }
+
if(!Num512) { /* no room */
} else if((Num512 < 4) || (!Target512)) {
while(Num512) {
@@ -2044,7 +2050,7 @@ XAAWriteColor8x8PatternToCache(
nw = w;
memcpy(dstPtr, srcPtr, w * Bpp);
while (nw != 8) {
- memcpy(dstPtr + (nw * Bpp), srcPtr, nw * Bpp);
+ memcpy(dstPtr + (nw * Bpp), dstPtr, nw * Bpp);
nw <<= 1;
}
}
diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
index 4b7e3d0f0..fecbbcfa0 100644
--- a/hw/xfree86/xaa/xaaPict.c
+++ b/hw/xfree86/xaa/xaaPict.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.17 2002/12/10 04:17:21 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.18 2003/04/23 18:35:34 eich Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -432,10 +432,11 @@ XAAComposite (CARD8 op,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height))
{
- if(pSrc->pDrawable->type == DRAWABLE_WINDOW ||
+ if((pSrc->pDrawable->type == DRAWABLE_WINDOW ||
pDst->pDrawable->type == DRAWABLE_WINDOW ||
IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
- IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) {
+ IS_OFFSCREEN_PIXMAP(pDst->pDrawable))
+ && infoRec->pScrn->vtSema) {
SYNC_CHECK(pDst->pDrawable);
}
(*GetPictureScreen(pScreen)->Composite) (op,
@@ -666,10 +667,11 @@ XAAGlyphs (CARD8 op,
!(*infoRec->Glyphs)(op, pSrc, pDst, maskFormat,
xSrc, ySrc, nlist, list, glyphs))
{
- if((pSrc->pDrawable->type == DRAWABLE_WINDOW) ||
+ if(((pSrc->pDrawable->type == DRAWABLE_WINDOW) ||
(pDst->pDrawable->type == DRAWABLE_WINDOW) ||
IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
- IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) {
+ IS_OFFSCREEN_PIXMAP(pDst->pDrawable))
+ && infoRec->pScrn->vtSema) {
SYNC_CHECK(pDst->pDrawable);
}
(*GetPictureScreen(pScreen)->Glyphs) (op, pSrc, pDst, maskFormat,
diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c
index 512c6a260..b27a54e81 100644
--- a/hw/xfree86/xaa/xaaStateChange.c
+++ b/hw/xfree86/xaa/xaaStateChange.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.2 2003/02/04 01:44:07 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.3 2003/08/22 19:27:31 eich Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -1670,8 +1670,9 @@ XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
XAA_STATE_WRAP(CopyWindow);
XAA_STATE_WRAP(SaveAreas);
XAA_STATE_WRAP(RestoreAreas);
+#ifdef RENDER
XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture);
XAA_STATE_WRAP(SetupForCPUToScreenTexture);
-
+#endif
return TRUE;
}
diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c
index 8037a3eaf..862f50ba0 100644
--- a/hw/xfree86/xaa/xaaStipple.c
+++ b/hw/xfree86/xaa/xaaStipple.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.11 2001/10/28 03:34:04 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.12 2003/08/04 22:18:31 mvojkovi Exp $ */
#include "xaa.h"
#include "xaalocal.h"
@@ -762,20 +762,28 @@ StippleOver32(
){
CARD32* srcp;
CARD32 bits;
- int bitsleft, shift;
+ int bitsleft, shift, usable;
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;
+ bitsleft = width - offset;
+ srcp = src + (offset >> 5);
+ shift = offset & 31;
+ usable = 32 - shift;
+
+ if(bitsleft < 32) {
+ if(bitsleft <= usable) {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
+ } else {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]);
+ }
+ }
+ else if(shift)
+ bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable);
+ else
+ bits = *srcp;
#ifdef TRIPLE_BITS
if(dwords >= 2) {
@@ -805,20 +813,28 @@ StippleOver32_Inverted(
){
CARD32* srcp;
CARD32 bits;
- int bitsleft, shift;
+ int bitsleft, shift, usable;
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;
+ bitsleft = width - offset;
+ srcp = src + (offset >> 5);
+ shift = offset & 31;
+ usable = 32 - shift;
+
+ if(bitsleft < 32) {
+ if(bitsleft <= usable) {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
+ } else {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]);
+ }
+ }
+ else if(shift)
+ bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable);
+ else
+ bits = *srcp;
bits = ~bits;
diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
index 7425f9d20..f999b425f 100644
--- a/hw/xfree86/xaa/xaaWideLine.c
+++ b/hw/xfree86/xaa/xaaWideLine.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.10 2001/11/16 16:47:56 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.11 2003/07/16 01:38:48 dawes Exp $ */
/*
@@ -32,7 +32,7 @@ Original mi code written by Keith Packard.
#include "X.h"
#include "windowstr.h"
#include "gcstruct.h"
-#include "miscstruct.h"
+#include "regionstr.h"
#include "miwideline.h"
#include "mi.h"
#include "xf86str.h"
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
index 0c239c234..4504deffd 100644
--- a/hw/xfree86/xaa/xaalocal.h
+++ b/hw/xfree86/xaa/xaalocal.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.36 2003/02/17 16:08:29 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.37 2003/11/10 18:22:41 tsi Exp $ */
#ifndef _XAALOCAL_H
#define _XAALOCAL_H
@@ -1485,7 +1485,7 @@ void XAAMoveDWORDS(
int
XAAGetRectClipBoxes(
- RegionPtr prgnClip,
+ GCPtr pGC,
BoxPtr pboxClippedBase,
int nrectFill,
xRectangle *prectInit
diff --git a/hw/xfree86/xf4bpp/emulTile.c b/hw/xfree86/xf4bpp/emulTile.c
index a2d24f4d9..650c448b8 100644
--- a/hw/xfree86/xf4bpp/emulTile.c
+++ b/hw/xfree86/xf4bpp/emulTile.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulTile.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulTile.c,v 1.4 2003/11/03 05:11:56 tsi Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -178,7 +178,6 @@ register int x0, y0, w, h ;
int xSrc ;
int ySrc ;
{
-ScreenPtr pScreen ;
int xOffset ;
int yOffset ;
int width, height;
@@ -186,7 +185,6 @@ 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 */
diff --git a/hw/xfree86/xf4bpp/mfbfillarc.c b/hw/xfree86/xf4bpp/mfbfillarc.c
index 14c2ccb66..4c4d8eab6 100644
--- a/hw/xfree86/xf4bpp/mfbfillarc.c
+++ b/hw/xfree86/xf4bpp/mfbfillarc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbfillarc.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbfillarc.c,v 1.6 2003/11/03 05:11:56 tsi Exp $ */
/************************************************************
Copyright (c) 1989 X Consortium
@@ -244,16 +244,16 @@ xf4bppPolyFillArcSolid
xArc *parcs
)
{
- mfbPrivGC *priv;
register xArc *arc;
register int i;
BoxRec box;
RegionPtr cclip;
+#if 0
+ mfbPrivGC *priv;
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))
diff --git a/hw/xfree86/xf4bpp/mfbimggblt.c b/hw/xfree86/xf4bpp/mfbimggblt.c
index cb2e63125..a5d5b5b37 100644
--- a/hw/xfree86/xf4bpp/mfbimggblt.c
+++ b/hw/xfree86/xf4bpp/mfbimggblt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.7 2003/02/18 21:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.9 2003/11/17 22:20:42 dawes Exp $ */
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
@@ -101,7 +101,6 @@ xoff, pdst, pglyph, and tmpSrc seem like the right things, though.
/* Forward declarations -- GJA */
static void doImageGlyphBlt(
-#if NeedFunctionPrototypes
DrawablePtr,
GC *,
int,
@@ -110,7 +109,6 @@ static void doImageGlyphBlt(
CharInfoPtr *,
unsigned char *,
ExtentInfoRec *
-#endif
);
void
@@ -352,7 +350,9 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
int glyphRow; /* first row of glyph not wholly
clipped out */
int glyphCol; /* leftmost visible column of glyph */
+#if GETLEFTBITS_ALIGNMENT > 1
int getWidth; /* bits to get from glyph */
+#endif
if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS))))
return;
@@ -452,7 +452,9 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
glyphCol = (leftEdge - ppos[i].xpos) -
(pci->metrics.leftSideBearing);
+#if GETLEFTBITS_ALIGNMENT > 1
getWidth = w + glyphCol;
+#endif
xoff = xchar + (leftEdge - ppos[i].xpos);
if (xoff > PLST)
{
diff --git a/hw/xfree86/xf4bpp/mfbline.c b/hw/xfree86/xf4bpp/mfbline.c
index dc85e3d92..c2717599f 100644
--- a/hw/xfree86/xf4bpp/mfbline.c
+++ b/hw/xfree86/xf4bpp/mfbline.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbline.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbline.c,v 1.6 2003/11/17 22:20:42 dawes Exp $ */
/***********************************************************
Copyright (c) 1987 X Consortium
@@ -92,9 +92,7 @@ actual clipping.
*/
#ifdef POLYSEGMENT
static void DoV16SegmentSS(
-#if NeedFunctionPrototypes
DrawablePtr, GCPtr, int, xSegment*
-#endif
);
void
@@ -113,9 +111,7 @@ xf4bppSegmentSS (pDrawable, pGC, nseg, pSeg)
#else
static void DoV16LineSS(
-#if NeedFunctionPrototypes
DrawablePtr, GCPtr, int, int, DDXPointPtr
-#endif
);
void
@@ -182,13 +178,14 @@ DoV16LineSS (pDrawable, pGC, mode, npt, pptInit)
register int y1, y2;
register int x1, x2;
RegionPtr cclip;
- int alu;
+#ifndef POLYSEGMENT
+ int alu = pGC->alu; /* GJA */
+#endif
if (!(pGC->planemask & 0x0F))
return;
cclip = pGC->pCompositeClip;
- alu = pGC->alu; /* GJA */
pboxInit = REGION_RECTS(cclip);
nboxInit = REGION_NUM_RECTS(cclip);
@@ -499,9 +496,7 @@ DoV16LineSS (pDrawable, pGC, mode, npt, pptInit)
#ifdef POLYSEGMENT
static void DoV16SegmentSD(
-#if NeedFunctionPrototypes
DrawablePtr, GCPtr, int, xSegment*
-#endif
);
void
@@ -520,9 +515,7 @@ xf4bppSegmentSD (pDrawable, pGC, nseg, pSeg)
#else
static void DoV16LineSD(
-#if NeedFunctionPrototypes
DrawablePtr, GCPtr, int, int, DDXPointPtr
-#endif
);
void
@@ -803,10 +796,7 @@ dontStep: ;
(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);
diff --git a/hw/xfree86/xf4bpp/ppcCpArea.c b/hw/xfree86/xf4bpp/ppcCpArea.c
index e5202c267..86b7d6f6c 100644
--- a/hw/xfree86/xf4bpp/ppcCpArea.c
+++ b/hw/xfree86/xf4bpp/ppcCpArea.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCpArea.c,v 1.5 2000/09/26 15:57:21 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCpArea.c,v 1.7 2003/11/10 18:22:42 tsi Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -71,31 +71,19 @@ vga16DoBitblt
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)
+ widthSrc = cfbGetLongWidth(pSrc);
+ widthDst = cfbGetLongWidth(pDst);
/* XXX we have to err on the side of safety when both are windows,
* because we don't know if IncludeInferiors is being used.
@@ -114,7 +102,6 @@ vga16DoBitblt
if (careful && (pptSrc->y < pbox->y1))
{
/* walk source botttom to top */
- ydir = -1;
widthSrc = -widthSrc;
widthDst = -widthDst;
@@ -151,17 +138,9 @@ vga16DoBitblt
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 */
@@ -199,11 +178,6 @@ vga16DoBitblt
pptSrc = pptNew2;
}
}
- else
- {
- /* walk source left to right */
- xdir = 1;
- }
while(nbox--)
{
@@ -424,7 +398,7 @@ int dstx, dsty;
/* Check to see if the region is empty */
if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
{
- REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pGC->pScreen, &rgnDst);
}
else
{
diff --git a/hw/xfree86/xf4bpp/ppcFillRct.c b/hw/xfree86/xf4bpp/ppcFillRct.c
index 7e1c866ef..af1ecb95e 100644
--- a/hw/xfree86/xf4bpp/ppcFillRct.c
+++ b/hw/xfree86/xf4bpp/ppcFillRct.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcFillRct.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcFillRct.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
/***********************************************************
@@ -82,18 +82,10 @@ xf4bppPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
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;
diff --git a/hw/xfree86/xf4bpp/ppcGCstr.h b/hw/xfree86/xf4bpp/ppcGCstr.h
index 5f863fa73..341e17534 100644
--- a/hw/xfree86/xf4bpp/ppcGCstr.h
+++ b/hw/xfree86/xf4bpp/ppcGCstr.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGCstr.h,v 1.3 2003/02/18 21:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGCstr.h,v 1.4 2003/11/17 22:20:42 dawes Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -79,17 +79,13 @@ 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/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c
index 43cc7bd33..f6999c561 100644
--- a/hw/xfree86/xf4bpp/ppcIO.c
+++ b/hw/xfree86/xf4bpp/ppcIO.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcIO.c,v 1.5 2001/10/28 03:34:06 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcIO.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
/*
Copyright (c) 1990 X Consortium
@@ -77,7 +77,7 @@ static VisualRec vgaVisuals[] = {
} ;
#endif
-int
+void
xf4bppNeverCalled()
{
FatalError("xf4bppNeverCalled was nevertheless called\n");
diff --git a/hw/xfree86/xf4bpp/ppcPixFS.c b/hw/xfree86/xf4bpp/ppcPixFS.c
index 261c8e809..c009d696e 100644
--- a/hw/xfree86/xf4bpp/ppcPixFS.c
+++ b/hw/xfree86/xf4bpp/ppcPixFS.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixFS.c,v 1.4 2001/08/01 00:44:56 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixFS.c,v 1.5 2003/11/03 05:11:57 tsi Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -126,16 +126,16 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
return ;
n = nInit * miFindMaxBand(pGC->pCompositeClip) ;
- if ( !( pwidth = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
+ if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
return ;
- pwidthFree = pwidth ;
+ pwidth = pwidthFree ;
- if ( !( ppt = (DDXPointRec *)
+ if ( !( pptFree = (DDXPointRec *)
ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) {
DEALLOCATE_LOCAL( pwidth ) ;
return ;
}
- pptFree = ppt ;
+ ppt = pptFree ;
n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
ppt, pwidth, fSorted ) ;
@@ -260,8 +260,8 @@ int fSorted ;
if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
return ;
- SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
- ppt, pwidthFree, pptFree, fSorted ) ;
+ SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
+ pptFree, pwidth, ppt, fSorted ) ;
pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
@@ -359,8 +359,8 @@ int fSorted ;
if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
return ;
- SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
- ppt, pwidthFree, pptFree, fSorted ) ;
+ SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
+ pptFree, pwidth, ppt, fSorted ) ;
fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ;
@@ -462,8 +462,8 @@ int fSorted ;
if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
return ;
- SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
- ppt, pwidthFree, pptFree, fSorted ) ;
+ SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
+ pptFree, pwidth, ppt, fSorted ) ;
/* the following code is for 8 bits per pixel addressable memory only */
pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c
index e61fed342..f52343fc9 100644
--- a/hw/xfree86/xf4bpp/ppcPntWin.c
+++ b/hw/xfree86/xf4bpp/ppcPntWin.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPntWin.c,v 1.3 1999/06/06 08:49:01 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPntWin.c,v 1.4 2003/11/17 22:20:42 dawes Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -80,18 +80,14 @@ SOFTWARE.
/* 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
diff --git a/hw/xfree86/xf4bpp/ppcWinFS.c b/hw/xfree86/xf4bpp/ppcWinFS.c
index 29d466f00..fc38cdcfe 100644
--- a/hw/xfree86/xf4bpp/ppcWinFS.c
+++ b/hw/xfree86/xf4bpp/ppcWinFS.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWinFS.c,v 1.3 1999/06/06 08:49:02 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWinFS.c,v 1.4 2003/11/03 05:11:57 tsi Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -98,16 +98,16 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
return ;
n = nInit * miFindMaxBand( pGC->pCompositeClip ) ;
- if ( !( pwidth = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
+ if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
return ;
- pwidthFree = pwidth ;
+ pwidth = pwidthFree ;
- if ( !( ppt = (DDXPointRec *)
+ if ( !( pptFree = (DDXPointRec *)
ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) {
DEALLOCATE_LOCAL( pwidth ) ;
return ;
}
- pptFree = ppt ;
+ ppt = pptFree ;
n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
ppt, pwidth, fSorted ) ;
@@ -164,8 +164,8 @@ int fSorted ;
if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
return ;
- SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
- ppt, pwidthFree, pptFree, fSorted ) ;
+ SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
+ pptFree, pwidth, ppt, fSorted ) ;
pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
@@ -216,8 +216,8 @@ int fSorted ;
if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
return ;
- SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
- ppt, pwidthFree, pptFree, fSorted ) ;
+ SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
+ pptFree, pwidth, ppt, fSorted ) ;
pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
@@ -261,8 +261,8 @@ int fSorted ;
if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
return ;
- SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
- ppt, pwidthFree, pptFree, fSorted ) ;
+ SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit,
+ pptFree, pwidth, ppt, fSorted ) ;
xSrc = pGC->patOrg.x + pDrawable->x ;
ySrc = pGC->patOrg.y + pDrawable->y ;
diff --git a/hw/xfree86/xf4bpp/vgaBitBlt.c b/hw/xfree86/xf4bpp/vgaBitBlt.c
index 53eb3b314..660cc356b 100644
--- a/hw/xfree86/xf4bpp/vgaBitBlt.c
+++ b/hw/xfree86/xf4bpp/vgaBitBlt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaBitBlt.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaBitBlt.c,v 1.6 2003/11/17 22:20:42 dawes Exp $ */
/* GJA -- span move routines */
@@ -101,33 +101,23 @@ static unsigned char rmasktab[] = {
}
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)
@@ -535,13 +525,10 @@ int h;
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);
diff --git a/hw/xfree86/xf4bpp/vgaImages.c b/hw/xfree86/xf4bpp/vgaImages.c
index 66c2c14e0..4357e4d8a 100644
--- a/hw/xfree86/xf4bpp/vgaImages.c
+++ b/hw/xfree86/xf4bpp/vgaImages.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaImages.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaImages.c,v 1.5 2003/11/03 05:11:57 tsi Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -117,10 +117,7 @@ register unsigned char tmp1;
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) {
@@ -153,6 +150,8 @@ register unsigned char tmp1;
outw(EGC_FGC, 0x0000);
tmp1 = 0;
#else
+ if ( invert_existing_data )
+ xf4bppFillSolid( pWin, VGA_ALLPLANES, GXinvert, planes, x, y, w, h ) ;
/* Setup VGA Registers */
SetVideoSequencer( Mask_MapIndex, planes & VGA_ALLPLANES ) ;
/* Set Raster Op */
@@ -205,6 +204,7 @@ if ( invert_source_data )
SetVideoGraphics( Bit_MaskIndex, currMask ) ;
/* Read To Load vga Data Latches */
tmp = *( (VgaMemoryPtr) dst ) ;
+ (void) tmp;
*( (VgaMemoryPtr) dst ) = ~ *src ;
if ( currMask & RightmostBit ) {
currMask = LeftmostBit ;
@@ -256,6 +256,7 @@ else /* invert_source_data == FALSE */
SetVideoGraphics( Bit_MaskIndex, currMask ) ; /* GJA */
/* Read To Load vga Data Latches */
tmp = *( (VgaMemoryPtr) dst ) ;
+ (void) tmp;
*( (VgaMemoryPtr) dst ) = *src ;
if ( currMask & RightmostBit ) {
currMask = LeftmostBit ;
diff --git a/hw/xfree86/xf4bpp/vgaSolid.c b/hw/xfree86/xf4bpp/vgaSolid.c
index ceb39ef77..b3711f852 100644
--- a/hw/xfree86/xf4bpp/vgaSolid.c
+++ b/hw/xfree86/xf4bpp/vgaSolid.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaSolid.c,v 1.5 2002/01/25 21:56:22 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaSolid.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -117,7 +117,7 @@ register const unsigned int notZero = ((unsigned char)(~0x0));
register int tmp ;
#define SINGLE_STORE \
- tmp = *( (VgaMemoryPtr) destination ) ; \
+ tmp = *( (VgaMemoryPtr) destination ) ; (void)tmp; \
( *( (VgaMemoryPtr) destination ) = notZero ) ; \
destination++; stop_count-- ;
@@ -282,6 +282,7 @@ if ((tmp = x0 & 07)) {
for ( tmp = ly;
tmp-- ; ) {
tmp3 = *( (VgaMemoryPtr) dst ) ;
+ (void)tmp3;
*( (VgaMemoryPtr) dst ) = tmp2 ;
dst += BYTES_PER_LINE(pWin);
}
@@ -293,6 +294,7 @@ if ((tmp = x0 & 07)) {
for ( tmp = ly;
tmp-- ; ) {
tmp3 = *( (VgaMemoryPtr) dst ) ;
+ (void)tmp3;
*( (VgaMemoryPtr) dst ) = tmp2 ;
dst += BYTES_PER_LINE(pWin);
}
@@ -333,6 +335,7 @@ if ((tmp = BIT_OFFSET(lx))) { /* x0 Now Is Byte Aligned */
for ( tmp = ly;
tmp-- ; ) {
tmp3 = *( (VgaMemoryPtr) dst ) ;
+ (void)tmp3;
*( (VgaMemoryPtr) dst ) = tmp2 ;
dst += BYTES_PER_LINE(pWin);
}
@@ -344,6 +347,7 @@ if ((tmp = BIT_OFFSET(lx))) { /* x0 Now Is Byte Aligned */
for ( tmp = ly;
tmp-- ; ) {
tmp3 = *( (VgaMemoryPtr) dst ) ;
+ (void)tmp3;
*( (VgaMemoryPtr) dst ) = tmp2 ;
dst += BYTES_PER_LINE(pWin) ;
}
diff --git a/hw/xfree86/xf4bpp/vgaStipple.c b/hw/xfree86/xf4bpp/vgaStipple.c
index a4f3cef6b..f5ace74d0 100644
--- a/hw/xfree86/xf4bpp/vgaStipple.c
+++ b/hw/xfree86/xf4bpp/vgaStipple.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaStipple.c,v 1.5 2002/01/25 21:56:22 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaStipple.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */
/*
* Copyright IBM Corporation 1987,1988,1989
*
@@ -388,7 +388,9 @@ if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */
tmp2-- ;
dst++ ) {
register unsigned bitPattern ;
+#ifndef PC98_EGC
register VideoAdapterObject tmp3 ;
+#endif
/*
* For Each Time Pattern Repeats In Y
*/
@@ -408,6 +410,7 @@ if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */
#ifndef PC98_EGC
/* Read To Save */
tmp3 = *( (VgaMemoryPtr) xDst) ;
+ (void)tmp3;
#endif
/* Write Pattern */
*( (VgaMemoryPtr) xDst ) = bitPattern ;
diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h
index f9141e5e1..59458a258 100644
--- a/hw/xfree86/xf4bpp/xf4bpp.h
+++ b/hw/xfree86/xf4bpp/xf4bpp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/xf4bpp.h,v 1.8 2003/02/18 21:29:59 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/xf4bpp.h,v 1.10 2003/11/17 22:20:42 dawes Exp $ */
#ifndef __XF4BPP_H__
@@ -15,58 +15,45 @@
/* 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,
@@ -76,145 +63,115 @@ RegionPtr xf4bppCopyArea(
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,
@@ -223,110 +180,86 @@ void xf4bppGetImage(
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 *,
@@ -334,45 +267,33 @@ void xf4bppSetSpans(
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,
@@ -385,12 +306,10 @@ void xf4bppOpaqueStipple(
int,
int,
int
-#endif
);
/* emulRepAre.c */
void xf4bppReplicateArea(
-#if NeedFunctionPrototypes
WindowPtr,
int,
int,
@@ -399,12 +318,10 @@ void xf4bppReplicateArea(
int,
int,
int
-#endif
);
/* emulTile.c */
void xf4bppTileRect(
-#if NeedFunctionPrototypes
WindowPtr,
PixmapPtr,
const int,
@@ -415,20 +332,16 @@ void xf4bppTileRect(
int,
int,
int
-#endif
);
/* vgaGC.c */
Mask xf4bppChangeWindowGC(
-#if NeedFunctionPrototypes
GCPtr,
Mask
-#endif
);
/* vgaBitBlt.c */
void xf4bppBitBlt(
-#if NeedFunctionPrototypes
WindowPtr,
int,
int,
@@ -438,12 +351,10 @@ void xf4bppBitBlt(
int,
int,
int
-#endif
);
/* vgaImages.c */
void xf4bppDrawColorImage(
-#if NeedFunctionPrototypes
WindowPtr,
int,
int,
@@ -453,10 +364,8 @@ void xf4bppDrawColorImage(
int,
const int,
const unsigned long int
-#endif
);
void xf4bppReadColorImage(
-#if NeedFunctionPrototypes
WindowPtr,
int,
int,
@@ -464,12 +373,10 @@ void xf4bppReadColorImage(
int,
unsigned char *,
int
-#endif
);
/* vgaLine.c */
void xf4bppHorzLine(
-#if NeedFunctionPrototypes
WindowPtr,
unsigned long int,
int,
@@ -477,10 +384,8 @@ void xf4bppHorzLine(
int,
int,
int
-#endif
);
void xf4bppVertLine(
-#if NeedFunctionPrototypes
WindowPtr,
unsigned long int,
int,
@@ -488,10 +393,8 @@ void xf4bppVertLine(
int,
int,
int
-#endif
);
void xf4bppBresLine(
-#if NeedFunctionPrototypes
WindowPtr,
unsigned long int,
int,
@@ -505,12 +408,10 @@ void xf4bppBresLine(
int,
int,
unsigned long int
-#endif
);
/* vgaStipple.c */
void xf4bppFillStipple(
-#if NeedFunctionPrototypes
WindowPtr,
const PixmapPtr,
unsigned long int,
@@ -522,12 +423,10 @@ void xf4bppFillStipple(
int,
const int,
const int
-#endif
);
/* vgaSolid.c */
void xf4bppFillSolid(
-#if NeedFunctionPrototypes
WindowPtr,
unsigned long int,
const int,
@@ -536,12 +435,10 @@ void xf4bppFillSolid(
const int,
int,
const int
-#endif
);
/* offscreen.c */
void xf4bppOffBitBlt(
-#if NeedFunctionPrototypes
WindowPtr,
const int,
const int,
@@ -551,10 +448,8 @@ void xf4bppOffBitBlt(
int,
int,
int
-#endif
);
void xf4bppOffDrawColorImage(
-#if NeedFunctionPrototypes
WindowPtr,
int,
int,
@@ -564,10 +459,8 @@ void xf4bppOffDrawColorImage(
int,
const int,
const unsigned long int
-#endif
);
void xf4bppOffReadColorImage(
-#if NeedFunctionPrototypes
WindowPtr,
int,
int,
@@ -575,10 +468,8 @@ void xf4bppOffReadColorImage(
int,
unsigned char *,
int
-#endif
);
void xf4bppOffFillSolid(
-#if NeedFunctionPrototypes
WindowPtr,
unsigned long int,
const int,
@@ -587,10 +478,8 @@ void xf4bppOffFillSolid(
const int,
int,
const int
-#endif
);
void xf4bppOffDrawMonoImage(
-#if NeedFunctionPrototypes
WindowPtr,
unsigned char *,
int,
@@ -600,10 +489,8 @@ void xf4bppOffDrawMonoImage(
unsigned long int,
int,
unsigned long int
-#endif
);
void xf4bppOffFillStipple(
-#if NeedFunctionPrototypes
WindowPtr,
const PixmapPtr,
unsigned long int,
@@ -615,12 +502,10 @@ void xf4bppOffFillStipple(
int,
const int,
const int
-#endif
);
/* mfbimggblt.c */
void xf4bppImageGlyphBlt(
-#if NeedFunctionPrototypes
DrawablePtr,
GCPtr,
int,
@@ -628,24 +513,18 @@ void xf4bppImageGlyphBlt(
unsigned int,
CharInfoPtr *,
pointer
-#endif
);
/* wm3.c */
int wm3_set_regs(
-#if NeedFunctionPrototypes
GC *
-#endif
);
/* ppcIO.c */
-int xf4bppNeverCalled(
-#if NeedFunctionPrototypes
+void xf4bppNeverCalled(
void
-#endif
);
Bool xf4bppScreenInit(
-#if NeedFunctionPrototypes
ScreenPtr,
pointer,
int,
@@ -653,68 +532,54 @@ Bool xf4bppScreenInit(
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,
@@ -726,12 +591,10 @@ void xf4bppBresS(
int,
int,
int
-#endif
);
/* mfbbresd.c */
void xf4bppBresD(
-#if NeedFunctionPrototypes
DrawablePtr,
int, int,
int *,
@@ -743,60 +606,47 @@ void xf4bppBresD(
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 */
diff --git a/hw/xfree86/xf8_16bpp/cfbwindow.c b/hw/xfree86/xf8_16bpp/cfbwindow.c
index 3ad8a5809..757b0dc49 100644
--- a/hw/xfree86/xf8_16bpp/cfbwindow.c
+++ b/hw/xfree86/xf8_16bpp/cfbwindow.c
@@ -4,7 +4,7 @@
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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbwindow.c,v 1.5 2003/11/10 18:22:42 tsi Exp $ */
#include "X.h"
#include "scrnintstr.h"
@@ -70,7 +70,7 @@ cfb8_16CopyWindow(
int i, nbox, dx, dy;
WindowPtr pRoot = WindowTable[pScreen->myNum];
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
@@ -99,7 +99,7 @@ cfb8_16CopyWindow(
REGION_UNINIT(pScreen, &rgnDst);
if(pWin->drawable.depth == 8) {
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
miSegregateChildren(pWin, &rgnDst, pScrn->depth);
if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h
index 733051ae0..30bc1a0fa 100644
--- a/hw/xfree86/xf8_32bpp/cfb8_32.h
+++ b/hw/xfree86/xf8_32bpp/cfb8_32.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32.h,v 1.5 2000/03/02 02:32:52 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32.h,v 1.6 2003/07/16 01:38:50 dawes Exp $ */
#ifndef _CFB8_32_H
#define _CFB8_32_H
@@ -57,8 +57,7 @@ cfbDoBitblt8To32(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long planemask,
- unsigned long bitPlane
+ unsigned long planemask
);
void
@@ -68,8 +67,7 @@ cfbDoBitblt32To8(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long planemask,
- unsigned long bitPlane
+ unsigned long planemask
);
@@ -177,8 +175,7 @@ cfbDoBitblt8To8GXcopy(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long pm,
- unsigned long bitPlane
+ unsigned long pm
);
void
@@ -188,8 +185,7 @@ cfbDoBitblt24To24GXcopy(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long pm,
- unsigned long bitPlane
+ unsigned long pm
);
Bool cfb8_32CreateWindow(WindowPtr pWin);
diff --git a/hw/xfree86/xf8_32bpp/cfbbstore.c b/hw/xfree86/xf8_32bpp/cfbbstore.c
index 919fabf5f..581efb4f6 100644
--- a/hw/xfree86/xf8_32bpp/cfbbstore.c
+++ b/hw/xfree86/xf8_32bpp/cfbbstore.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbbstore.c,v 1.2 1999/01/31 12:22:17 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbbstore.c,v 1.3 2003/07/16 01:38:50 dawes Exp $ */
#define PSZ 8
#include "cfb.h"
@@ -49,7 +49,7 @@ cfb8_32SaveAreas(
pScrPix = (PixmapPtr) pScreen->devPrivate;
cfbDoBitblt32To8((DrawablePtr) pScrPix, (DrawablePtr)pPixmap,
- GXcopy, prgnSave, pPtsInit, ~0L, 0);
+ GXcopy, prgnSave, pPtsInit, ~0L);
DEALLOCATE_LOCAL (pPtsInit);
}
@@ -95,7 +95,7 @@ cfb8_32RestoreAreas(
GXcopy, prgnRestore, pPtsInit, ~0);
} else {
cfbDoBitblt8To32((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
- GXcopy, prgnRestore, pPtsInit, ~0L, 0);
+ GXcopy, prgnRestore, pPtsInit, ~0L);
}
DEALLOCATE_LOCAL (pPtsInit);
diff --git a/hw/xfree86/xf8_32bpp/cfbcpyarea.c b/hw/xfree86/xf8_32bpp/cfbcpyarea.c
index 752e56db8..53af8f7d8 100644
--- a/hw/xfree86/xf8_32bpp/cfbcpyarea.c
+++ b/hw/xfree86/xf8_32bpp/cfbcpyarea.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c,v 1.5 2000/02/29 00:17:16 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c,v 1.6 2003/07/16 01:38:50 dawes Exp $ */
#include "X.h"
#include "Xmd.h"
@@ -67,8 +67,7 @@ cfbDoBitblt8To32(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long pm,
- unsigned long bitPlane
+ unsigned long pm
){
BoxPtr pbox = REGION_RECTS(prgnDst);
int nbox = REGION_NUM_RECTS(prgnDst);
@@ -184,8 +183,7 @@ cfbDoBitblt32To8(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long pm,
- unsigned long bitPlane
+ unsigned long pm
){
BoxPtr pbox = REGION_RECTS(prgnDst);
int nbox = REGION_NUM_RECTS(prgnDst);
@@ -394,7 +392,15 @@ cfb8_32DoBitBlt(
DrawablePtr pDst,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- void (*DoBlt)()
+ void (*DoBlt)(
+ unsigned char *SrcPtr,
+ int SrcPitch,
+ unsigned char *DstPtr,
+ int DstPitch,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir)
){
int nbox, careful, SrcPitch, DstPitch;
BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
@@ -519,8 +525,7 @@ cfbDoBitblt8To8GXcopy(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long pm,
- unsigned long bitPlane
+ unsigned long pm
){
cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do8To8Blt);
}
@@ -533,8 +538,7 @@ cfbDoBitblt24To24GXcopy(
int rop,
RegionPtr prgnDst,
DDXPointPtr pptSrc,
- unsigned long pm,
- unsigned long bitPlane
+ unsigned long pm
){
cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do24To24Blt);
}
diff --git a/hw/xfree86/xf8_32bpp/cfbgcunder.c b/hw/xfree86/xf8_32bpp/cfbgcunder.c
index d263b8b9e..d01b2b5cb 100644
--- a/hw/xfree86/xf8_32bpp/cfbgcunder.c
+++ b/hw/xfree86/xf8_32bpp/cfbgcunder.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c,v 1.5 2001/12/14 19:59:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c,v 1.6 2003/07/16 01:38:50 dawes Exp $ */
/***********************************************************
Copyright 1987, 1998 The Open Group
@@ -66,6 +66,7 @@ SOFTWARE.
#include "cfbmskbits.h"
#include "cfb8bit.h"
+#include "cfb8_32.h"
#ifdef WriteBitGroup
# define useTEGlyphBlt cfbImageGlyphBlt8
@@ -217,9 +218,9 @@ static GCOps cfbNonTEOps = {
};
static GCOps *
-cfb32MatchCommon_Underlay (pGC, devPriv)
- GCPtr pGC;
- cfbPrivGCPtr devPriv;
+cfb32MatchCommon_Underlay(
+ GCPtr pGC,
+ cfbPrivGCPtr devPriv)
{
if (pGC->lineWidth != 0)
return 0;
diff --git a/hw/xfree86/xf8_32bpp/cfbimage.c b/hw/xfree86/xf8_32bpp/cfbimage.c
index 1e8550851..e737e025e 100644
--- a/hw/xfree86/xf8_32bpp/cfbimage.c
+++ b/hw/xfree86/xf8_32bpp/cfbimage.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbimage.c,v 1.2 2000/02/25 00:21:40 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbimage.c,v 1.3 2003/07/16 01:38:50 dawes Exp $ */
#include "X.h"
#include "windowstr.h"
@@ -63,7 +63,7 @@ cfb8_32GetImage (
box.y2 = h;
REGION_INIT(pScreen, &rgnDst, &box, 1);
cfbDoBitblt32To8(pDraw, (DrawablePtr)pPixmap, GXcopy, &rgnDst,
- &ptSrc, planemask, 0);
+ &ptSrc, planemask);
REGION_UNINIT(pScreen, &rgnDst);
FreeScratchPixmapHeader(pPixmap);
}
diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c
index ce2b8ae8f..7f123d36a 100644
--- a/hw/xfree86/xf8_32bpp/cfbscrinit.c
+++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c,v 1.11 2001/04/14 21:17:49 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c,v 1.12 2003/07/16 01:38:50 dawes Exp $ */
#include "X.h"
@@ -76,6 +76,20 @@ cfb8_32AllocatePrivates(ScreenPtr pScreen)
return TRUE;
}
+static void DestroyColormapNoop(
+ ColormapPtr pColormap)
+{
+ /* NOOP */
+}
+
+static void StoreColorsNoop(
+ ColormapPtr pColormap,
+ int ndef,
+ xColorItem * pdef)
+{
+ /* NOOP */
+}
+
static Bool
cfb8_32SetupScreen(
ScreenPtr pScreen,
@@ -108,11 +122,11 @@ cfb8_32SetupScreen(
pScreen->UnrealizeFont = mfbUnrealizeFont;
pScreen->CreateGC = cfb8_32CreateGC;
pScreen->CreateColormap = miInitializeColormap;
- pScreen->DestroyColormap = (void (*)())NoopDDA;
+ pScreen->DestroyColormap = DestroyColormapNoop;
pScreen->InstallColormap = miInstallColormap;
pScreen->UninstallColormap = miUninstallColormap;
pScreen->ListInstalledColormaps = miListInstalledColormaps;
- pScreen->StoreColors = (void (*)())NoopDDA;
+ pScreen->StoreColors = StoreColorsNoop;
pScreen->ResolveColor = miResolveColor;
pScreen->BitmapToRegion = mfbPixmapToRegion;
diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c
index 518166f41..c18b54399 100644
--- a/hw/xfree86/xf8_32bpp/cfbwindow.c
+++ b/hw/xfree86/xf8_32bpp/cfbwindow.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbwindow.c,v 1.7 2003/02/17 16:08:30 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbwindow.c,v 1.9 2003/11/10 18:22:43 tsi Exp $ */
#include "X.h"
@@ -67,7 +67,7 @@ cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc)
if(doUnderlay)
freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
@@ -92,10 +92,10 @@ cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc)
if(doUnderlay)
cfbDoBitblt24To24GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- GXcopy, &rgnDst, pptSrc, ~0, 0);
+ GXcopy, &rgnDst, pptSrc, ~0);
else
cfbDoBitblt8To8GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- GXcopy, &rgnDst, pptSrc, ~0, 0);
+ GXcopy, &rgnDst, pptSrc, ~0);
DEALLOCATE_LOCAL(pptSrc);
REGION_UNINIT(pScreen, &rgnDst);
diff --git a/hw/xfree86/xf8_32wid/cfbwindow.c b/hw/xfree86/xf8_32wid/cfbwindow.c
index 74db57649..b7ac739b3 100644
--- a/hw/xfree86/xf8_32wid/cfbwindow.c
+++ b/hw/xfree86/xf8_32wid/cfbwindow.c
@@ -7,7 +7,7 @@
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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwindow.c,v 1.3 2003/11/10 18:22:43 tsi Exp $ */
#include "X.h"
#include "scrnintstr.h"
@@ -98,7 +98,7 @@ cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
BoxPtr pbox;
int i, nbox, dx, dy, other_bpp;
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
@@ -136,7 +136,7 @@ cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
else
other_bpp = 8;
- REGION_INIT(pScreen, &rgnOther, NullBox, 0);
+ REGION_NULL(pScreen, &rgnOther);
SegregateChildrenBpp(pWin, &rgnOther, 0,
other_bpp, pWin->drawable.bitsPerPixel);
pPixChildren = NULL;
@@ -162,7 +162,7 @@ cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
ppt->y = pbox->y1 + dy;
}
- REGION_INIT(pScreen, &rgnPixmap, NullBox, 0);
+ REGION_NULL(pScreen, &rgnPixmap);
REGION_COPY(pScreen, &rgnPixmap, &rgnOther);
REGION_TRANSLATE(pScreen, &rgnPixmap, -(rgnOther.extents.x1), -(rgnOther.extents.y1));
diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c
index 197d6cbe1..488179d01 100644
--- a/hw/xnest/Args.c
+++ b/hw/xnest/Args.c
@@ -12,6 +12,8 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Args.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
+
#include "X.h"
#include "Xproto.h"
#include "screenint.h"
@@ -45,10 +47,8 @@ int xnestNumScreens = 0;
Bool xnestDoDirectColormaps = False;
Window xnestParentWindow = 0;
-int ddxProcessArgument (argc, argv, i)
- int argc;
- char *argv[] ;
- int i;
+int
+ddxProcessArgument (int argc, char *argv[], int i)
{
if (!strcmp(argv[i], "-display")) {
if (++i < argc) {
diff --git a/hw/xnest/Args.h b/hw/xnest/Args.h
index 25e5cf8e8..dc2ac9de0 100644
--- a/hw/xnest/Args.h
+++ b/hw/xnest/Args.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Args.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTARGC_H
#define XNESTARGS_H
@@ -34,5 +35,6 @@ extern Bool xnestUserBorderWidth;
extern char *xnestWindowName;
extern int xnestNumScreens;
extern Bool xnestDoDirectColormaps;
+extern Window xnestParentWindow;
#endif /* XNESTARGS_H */
diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c
index 61b560800..ae5ded5e3 100644
--- a/hw/xnest/Color.c
+++ b/hw/xnest/Color.c
@@ -12,6 +12,8 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Color.c,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
+
#include "X.h"
#include "Xproto.h"
#include "scrnintstr.h"
@@ -32,8 +34,8 @@ is" without express or implied warranty.
static ColormapPtr InstalledMaps[MAXSCREENS];
-Bool xnestCreateColormap(pCmap)
- ColormapPtr pCmap;
+Bool
+xnestCreateColormap(ColormapPtr pCmap)
{
VisualPtr pVisual;
XColor *colors;
@@ -118,8 +120,8 @@ Bool xnestCreateColormap(pCmap)
return True;
}
-void xnestDestroyColormap (pCmap)
- ColormapPtr pCmap;
+void
+xnestDestroyColormap(ColormapPtr pCmap)
{
XFreeColormap(xnestDisplay, xnestColormap(pCmap));
xfree(pCmap->devPriv);
@@ -128,9 +130,8 @@ void xnestDestroyColormap (pCmap)
#define SEARCH_PREDICATE \
(xnestWindow(pWin) != None && wColormap(pWin) == icws->cmapIDs[i])
-static int xnestCountInstalledColormapWindows(pWin, ptr)
- WindowPtr pWin;
- pointer ptr;
+static int
+xnestCountInstalledColormapWindows(WindowPtr pWin, pointer ptr)
{
xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr;
int i;
@@ -144,9 +145,8 @@ static int xnestCountInstalledColormapWindows(pWin, ptr)
return WT_WALKCHILDREN;
}
-static int xnestGetInstalledColormapWindows(pWin, ptr)
- WindowPtr pWin;
- pointer ptr;
+static int
+xnestGetInstalledColormapWindows(WindowPtr pWin, pointer ptr)
{
xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr;
int i;
@@ -163,9 +163,8 @@ static int xnestGetInstalledColormapWindows(pWin, ptr)
static Window *xnestOldInstalledColormapWindows = NULL;
static int xnestNumOldInstalledColormapWindows = 0;
-static Bool xnestSameInstalledColormapWindows(windows, numWindows)
- Window *windows;
- int numWindows;
+static Bool
+xnestSameInstalledColormapWindows(Window *windows, int numWindows)
{
if (xnestNumOldInstalledColormapWindows != numWindows)
return False;
@@ -183,8 +182,8 @@ static Bool xnestSameInstalledColormapWindows(windows, numWindows)
return True;
}
-void xnestSetInstalledColormapWindows(pScreen)
- ScreenPtr pScreen;
+void
+xnestSetInstalledColormapWindows(ScreenPtr pScreen)
{
xnestInstalledColormapWindows icws;
int numWindows;
@@ -262,8 +261,8 @@ void xnestSetInstalledColormapWindows(pScreen)
if (icws.windows) xfree(icws.windows);
}
-void xnestSetScreenSaverColormapWindow(pScreen)
- ScreenPtr pScreen;
+void
+xnestSetScreenSaverColormapWindow(ScreenPtr pScreen)
{
if (xnestOldInstalledColormapWindows)
xfree(xnestOldInstalledColormapWindows);
@@ -288,8 +287,8 @@ void xnestSetScreenSaverColormapWindow(pScreen)
xnestDirectUninstallColormaps(pScreen);
}
-void xnestDirectInstallColormaps(pScreen)
- ScreenPtr pScreen;
+void
+xnestDirectInstallColormaps(ScreenPtr pScreen)
{
int i, n;
Colormap pCmapIDs[MAXCMAPS];
@@ -307,8 +306,8 @@ void xnestDirectInstallColormaps(pScreen)
}
}
-void xnestDirectUninstallColormaps(pScreen)
- ScreenPtr pScreen;
+void
+xnestDirectUninstallColormaps(ScreenPtr pScreen)
{
int i, n;
Colormap pCmapIDs[MAXCMAPS];
@@ -326,8 +325,8 @@ void xnestDirectUninstallColormaps(pScreen)
}
}
-void xnestInstallColormap(pCmap)
- ColormapPtr pCmap;
+void
+xnestInstallColormap(ColormapPtr pCmap)
{
int index;
ColormapPtr pOldCmap;
@@ -351,8 +350,8 @@ void xnestInstallColormap(pCmap)
}
}
-void xnestUninstallColormap(pCmap)
- ColormapPtr pCmap;
+void
+xnestUninstallColormap(ColormapPtr pCmap)
{
int index;
ColormapPtr pCurCmap;
@@ -373,9 +372,8 @@ void xnestUninstallColormap(pCmap)
static Bool xnestInstalledDefaultColormap = False;
-int xnestListInstalledColormaps(pScreen, pCmapIDs)
- ScreenPtr pScreen;
- Colormap *pCmapIDs;
+int
+xnestListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIDs)
{
if (xnestInstalledDefaultColormap) {
*pCmapIDs = InstalledMaps[pScreen->myNum]->mid;
@@ -385,10 +383,8 @@ int xnestListInstalledColormaps(pScreen, pCmapIDs)
return 0;
}
-void xnestStoreColors(pCmap, nColors, pColors)
- ColormapPtr pCmap;
- int nColors;
- xColorItem *pColors;
+void
+xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors)
{
if (pCmap->pVisual->class & DynamicClass)
#ifdef _XSERVER64
@@ -413,11 +409,9 @@ void xnestStoreColors(pCmap, nColors, pColors)
#endif
}
-void xnestResolveColor(pRed, pGreen, pBlue, pVisual)
- unsigned short *pRed;
- unsigned short *pGreen;
- unsigned short *pBlue;
- VisualPtr pVisual;
+void
+xnestResolveColor(unsigned short *pRed, unsigned short *pGreen,
+ unsigned short *pBlue, VisualPtr pVisual)
{
int shift;
unsigned int lim;
@@ -465,8 +459,8 @@ void xnestResolveColor(pRed, pGreen, pBlue, pVisual)
}
}
-Bool xnestCreateDefaultColormap(pScreen)
- ScreenPtr pScreen;
+Bool
+xnestCreateDefaultColormap(ScreenPtr pScreen)
{
VisualPtr pVisual;
ColormapPtr pCmap;
diff --git a/hw/xnest/Color.h b/hw/xnest/Color.h
index 6ba6cd97a..0b3c22581 100644
--- a/hw/xnest/Color.h
+++ b/hw/xnest/Color.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Color.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTCOLOR_H
#define XNESTCOLOR_H
@@ -40,17 +41,18 @@ typedef struct {
#define xnestPixel(pixel) (pixel)
-Bool xnestCreateColormap();
-void xnestDestroyColormap ();
-void xnestSetInstalledColormapWindows();
-void xnestSetScreenSaverColormapWindow();
-void xnestDirectInstallColormaps();
-void xnestDirectUninstallColormaps();
-void xnestInstallColormap();
-void xnestUninstallColormap();
-int xnestListInstalledColormaps();
-void xnestStoreColors();
-void xnestResolveColor();
-Bool xnestCreateDefaultColormap();
+Bool xnestCreateColormap(ColormapPtr pCmap);
+void xnestDestroyColormap(ColormapPtr pCmap);
+void xnestSetInstalledColormapWindows(ScreenPtr pScreen);
+void xnestSetScreenSaverColormapWindow(ScreenPtr pScreen);
+void xnestDirectInstallColormaps(ScreenPtr pScreen);
+void xnestDirectUninstallColormaps(ScreenPtr pScreen);
+void xnestInstallColormap(ColormapPtr pCmap);
+void xnestUninstallColormap(ColormapPtr pCmap);
+int xnestListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIDs);
+void xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors);
+void xnestResolveColor(unsigned short *pRed, unsigned short *pGreen,
+ unsigned short *pBlue, VisualPtr pVisual);
+Bool xnestCreateDefaultColormap(ScreenPtr pScreen);
#endif /* XNESTCOLOR_H */
diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c
index c20ec940a..52ba867cf 100644
--- a/hw/xnest/Cursor.c
+++ b/hw/xnest/Cursor.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Cursor.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Cursor.c,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -33,9 +33,8 @@ is" without express or implied warranty.
#include "Keyboard.h"
#include "Args.h"
-void xnestConstrainCursor(pScreen, pBox)
- ScreenPtr pScreen;
- BoxPtr pBox;
+void
+xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox)
{
#ifdef _XSERVER64
Window64 wroot;
@@ -71,18 +70,15 @@ void xnestConstrainCursor(pScreen, pBox)
}
}
-void xnestCursorLimits(pScreen, pCursor, pHotBox, pTopLeftBox)
- ScreenPtr pScreen;
- CursorPtr pCursor;
- BoxPtr pHotBox;
- BoxPtr pTopLeftBox;
+void
+xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
+ BoxPtr pTopLeftBox)
{
*pTopLeftBox = *pHotBox;
}
-Bool xnestDisplayCursor(pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
+Bool
+xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
XDefineCursor(xnestDisplay,
xnestDefaultWindows[pScreen->myNum],
@@ -90,9 +86,8 @@ Bool xnestDisplayCursor(pScreen, pCursor)
return True;
}
-Bool xnestRealizeCursor(pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
+Bool
+xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
XImage *ximage;
Pixmap source, mask;
@@ -171,19 +166,16 @@ Bool xnestRealizeCursor(pScreen, pCursor)
return True;
}
-Bool xnestUnrealizeCursor(pScreen, pCursor)
- ScreenPtr pScreen;
- CursorPtr pCursor;
+Bool
+xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
XFreeCursor(xnestDisplay, xnestCursor(pCursor, pScreen));
xfree(xnestCursorPriv(pCursor, pScreen));
return True;
}
-void xnestRecolorCursor(pScreen, pCursor, displayed)
- ScreenPtr pScreen;
- CursorPtr pCursor;
- Bool displayed;
+void
+xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed)
{
XColor fg_color, bg_color;
@@ -200,10 +192,8 @@ void xnestRecolorCursor(pScreen, pCursor, displayed)
&fg_color, &bg_color);
}
-Bool xnestSetCursorPosition(pScreen, x, y, generateEvent)
- ScreenPtr pScreen;
- int x, y;
- Bool generateEvent;
+Bool
+xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent)
{
int i;
diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
index d8cefcc6f..1a8703063 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Display.c,v 3.4 2001/10/28 03:34:10 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Display.c,v 3.5 2003/11/16 05:05:20 dawes Exp $ */
#include <X11/X.h>
@@ -51,14 +51,12 @@ XlibGC xnestBitmapGC;
Window xnestConfineWindow;
unsigned long xnestEventMask;
-void xnestOpenDisplay(argc, argv)
- int argc;
- char *argv[];
+void
+xnestOpenDisplay(int argc, char *argv[])
{
XVisualInfo vi;
long mask;
int i, j;
- extern Window xnestParentWindow;
if (!xnestDoFullGeneration) return;
@@ -183,7 +181,8 @@ void xnestOpenDisplay(argc, argv)
DefaultScreen(xnestDisplay)));
}
-void xnestCloseDisplay()
+void
+xnestCloseDisplay()
{
if (!xnestDoFullGeneration || !xnestDisplay) return;
diff --git a/hw/xnest/Display.h b/hw/xnest/Display.h
index 14ed0bb0a..044f8f131 100644
--- a/hw/xnest/Display.h
+++ b/hw/xnest/Display.h
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Display.h,v 1.6 2001/01/17 22:36:55 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Display.h,v 1.7 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTCOMMON_H
#define XNESTCOMMON_H
@@ -41,7 +41,7 @@ extern XlibGC xnestBitmapGC;
extern Window xnestConfineWindow;
extern unsigned long xnestEventMask;
-void xnestOpenDisplay();
-void xnestCloseDisplay();
+void xnestOpenDisplay(int argc, char *argv[]);
+void xnestCloseDisplay(void);
#endif /* XNESTCOMMON_H */
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 729296f22..1b7b3935f 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Events.c,v 1.2 2001/08/01 00:44:57 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Events.c,v 1.3 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#define NEED_EVENTS
@@ -28,6 +28,7 @@ is" without express or implied warranty.
#include "Xnest.h"
+#include "Args.h"
#include "Color.h"
#include "Display.h"
#include "Screen.h"
@@ -36,40 +37,40 @@ is" without express or implied warranty.
CARD32 lastEventTime = 0;
-void ProcessInputEvents()
+void
+ProcessInputEvents()
{
mieqProcessInputEvents();
}
-int TimeSinceLastInputEvent()
+int
+TimeSinceLastInputEvent()
{
if (lastEventTime == 0)
lastEventTime = GetTimeInMillis();
return GetTimeInMillis() - lastEventTime;
}
-void SetTimeSinceLastInputEvent()
+void
+SetTimeSinceLastInputEvent()
{
lastEventTime = GetTimeInMillis();
}
-static Bool xnestExposurePredicate(display, event, args)
- Display *display;
- XEvent *event;
- char *args;
+static Bool
+xnestExposurePredicate(Display *display, XEvent *event, char *args)
{
return (event->type == Expose || event->type == ProcessedExpose);
}
-static Bool xnestNotExposurePredicate(display, event, args)
- Display *display;
- XEvent *event;
- char *args;
+static Bool
+xnestNotExposurePredicate(Display *display, XEvent *event, char *args)
{
return !xnestExposurePredicate(display, event, args);
}
-void xnestCollectExposures()
+void
+xnestCollectExposures()
{
XEvent X;
WindowPtr pWin;
@@ -92,12 +93,12 @@ void xnestCollectExposures()
}
}
-void xnestCollectEvents()
+void
+xnestCollectEvents()
{
XEvent X;
xEvent x;
ScreenPtr pScreen;
- extern Window xnestParentWindow;
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
switch (X.type) {
diff --git a/hw/xnest/Events.h b/hw/xnest/Events.h
index dfb44acf5..ed0fbb830 100644
--- a/hw/xnest/Events.h
+++ b/hw/xnest/Events.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Events.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTEVENTS_H
#define XNESTEVENTS_H
@@ -22,7 +23,8 @@ is" without express or implied warranty.
extern CARD32 lastEventTime;
-void xnestCollectExposures();
-void xnestCollectEvents();
+void SetTimeSinceLastInputEvent(void);
+void xnestCollectExposures(void);
+void xnestCollectEvents(void);
#endif /* XNESTEVENTS_H */
diff --git a/hw/xnest/Font.c b/hw/xnest/Font.c
index b30cf45bf..f70848854 100644
--- a/hw/xnest/Font.c
+++ b/hw/xnest/Font.c
@@ -12,13 +12,13 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Font.c,v 3.5 2001/01/17 22:36:55 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Font.c,v 3.7 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xatom.h"
#include "Xproto.h"
#include "misc.h"
-#include "miscstruct.h"
+#include "regionstr.h"
#include "font.h"
#include "fontstruct.h"
#include "scrnintstr.h"
@@ -30,9 +30,8 @@ is" without express or implied warranty.
int xnestFontPrivateIndex;
-Bool xnestRealizeFont(pScreen, pFont)
- ScreenPtr pScreen;
- FontPtr pFont;
+Bool
+xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
{
pointer priv;
Atom name_atom, value_atom;
@@ -75,9 +74,8 @@ Bool xnestRealizeFont(pScreen, pFont)
}
-Bool xnestUnrealizeFont(pScreen, pFont)
- ScreenPtr pScreen;
- FontPtr pFont;
+Bool
+xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
{
if (xnestFontPriv(pFont)) {
if (xnestFontStruct(pFont))
diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c
index 0816957de..972849d9a 100644
--- a/hw/xnest/GC.c
+++ b/hw/xnest/GC.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/GC.c,v 3.6 2001/10/28 03:34:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/GC.c,v 3.7 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -68,8 +68,8 @@ static GCOps xnestOps = {
xnestPushPixels
};
-Bool xnestCreateGC(pGC)
- GCPtr pGC;
+Bool
+xnestCreateGC(GCPtr pGC)
{
pGC->clientClipType = CT_NONE;
pGC->clientClip = NULL;
@@ -87,18 +87,15 @@ Bool xnestCreateGC(pGC)
return True;
}
-void xnestValidateGC(pGC, changes, pDrawable)
- GCPtr pGC;
- unsigned long changes;
- DrawablePtr pDrawable;
+void
+xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
{
pGC->lastWinOrg.x = pDrawable->x;
pGC->lastWinOrg.y = pDrawable->y;
}
-void xnestChangeGC(pGC, mask)
- GC *pGC;
- unsigned long mask;
+void
+xnestChangeGC(GCPtr pGC, unsigned long mask)
{
XGCValues values;
@@ -182,25 +179,20 @@ void xnestChangeGC(pGC, mask)
XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values);
}
-void xnestCopyGC(pGCSrc, mask, pGCDst)
- GCPtr pGCSrc;
- unsigned long mask;
- GCPtr pGCDst;
+void
+xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
{
XCopyGC(xnestDisplay, xnestGC(pGCSrc), mask, xnestGC(pGCDst));
}
-void xnestDestroyGC(pGC)
- GC *pGC;
+void
+xnestDestroyGC(GCPtr pGC)
{
XFreeGC(xnestDisplay, xnestGC(pGC));
}
-void xnestChangeClip(pGC, type, pValue, nRects)
- GCPtr pGC;
- int type;
- pointer pValue;
- int nRects;
+void
+xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
{
int i, size;
BoxPtr pBox;
@@ -296,8 +288,8 @@ void xnestChangeClip(pGC, type, pValue, nRects)
xnestGCPriv(pGC)->nClipRects = nRects;
}
-void xnestDestroyClip(pGC)
- GCPtr pGC;
+void
+xnestDestroyClip(GCPtr pGC)
{
xnestDestroyClipHelper(pGC);
@@ -308,8 +300,8 @@ void xnestDestroyClip(pGC)
xnestGCPriv(pGC)->nClipRects = 0;
}
-void xnestDestroyClipHelper(pGC)
- GCPtr pGC;
+void
+xnestDestroyClipHelper(GCPtr pGC)
{
switch (pGC->clientClipType)
{
@@ -323,9 +315,8 @@ void xnestDestroyClipHelper(pGC)
}
}
-void xnestCopyClip(pGCDst, pGCSrc)
- GCPtr pGCSrc;
- GCPtr pGCDst;
+void
+xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
{
RegionPtr pRgn;
diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index 3af24c35a..b43695c96 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -12,11 +12,11 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.c,v 3.4 2001/01/17 22:36:55 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.c,v 3.6 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
-#include "miscstruct.h"
+#include "regionstr.h"
#include "fontstruct.h"
#include "gcstruct.h"
#include "scrnintstr.h"
@@ -35,45 +35,30 @@ is" without express or implied warranty.
#include "Drawable.h"
#include "Visual.h"
-void xnestFillSpans(pDrawable, pGC, nSpans, pPoints, pWidths, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nSpans;
- xPoint *pPoints;
- int *pWidths;
- int fSorted;
+void
+xnestFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans, xPoint *pPoints,
+ int *pWidths, int fSorted)
{
ErrorF("xnest warning: function xnestFillSpans not implemented\n");
}
-void xnestSetSpans(pDrawable, pGC, pSrc, pPoints, pWidths, nSpans, fSorted)
- DrawablePtr pDrawable;
- GCPtr pGC;
- unsigned char * pSrc;
- xPoint *pPoints;
- int *pWidths;
- int nSpans;
- int fSorted;
+void
+xnestSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc,
+ xPoint *pPoints, int *pWidths, int nSpans, int fSorted)
{
ErrorF("xnest warning: function xnestSetSpans not implemented\n");
}
-void xnestGetSpans(pDrawable, maxWidth, pPoints, pWidths, nSpans, pBuffer)
- DrawablePtr pDrawable;
- int maxWidth;
- xPoint *pPoints;
- int *pWidths;
- int nSpans;
- int *pBuffer;
+void
+xnestGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints,
+ int *pWidths, int nSpans, char *pBuffer)
{
ErrorF("xnest warning: function xnestGetSpans not implemented\n");
}
-void xnestQueryBestSize(class, pWidth, pHeight, pScreen)
- int class;
- short *pWidth;
- short *pHeight;
- ScreenPtr pScreen;
+void
+xnestQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
+ ScreenPtr pScreen)
{
unsigned int width, height;
@@ -88,13 +73,9 @@ void xnestQueryBestSize(class, pWidth, pHeight, pScreen)
*pHeight = height;
}
-void xnestPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pImage)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int depth, x, y, w, h;
- int leftPad;
- unsigned int format;
- unsigned char *pImage;
+void
+xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
+ int w, int h, int leftPad, int format, char *pImage)
{
XImage *ximage;
@@ -111,12 +92,10 @@ void xnestPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pImage)
}
}
-void xnestGetImage(pDrawable, x, y, w, h, format, planeMask, pImage)
- DrawablePtr pDrawable;
- int x, y, w, h;
- unsigned int format;
- unsigned long planeMask;
- unsigned char *pImage;
+void
+xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
+ unsigned int format, unsigned long planeMask,
+ char *pImage)
{
XImage *ximage;
int length;
@@ -133,16 +112,14 @@ void xnestGetImage(pDrawable, x, y, w, h, format, planeMask, pImage)
}
}
-static Bool xnestBitBlitPredicate(display, event, args)
- Display *display;
- XEvent *event;
- char *args;
+static Bool
+xnestBitBlitPredicate(Display *display, XEvent *event, char *args)
{
return (event->type == GraphicsExpose || event->type == NoExpose);
}
-RegionPtr xnestBitBlitHelper(pGC)
- GC *pGC;
+static RegionPtr
+xnestBitBlitHelper(GCPtr pGC)
{
if (!pGC->graphicsExposures)
return NullRegion;
@@ -183,14 +160,10 @@ RegionPtr xnestBitBlitHelper(pGC)
}
}
-RegionPtr xnestCopyArea(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
+RegionPtr
+xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
+ GCPtr pGC, int srcx, int srcy, int width, int height,
+ int dstx, int dsty)
{
XCopyArea(xnestDisplay,
xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable),
@@ -199,15 +172,10 @@ RegionPtr xnestCopyArea(pSrcDrawable, pDstDrawable,
return xnestBitBlitHelper(pGC);
}
-RegionPtr xnestCopyPlane(pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, plane)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- unsigned long plane;
+RegionPtr
+xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
+ GCPtr pGC, int srcx, int srcy, int width, int height,
+ int dstx, int dsty, unsigned long plane)
{
XCopyPlane(xnestDisplay,
xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable),
@@ -216,96 +184,71 @@ RegionPtr xnestCopyPlane(pSrcDrawable, pDstDrawable,
return xnestBitBlitHelper(pGC);
}
-void xnestPolyPoint(pDrawable, pGC, mode, nPoints, pPoints)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int nPoints;
- XPoint *pPoints;
+void
+xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+ DDXPointPtr pPoints)
{
XDrawPoints(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pPoints, nPoints, mode);
+ (XPoint *)pPoints, nPoints, mode);
}
-void xnestPolylines(pDrawable, pGC, mode, nPoints, pPoints)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int nPoints;
- XPoint *pPoints;
+void
+xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+ DDXPointPtr pPoints)
{
XDrawLines(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pPoints, nPoints, mode);
+ (XPoint *)pPoints, nPoints, mode);
}
-void xnestPolySegment(pDrawable, pGC, nSegments, pSegments)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nSegments;
- XSegment *pSegments;
+void
+xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
+ xSegment *pSegments)
{
XDrawSegments(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pSegments, nSegments);
+ (XSegment *)pSegments, nSegments);
}
-void xnestPolyRectangle(pDrawable, pGC, nRectangles, pRectangles)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nRectangles;
- XRectangle *pRectangles;
+void
+xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
+ xRectangle *pRectangles)
{
XDrawRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pRectangles, nRectangles);
+ (XRectangle *)pRectangles, nRectangles);
}
-void xnestPolyArc(pDrawable, pGC, nArcs, pArcs)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nArcs;
- XArc *pArcs;
+void
+xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
{
XDrawArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pArcs, nArcs);
+ (XArc *)pArcs, nArcs);
}
-void xnestFillPolygon(pDrawable, pGC, shape, mode, nPoints, pPoints)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int shape;
- int mode;
- int nPoints;
- XPoint *pPoints;
+void
+xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
+ int nPoints, DDXPointPtr pPoints)
{
XFillPolygon(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pPoints, nPoints, shape, mode);
+ (XPoint *)pPoints, nPoints, shape, mode);
}
-void xnestPolyFillRect(pDrawable, pGC, nRectangles, pRectangles)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nRectangles;
- XRectangle *pRectangles;
+void
+xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
+ xRectangle *pRectangles)
{
XFillRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pRectangles, nRectangles);
+ (XRectangle *)pRectangles, nRectangles);
}
-void xnestPolyFillArc(pDrawable, pGC, nArcs, pArcs)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int nArcs;
- XArc *pArcs;
+void
+xnestPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs)
{
XFillArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- pArcs, nArcs);
+ (XArc *)pArcs, nArcs);
}
-int xnestPolyText8(pDrawable, pGC, x, y, count, string)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- char *string;
+int
+xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ char *string)
{
int width;
@@ -317,73 +260,55 @@ int xnestPolyText8(pDrawable, pGC, x, y, count, string)
return width + x;
}
-int xnestPolyText16(pDrawable, pGC, x, y, count, string)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- XChar2b *string;
+int
+xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ unsigned short *string)
{
int width;
XDrawString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- x, y, string, count);
+ x, y, (XChar2b *)string, count);
- width = XTextWidth16(xnestFontStruct(pGC->font), string, count);
+ width = XTextWidth16(xnestFontStruct(pGC->font), (XChar2b *)string, count);
return width + x;
}
-void xnestImageText8(pDrawable, pGC, x, y, count, string)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- char *string;
+void
+xnestImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ char *string)
{
XDrawImageString(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
x, y, string, count);
}
-void xnestImageText16(pDrawable, pGC, x, y, count, string)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- int count;
- XChar2b *string;
+void
+xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ unsigned short *string)
{
XDrawImageString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
- x, y, string, count);
+ x, y, (XChar2b *)string, count);
}
-void xnestImageGlyphBlt(pDrawable, pGC, x, y, nGlyphs, pCharInfo, pGlyphBase)
- DrawablePtr pDrawable;
- GC pGC;
- int x, y;
- int nGlyphs;
- CharInfoPtr pCharInfo;
- char pGlyphBase;
+void
+xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
+ unsigned int nGlyphs, CharInfoPtr *pCharInfo,
+ pointer pGlyphBase)
{
ErrorF("xnest warning: function xnestImageGlyphBlt not implemented\n");
}
-void xnestPolyGlyphBlt(pDrawable, pGC, x, y, nGlyphs, pCharInfo, pGlyphBase)
- DrawablePtr pDrawable;
- GC pGC;
- int x, y;
- int nGlyphs;
- CharInfoPtr pCharInfo;
- char pGlyphBase;
+void
+xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
+ unsigned int nGlyphs, CharInfoPtr *pCharInfo,
+ pointer pGlyphBase)
{
ErrorF("xnest warning: function xnestPolyGlyphBlt not implemented\n");
}
-void xnestPushPixels(pDrawable, pGC, pBitmap, width, height, x, y)
- DrawablePtr pDrawable;
- GC pGC;
- PixmapPtr pBitmap;
- int width, height;
- int x, y;
+void
+xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
+ int width, int height, int x, int y)
{
ErrorF("xnest warning: function xnestPushPixels not implemented\n");
}
diff --git a/hw/xnest/GCOps.h b/hw/xnest/GCOps.h
index 3d4f3d2d4..722dde470 100644
--- a/hw/xnest/GCOps.h
+++ b/hw/xnest/GCOps.h
@@ -12,32 +12,59 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTGCOPS_H
#define XNESTGCOPS_H
-void xnestFillSpans();
-void xnestSetSpans();
-void xnestGetSpans();
-void xnestPutImage();
-void xnestGetImage();
-RegionPtr xnestCopyArea();
-RegionPtr xnestCopyPlane();
-void xnestQueryBestSize();
-void xnestPolyPoint();
-void xnestPolylines();
-void xnestPolySegment();
-void xnestPolyRectangle();
-void xnestPolyArc();
-void xnestFillPolygon();
-void xnestPolyFillRect();
-void xnestPolyFillArc();
-int xnestPolyText8();
-int xnestPolyText16();
-void xnestImageText8();
-void xnestImageText16();
-void xnestImageGlyphBlt();
-void xnestPolyGlyphBlt();
-void xnestPushPixels();
+void xnestFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans,
+ xPoint *pPoints, int *pWidths, int fSorted);
+void xnestSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc,
+ xPoint *pPoints, int *pWidths, int nSpans, int fSorted);
+void xnestGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints,
+ int *pWidths, int nSpans, char *pBuffer);
+void xnestQueryBestSize(int class, unsigned short *pWidth,
+ unsigned short *pHeight, ScreenPtr pScreen);
+void xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
+ int w, int h, int leftPad, int format, char *pImage);
+void xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
+ unsigned int format, unsigned long planeMask,
+ char *pImage);
+RegionPtr xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
+ GCPtr pGC, int srcx, int srcy, int width, int height,
+ int dstx, int dsty);
+RegionPtr xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
+ GCPtr pGC, int srcx, int srcy, int width, int height,
+ int dstx, int dsty, unsigned long plane);
+void xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+ DDXPointPtr pPoints);
+void xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+ DDXPointPtr pPoints);
+void xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
+ xSegment *pSegments);
+void xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
+ xRectangle *pRectangles);
+void xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs);
+void xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
+ int nPoints, DDXPointPtr pPoints);
+void xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
+ xRectangle *pRectangles);
+void xnestPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs);
+int xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ char *string);
+int xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ unsigned short *string);
+void xnestImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ char *string);
+void xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
+ unsigned short *string);
+void xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
+ unsigned int nGlyphs, CharInfoPtr *pCharInfo,
+ pointer pGlyphBase);
+void xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
+ unsigned int nGlyphs, CharInfoPtr *pCharInfo,
+ pointer pGlyphBase);
+void xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable,
+ int width, int height, int x, int y);
#endif /* XNESTGCOPS_H */
diff --git a/hw/xnest/GetTime.c b/hw/xnest/GetTime.c
index 5fdef2a12..3db9b8596 100644
--- a/hw/xnest/GetTime.c
+++ b/hw/xnest/GetTime.c
@@ -28,12 +28,14 @@ other dealings in this Software without prior written authorization
from the X Consortium.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/GetTime.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#include "Xos.h"
+#include "os.h"
#include <time.h>
-long
+CARD32
GetTimeInMillis()
{
struct timeval tp;
diff --git a/hw/xnest/Handlers.c b/hw/xnest/Handlers.c
index d65116b0d..693c7296b 100644
--- a/hw/xnest/Handlers.c
+++ b/hw/xnest/Handlers.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.c,v 1.2 2001/08/01 00:44:57 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.c,v 1.3 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -29,18 +29,15 @@ is" without express or implied warranty.
#include "Events.h"
#include "Handlers.h"
-void xnestBlockHandler(blockData, pTimeout, pReadMask)
- pointer blockData;
- pointer pTimeout;
- pointer pReadMask;
+void
+xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
{
xnestCollectExposures();
XFlush(xnestDisplay);
}
-void xnestWakeupHandler(result, pReadMask)
- int result;
- pointer pReadMask;
+void
+xnestWakeupHandler(pointer blockData, int result, pointer pReadMask)
{
xnestCollectEvents();
}
diff --git a/hw/xnest/Handlers.h b/hw/xnest/Handlers.h
index b33e9890d..ae92352d1 100644
--- a/hw/xnest/Handlers.h
+++ b/hw/xnest/Handlers.h
@@ -12,11 +12,13 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTHANDLERS_H
#define XNESTHANDLERS_H
-void xnestBlockHandler();
-void xnestWakeupHandler();
+void xnestBlockHandler(pointer blockData, OSTimePtr pTimeout,
+ pointer pReadMask);
+void xnestWakeupHandler(pointer blockData, int result, pointer pReadMask);
#endif /* XNESTHANDLERS_H */
diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
index 665aec182..6b3c4f19f 100644
--- a/hw/xnest/Init.c
+++ b/hw/xnest/Init.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Init.c,v 3.24 2003/01/15 02:34:14 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Init.c,v 3.25 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -37,13 +37,14 @@ is" without express or implied warranty.
#include "Drawable.h"
#include "XNGC.h"
#include "XNFont.h"
+#ifdef DPMSExtension
+#include "dpmsproc.h"
+#endif
Bool xnestDoFullGeneration = True;
-void InitOutput(screenInfo, argc, argv)
- ScreenInfo *screenInfo;
- int argc;
- char *argv[];
+void
+InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
{
int i, j;
@@ -83,9 +84,8 @@ void InitOutput(screenInfo, argc, argv)
xnestDoFullGeneration = xnestFullGeneration;
}
-void InitInput(argc, argv)
- int argc;
- char *argv[];
+void
+InitInput(int argc, char *argv[])
{
pointer ptr, kbd;
@@ -163,18 +163,19 @@ int SelectWaitTime = 10000; /* usec */
*
***************************************************************/
-void DPMSSet (level)
- int level;
+void
+DPMSSet(int level)
{
}
-int DPMSGet (level)
- int* level;
+int
+DPMSGet(int *level)
{
return -1;
}
-Bool DPMSSupported ()
+Bool
+DPMSSupported()
{
return FALSE;
}
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index 107caee90..eb9291878 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.8 2001/10/28 03:34:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.10 2003/11/16 05:05:20 dawes Exp $ */
#define NEED_EVENTS
#include "X.h"
@@ -36,31 +36,26 @@ is" without express or implied warranty.
#include <X11/extensions/XKBsrv.h>
#include <X11/extensions/XKBconfig.h>
-extern Bool XkbQueryExtension(
-#if NeedFunctionPrototypes
+extern Bool
+XkbQueryExtension(
Display * /* dpy */,
int * /* opcodeReturn */,
int * /* eventBaseReturn */,
int * /* errorBaseReturn */,
int * /* majorRtrn */,
int * /* minorRtrn */
-#endif
);
extern XkbDescPtr XkbGetKeyboard(
-#if NeedFunctionPrototypes
Display * /* dpy */,
unsigned int /* which */,
unsigned int /* deviceSpec */
-#endif
);
extern Status XkbGetControls(
-#if NeedFunctionPrototypes
Display * /* dpy */,
unsigned long /* which */,
XkbDescPtr /* desc */
-#endif
);
#ifndef XKB_BASE_DIRECTORY
@@ -85,21 +80,16 @@ extern Status XkbGetControls(
#define XKB_DFLT_KB_OPTIONS NULL
#endif
-extern Bool noXkbExtension;
#endif
-void xnestBell(volume, pDev, ctrl, cls)
- int volume;
- DeviceIntPtr pDev;
- pointer ctrl;
- int cls;
+void
+xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls)
{
XBell(xnestDisplay, volume);
}
-void xnestChangeKeyboardControl(pDev, ctrl)
- DeviceIntPtr pDev;
- KeybdCtrl *ctrl;
+void
+xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
{
#if 0
unsigned long value_mask;
@@ -136,10 +126,8 @@ void xnestChangeKeyboardControl(pDev, ctrl)
#endif
}
-int xnestKeyboardProc(pDev, onoff, argc, argv)
- DevicePtr pDev;
- int onoff, argc;
- char *argv[];
+int
+xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
{
XModifierKeymap *modifier_keymap;
KeySym *keymap;
@@ -202,7 +190,7 @@ XkbError:
memmove((char *) defaultKeyboardControl.autoRepeats,
(char *) values.auto_repeats, sizeof(values.auto_repeats));
- InitKeyboardDeviceStruct(pDev, &keySyms, modmap,
+ InitKeyboardDeviceStruct(&pDev->public, &keySyms, modmap,
xnestBell, xnestChangeKeyboardControl);
#ifdef XKB
} else {
@@ -260,9 +248,9 @@ XkbError:
}
XkbSetRulesDflts(rules, model, layout, variants, options);
- XkbInitKeyboardDeviceStruct((pointer)pDev, &names, &keySyms, modmap,
+ XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap,
xnestBell, xnestChangeKeyboardControl);
- XkbDDXChangeControls((pointer)pDev, xkb->ctrls, xkb->ctrls);
+ XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
XkbFreeKeyboard(xkb, 0, False);
}
#endif
@@ -288,9 +276,8 @@ XkbError:
return Success;
}
-Bool LegalModifier(key, pDev)
- unsigned int key;
- DevicePtr pDev;
+Bool
+LegalModifier(unsigned int key, DevicePtr pDev)
{
return TRUE;
}
diff --git a/hw/xnest/Keyboard.h b/hw/xnest/Keyboard.h
index 44feb300d..5f8dc3cb4 100644
--- a/hw/xnest/Keyboard.h
+++ b/hw/xnest/Keyboard.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTKEYBOARD_H
#define XNESTKEYBOARD_H
@@ -19,8 +20,8 @@ is" without express or implied warranty.
#define XNEST_KEYBOARD_EVENT_MASK \
(KeyPressMask | KeyReleaseMask | FocusChangeMask | KeymapStateMask)
-void xnestBell();
-void xnestChangeKeyboardControl();
-int xnestKeyboardProc();
+void xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls);
+void xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl);
+int xnestKeyboardProc(DeviceIntPtr pDev, int onoff);
#endif /* XNESTKEYBOARD_H */
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index f93dcac52..b82dfa49b 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -12,11 +12,11 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Pixmap.c,v 3.6 2003/01/10 13:29:40 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Pixmap.c,v 3.8 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
-#include "miscstruct.h"
+#include "regionstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
#include "regionstr.h"
@@ -34,11 +34,8 @@ is" without express or implied warranty.
int xnestPixmapPrivateIndex;
#endif
-PixmapPtr xnestCreatePixmap(pScreen, width, height, depth)
- ScreenPtr pScreen;
- int width;
- int height;
- int depth;
+PixmapPtr
+xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth)
{
PixmapPtr pPixmap;
@@ -75,8 +72,8 @@ PixmapPtr xnestCreatePixmap(pScreen, width, height, depth)
return pPixmap;
}
-Bool xnestDestroyPixmap(pPixmap)
- PixmapPtr pPixmap;
+Bool
+xnestDestroyPixmap(PixmapPtr pPixmap)
{
if(--pPixmap->refcnt)
return TRUE;
@@ -85,8 +82,8 @@ Bool xnestDestroyPixmap(pPixmap)
return TRUE;
}
-RegionPtr xnestPixmapToRegion(pPixmap)
- PixmapPtr pPixmap;
+RegionPtr
+xnestPixmapToRegion(PixmapPtr pPixmap)
{
XImage *ximage;
register RegionPtr pReg, pTmpReg;
diff --git a/hw/xnest/Pointer.c b/hw/xnest/Pointer.c
index 741989652..1af5f02ec 100644
--- a/hw/xnest/Pointer.c
+++ b/hw/xnest/Pointer.c
@@ -12,9 +12,12 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Pointer.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
+
#include "X.h"
#include "Xproto.h"
#include "screenint.h"
+#include "inputstr.h"
#include "input.h"
#include "misc.h"
#include "scrnintstr.h"
@@ -28,18 +31,15 @@ is" without express or implied warranty.
#include "Pointer.h"
#include "Args.h"
-void xnestChangePointerControl(pDev, ctrl)
- DeviceIntPtr pDev;
- PtrCtrl *ctrl;
+void
+xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
{
XChangePointerControl(xnestDisplay, True, True,
ctrl->num, ctrl->den, ctrl->threshold);
}
-int xnestPointerProc(pDev, onoff, argc, argv)
- DevicePtr pDev;
- int onoff, argc;
- char *argv[];
+int
+xnestPointerProc(DeviceIntPtr pDev, int onoff)
{
CARD8 map[MAXBUTTONS];
int nmap;
@@ -51,7 +51,7 @@ int xnestPointerProc(pDev, onoff, argc, argv)
nmap = XGetPointerMapping(xnestDisplay, map, MAXBUTTONS);
for (i = 0; i <= nmap; i++)
map[i] = i; /* buttons are already mapped */
- InitPointerDeviceStruct(pDev, map, nmap,
+ InitPointerDeviceStruct(&pDev->public, map, nmap,
miPointerGetMotionEvents,
xnestChangePointerControl,
miPointerGetMotionBufferSize());
diff --git a/hw/xnest/Pointer.h b/hw/xnest/Pointer.h
index 2fced12e2..0b06e5021 100644
--- a/hw/xnest/Pointer.h
+++ b/hw/xnest/Pointer.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Pointer.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTPOINTER_H
#define XNESTPOINTER_H
@@ -22,7 +23,7 @@ is" without express or implied warranty.
(ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \
EnterWindowMask | LeaveWindowMask)
-void xnestChangePointerControl();
-int xnestPointerProc();
+void xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl);
+int xnestPointerProc(DeviceIntPtr pDev, int onoff);
#endif /* XNESTPOINTER_H */
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index bef6a75dd..686884555 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.c,v 3.11 2003/01/10 13:29:40 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.c,v 3.13 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -20,6 +20,7 @@ is" without express or implied warranty.
#include "dix.h"
#include "mi.h"
#include "mibstore.h"
+#include "micmap.h"
#include "colormapst.h"
#include "resource.h"
@@ -39,17 +40,19 @@ is" without express or implied warranty.
#include "mipointer.h"
#include "Args.h"
-extern Window xnestParentWindow;
-
Window xnestDefaultWindows[MAXSCREENS];
Window xnestScreenSaverWindows[MAXSCREENS];
+#ifdef GLXEXT
+extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
+#endif
+
#ifdef PIXPRIV
int xnestScreenGeneration = -1;
#endif
-ScreenPtr xnestScreen(window)
- Window window;
+ScreenPtr
+xnestScreen(Window window)
{
int i;
@@ -60,8 +63,8 @@ ScreenPtr xnestScreen(window)
return NULL;
}
-static int offset(mask)
- unsigned long mask;
+static int
+offset(unsigned long mask)
{
int count;
@@ -71,9 +74,8 @@ static int offset(mask)
return count;
}
-static Bool xnestSaveScreen(pScreen, what)
- ScreenPtr pScreen;
- int what;
+static Bool
+xnestSaveScreen(ScreenPtr pScreen, int what)
{
if (xnestSoftwareScreenSaver)
return False;
@@ -105,17 +107,13 @@ static Bool xnestSaveScreen(pScreen, what)
}
static Bool
-xnestCursorOffScreen (ppScreen, x, y)
- ScreenPtr *ppScreen;
- int *x, *y;
+xnestCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
{
return FALSE;
}
static void
-xnestCrossScreen (pScreen, entering)
- ScreenPtr pScreen;
- Bool entering;
+xnestCrossScreen(ScreenPtr pScreen, Bool entering)
{
}
@@ -126,11 +124,8 @@ static miPointerScreenFuncRec xnestPointerCursorFuncs =
miPointerWarpCursor
};
-Bool xnestOpenScreen(index, pScreen, argc, argv)
- int index;
- register ScreenPtr pScreen;
- int argc;
- char *argv[];
+Bool
+xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
{
VisualPtr visuals;
DepthPtr depths;
@@ -140,6 +135,8 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
XSetWindowAttributes attributes;
XWindowAttributes gattributes;
XSizeHints sizeHints;
+ VisualID defaultVisual;
+ int rootDepth;
if (!(AllocateWindowPrivate(pScreen, xnestWindowPrivateIndex,
sizeof(xnestPrivWin)) &&
@@ -168,7 +165,6 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
numDepths = 1;
for (i = 0; i < xnestNumVisuals; i++) {
- visuals[numVisuals].vid = FakeClientID(0);
visuals[numVisuals].class = xnestVisuals[i].class;
visuals[numVisuals].bitsPerRGBValue = xnestVisuals[i].bits_per_rgb;
visuals[numVisuals].ColormapEntries = xnestVisuals[i].colormap_size;
@@ -179,7 +175,26 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
visuals[numVisuals].offsetRed = offset(xnestVisuals[i].red_mask);
visuals[numVisuals].offsetGreen = offset(xnestVisuals[i].green_mask);
visuals[numVisuals].offsetBlue = offset(xnestVisuals[i].blue_mask);
-
+
+ /* Check for and remove duplicates. */
+ for (j = 0; j < numVisuals; j++) {
+ if (visuals[numVisuals].class == visuals[j].class &&
+ visuals[numVisuals].bitsPerRGBValue == visuals[j].bitsPerRGBValue &&
+ visuals[numVisuals].ColormapEntries == visuals[j].ColormapEntries &&
+ visuals[numVisuals].nplanes == visuals[j].nplanes &&
+ visuals[numVisuals].redMask == visuals[j].redMask &&
+ visuals[numVisuals].greenMask == visuals[j].greenMask &&
+ visuals[numVisuals].blueMask == visuals[j].blueMask &&
+ visuals[numVisuals].offsetRed == visuals[j].offsetRed &&
+ visuals[numVisuals].offsetGreen == visuals[j].offsetGreen &&
+ visuals[numVisuals].offsetBlue == visuals[j].offsetBlue)
+ break;
+ }
+ if (j < numVisuals)
+ break;
+
+ visuals[numVisuals].vid = FakeClientID(0);
+
depthIndex = UNDEFINED;
for (j = 0; j < numDepths; j++)
if (depths[j].depth == xnestVisuals[i].depth) {
@@ -204,6 +219,21 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
numVisuals++;
}
+ visuals = (VisualPtr)xrealloc(visuals, numVisuals * sizeof(VisualRec));
+
+ defaultVisual = visuals[xnestDefaultVisualIndex].vid;
+ rootDepth = visuals[xnestDefaultVisualIndex].nplanes;
+
+#ifdef GLXEXT
+ {
+ miInitVisualsProcPtr proc = NULL;
+
+ GlxWrapInitVisuals(&proc);
+ /* GlxInitVisuals ignores the last three arguments. */
+ proc(&visuals, &depths, &numVisuals, &numDepths,
+ &rootDepth, &defaultVisual, 0, 0, 0);
+ }
+#endif
if (xnestParentWindow != 0) {
XGetWindowAttributes(xnestDisplay, xnestParentWindow, &gattributes);
@@ -214,9 +244,9 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
/* myNum */
/* id */
miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth,
- visuals[xnestDefaultVisualIndex].nplanes, /* rootDepth */
+ rootDepth,
numDepths, depths,
- visuals[xnestDefaultVisualIndex].vid, /* root visual */
+ defaultVisual, /* root visual */
numVisuals, visuals);
miInitializeBackingStore(pScreen);
@@ -257,8 +287,8 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
pScreen->SaveScreen = xnestSaveScreen;
pScreen->GetImage = xnestGetImage;
pScreen->GetSpans = xnestGetSpans;
- pScreen->PointerNonInterestBox = (void (*)()) 0;
- pScreen->SourceValidate = (void (*)()) 0;
+ pScreen->PointerNonInterestBox = NULL;
+ pScreen->SourceValidate = NULL;
/* Window Procedures */
@@ -268,7 +298,7 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
pScreen->ChangeWindowAttributes = xnestChangeWindowAttributes;
pScreen->RealizeWindow = xnestRealizeWindow;
pScreen->UnrealizeWindow = xnestUnrealizeWindow;
- pScreen->PostValidateTree = (void (*)()) 0;
+ pScreen->PostValidateTree = NULL;
pScreen->WindowExposures = xnestWindowExposures;
pScreen->PaintWindowBackground = xnestPaintWindowBackground;
pScreen->PaintWindowBorder = xnestPaintWindowBorder;
@@ -282,12 +312,12 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
/* Backing store procedures */
- pScreen->SaveDoomedAreas = (void (*)()) 0;
- pScreen->RestoreAreas = (RegionPtr (*)()) 0;
- pScreen->ExposeCopy = (void (*)()) 0;
- pScreen->TranslateBackingStore = (RegionPtr (*)()) 0;
- pScreen->ClearBackingStore = (RegionPtr (*)()) 0;
- pScreen->DrawGuarantee = (void (*)()) 0;
+ pScreen->SaveDoomedAreas = NULL;
+ pScreen->RestoreAreas = NULL;
+ pScreen->ExposeCopy = NULL;
+ pScreen->TranslateBackingStore = NULL;
+ pScreen->ClearBackingStore = NULL;
+ pScreen->DrawGuarantee = NULL;
/* Font procedures */
@@ -322,10 +352,10 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
/* OS layer procedures */
- pScreen->BlockHandler = (void (*)())NoopDDA;
- pScreen->WakeupHandler = (void (*)())NoopDDA;
- pScreen->blockData = (pointer)0;
- pScreen->wakeupData = (pointer)0;
+ pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA;
+ pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
+ pScreen->blockData = NULL;
+ pScreen->wakeupData = NULL;
if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL))
return FALSE;
@@ -397,9 +427,8 @@ Bool xnestOpenScreen(index, pScreen, argc, argv)
return True;
}
-Bool xnestCloseScreen(index, pScreen)
- int index;
- ScreenPtr pScreen;
+Bool
+xnestCloseScreen(int index, ScreenPtr pScreen)
{
int i;
diff --git a/hw/xnest/Screen.h b/hw/xnest/Screen.h
index 7c8115d8a..96260435b 100644
--- a/hw/xnest/Screen.h
+++ b/hw/xnest/Screen.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTSCREEN_H
#define XNESTSCREEN_H
@@ -19,8 +20,8 @@ is" without express or implied warranty.
extern Window xnestDefaultWindows[MAXSCREENS];
extern Window xnestScreenSaverWindows[MAXSCREENS];
-ScreenPtr xnestScreen();
-Bool xnestOpenScreen();
-Bool xnestCloseScreen();
+ScreenPtr xnestScreen(Window window);
+Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]);
+Bool xnestCloseScreen(int index, ScreenPtr pScreen);
#endif /* XNESTSCREEN_H */
diff --git a/hw/xnest/TestExt.c b/hw/xnest/TestExt.c
index 7f5a5907d..f153b5b2c 100644
--- a/hw/xnest/TestExt.c
+++ b/hw/xnest/TestExt.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/TestExt.c,v 3.5 2001/08/27 17:41:00 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/TestExt.c,v 3.6 2003/11/16 05:05:20 dawes Exp $ */
#include <X11/X.h>
#include <X11/Xproto.h>
@@ -26,12 +26,12 @@ is" without express or implied warranty.
#include "mipointer.h"
#define XTestSERVER_SIDE
#include "xtestext1.h"
+#include "xtest1dd.h"
extern CARD32 lastEventTime;
-void XTestGetPointerPos(fmousex, fmousey)
- short *fmousex;
- short *fmousey;
+void
+XTestGetPointerPos(short *fmousex, short *fmousey)
{
int x,y;
@@ -40,20 +40,15 @@ void XTestGetPointerPos(fmousex, fmousey)
*fmousey = y;
}
-void XTestJumpPointer(jx, jy, dev_type)
- int jx;
- int jy;
- int dev_type;
+void
+XTestJumpPointer(int jx, int jy, int dev_type)
{
miPointerAbsoluteCursor(jx, jy, GetTimeInMillis());
}
-void XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey)
- int dev_type;
- int keycode;
- int keystate;
- int mousex;
- int mousey;
+void
+XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex,
+ int mousey)
{
/*
xEvent tevent;
diff --git a/hw/xnest/Visual.c b/hw/xnest/Visual.c
index d512dba95..bcf7881eb 100644
--- a/hw/xnest/Visual.c
+++ b/hw/xnest/Visual.c
@@ -12,6 +12,8 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Visual.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
+
#include "X.h"
#include "Xproto.h"
#include "scrnintstr.h"
@@ -23,8 +25,8 @@ is" without express or implied warranty.
#include "Display.h"
#include "Visual.h"
-Visual *xnestVisual(pVisual)
- VisualPtr pVisual;
+Visual *
+xnestVisual(VisualPtr pVisual)
{
int i;
@@ -41,9 +43,8 @@ Visual *xnestVisual(pVisual)
return NULL;
}
-Visual *xnestVisualFromID(pScreen, visual)
- ScreenPtr pScreen;
- VisualID visual;
+Visual *
+xnestVisualFromID(ScreenPtr pScreen, VisualID visual)
{
int i;
@@ -54,8 +55,8 @@ Visual *xnestVisualFromID(pScreen, visual)
return NULL;
}
-Colormap xnestDefaultVisualColormap(visual)
- Visual *visual;
+Colormap
+xnestDefaultVisualColormap(Visual *visual)
{
int i;
diff --git a/hw/xnest/Visual.h b/hw/xnest/Visual.h
index 818393178..14e0085dc 100644
--- a/hw/xnest/Visual.h
+++ b/hw/xnest/Visual.h
@@ -12,13 +12,14 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/Visual.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTVISUAL_H
#define XNESTVISUAL_H
-Visual *xnestVisual();
-Visual *xnestVisualFromID();
-Colormap xnestDefaultVisualColormap();
+Visual *xnestVisual(VisualPtr pVisual);
+Visual *xnestVisualFromID(ScreenPtr pScreen, VisualID visual);
+Colormap xnestDefaultVisualColormap(Visual *visual);
#define xnestDefaultVisual(pScreen) \
xnestVisualFromID((pScreen), (pScreen)->rootVisual)
diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c
index a5dfc2de1..14ddac082 100644
--- a/hw/xnest/Window.c
+++ b/hw/xnest/Window.c
@@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/Window.c,v 3.7 2001/10/28 03:34:11 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/Window.c,v 3.8 2003/11/16 05:05:20 dawes Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -39,9 +39,8 @@ is" without express or implied warranty.
int xnestWindowPrivateIndex;
-static int xnestFindWindowMatch(pWin, ptr)
- WindowPtr pWin;
- pointer ptr;
+static int
+xnestFindWindowMatch(WindowPtr pWin, pointer ptr)
{
xnestWindowMatch *wm = (xnestWindowMatch *)ptr;
if (wm->window == xnestWindow(pWin)) {
@@ -52,8 +51,8 @@ static int xnestFindWindowMatch(pWin, ptr)
return WT_WALKCHILDREN;
}
-WindowPtr xnestWindowPtr(window)
- Window window;
+WindowPtr
+xnestWindowPtr(Window window)
{
xnestWindowMatch wm;
int i;
@@ -69,8 +68,8 @@ WindowPtr xnestWindowPtr(window)
return wm.pWin;
}
-Bool xnestCreateWindow(pWin)
- WindowPtr pWin;
+Bool
+xnestCreateWindow(WindowPtr pWin)
{
unsigned long mask;
XSetWindowAttributes attributes;
@@ -143,8 +142,8 @@ Bool xnestCreateWindow(pWin)
return True;
}
-Bool xnestDestroyWindow(pWin)
- WindowPtr pWin;
+Bool
+xnestDestroyWindow(WindowPtr pWin)
{
if (pWin->nextSib)
xnestWindowPriv(pWin->nextSib)->sibling_above =
@@ -164,9 +163,8 @@ Bool xnestDestroyWindow(pWin)
return True;
}
-Bool xnestPositionWindow(pWin, x, y)
- WindowPtr pWin;
- int x, y;
+Bool
+xnestPositionWindow(WindowPtr pWin, int x, int y)
{
xnestConfigureWindow(pWin,
CWParent |
@@ -177,9 +175,8 @@ Bool xnestPositionWindow(pWin, x, y)
return True;
}
-void xnestConfigureWindow(pWin, mask)
- WindowPtr pWin;
- unsigned int mask;
+void
+xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
{
unsigned int valuemask;
XWindowChanges values;
@@ -267,9 +264,8 @@ void xnestConfigureWindow(pWin, mask)
}
}
-Bool xnestChangeWindowAttributes(pWin, mask)
- WindowPtr pWin;
- unsigned long mask;
+Bool
+xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
{
XSetWindowAttributes attributes;
@@ -360,8 +356,8 @@ Bool xnestChangeWindowAttributes(pWin, mask)
return True;
}
-Bool xnestRealizeWindow(pWin)
- WindowPtr pWin;
+Bool
+xnestRealizeWindow(WindowPtr pWin)
{
xnestConfigureWindow(pWin, CWStackingOrder);
#ifdef SHAPE
@@ -372,18 +368,16 @@ Bool xnestRealizeWindow(pWin)
return True;
}
-Bool xnestUnrealizeWindow(pWin)
- WindowPtr pWin;
+Bool
+xnestUnrealizeWindow(WindowPtr pWin)
{
XUnmapWindow(xnestDisplay, xnestWindow(pWin));
return True;
}
-void xnestPaintWindowBackground(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
+void
+xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
{
int i;
BoxPtr pBox;
@@ -400,24 +394,19 @@ void xnestPaintWindowBackground(pWin, pRegion, what)
False);
}
-void xnestPaintWindowBorder(pWin, pRegion, what)
- WindowPtr pWin;
- RegionPtr pRegion;
- int what;
+void
+xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
{
xnestConfigureWindow(pWin, CWBorderWidth);
}
-void xnestCopyWindow(pWin, oldOrigin, oldRegion)
- WindowPtr pWin;
- xPoint oldOrigin;
- RegionPtr oldRegion;
+void
+xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion)
{
}
-void xnestClipNotify(pWin, dx, dy)
- WindowPtr pWin;
- int dx, dy;
+void
+xnestClipNotify(WindowPtr pWin, int dx, int dy)
{
xnestConfigureWindow(pWin, CWStackingOrder);
#ifdef SHAPE
@@ -425,17 +414,14 @@ void xnestClipNotify(pWin, dx, dy)
#endif /* SHAPE */
}
-static Bool xnestWindowExposurePredicate(display, event, ptr)
- Display *display;
- XEvent *event;
- XPointer ptr;
+static Bool
+xnestWindowExposurePredicate(Display *display, XEvent *event, XPointer ptr)
{
return (event->type == Expose && event->xexpose.window == *(Window *)ptr);
}
-void xnestWindowExposures(pWin, pRgn, other_exposed)
- WindowPtr pWin;
- RegionPtr pRgn, other_exposed;
+void
+xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
{
XEvent event;
Window window;
@@ -463,8 +449,8 @@ void xnestWindowExposures(pWin, pRgn, other_exposed)
}
#ifdef SHAPE
-static Bool xnestRegionEqual(pReg1, pReg2)
- RegionPtr pReg1, pReg2;
+static Bool
+xnestRegionEqual(RegionPtr pReg1, RegionPtr pReg2)
{
BoxPtr pBox1, pBox2;
unsigned int n1, n2;
@@ -488,8 +474,8 @@ static Bool xnestRegionEqual(pReg1, pReg2)
return True;
}
-void xnestShapeWindow(pWin)
- WindowPtr pWin;
+void
+xnestShapeWindow(WindowPtr pWin)
{
Region reg;
BoxPtr pBox;
diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h
index 5bf362e77..7d9426d72 100644
--- a/hw/xnest/XNCursor.h
+++ b/hw/xnest/XNCursor.h
@@ -12,7 +12,7 @@ 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/XNCursor.h,v 1.3 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTCURSOR_H
#define XNESTCURSOR_H
@@ -27,12 +27,14 @@ typedef struct {
#define xnestCursor(pCursor, pScreen) \
(xnestCursorPriv(pCursor, pScreen)->cursor)
-void xnestConstrainCursor();
-void xnestCursorLimits();
-Bool xnestDisplayCursor();
-Bool xnestRealizeCursor();
-Bool xnestUnrealizeCursor();
-void xnestRecolorCursor();
-Bool xnestSetCursorPosition();
+void xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox);
+void xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
+ BoxPtr pTopLeftBox);
+Bool xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
+Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
+Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
+void xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed);
+Bool xnestSetCursorPosition(ScreenPtr pScreen, int x, int y,
+ Bool generateEvent);
#endif /* XNESTCURSOR_H */
diff --git a/hw/xnest/XNFont.h b/hw/xnest/XNFont.h
index 2885517ac..34d236f3b 100644
--- a/hw/xnest/XNFont.h
+++ b/hw/xnest/XNFont.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/XNFont.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTFONT_H
@@ -30,7 +31,7 @@ extern int xnestFontPrivateIndex;
#define xnestFont(pFont) (xnestFontStruct(pFont)->fid)
-Bool xnestRealizeFont();
-Bool xnestUnrealizeFont();
+Bool xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont);
+Bool xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont);
#endif /* XNESTFONT_H */
diff --git a/hw/xnest/XNGC.h b/hw/xnest/XNGC.h
index fe2d77de3..bbec67120 100644
--- a/hw/xnest/XNGC.h
+++ b/hw/xnest/XNGC.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/XNGC.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTGC_H
#define XNESTGC_H
@@ -30,14 +31,14 @@ extern int xnestGCPrivateIndex;
#define xnestGC(pGC) (xnestGCPriv(pGC)->gc)
-Bool xnestCreateGC();
-void xnestValidateGC();
-void xnestChangeGC();
-void xnestCopyGC();
-void xnestDestroyGC();
-void xnestChangeClip();
-void xnestDestroyClip();
-void xnestDestroyClipHelper();
-void xnestCopyClip();
+Bool xnestCreateGC(GCPtr pGC);
+void xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
+void xnestChangeGC(GCPtr pGC, unsigned long mask);
+void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
+void xnestDestroyGC(GCPtr pGC);
+void xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects);
+void xnestDestroyClip(GCPtr pGC);
+void xnestDestroyClipHelper(GCPtr pGC);
+void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
#endif /* XNESTGC_H */
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
index 1657ae449..4e4d9c40c 100644
--- a/hw/xnest/XNPixmap.h
+++ b/hw/xnest/XNPixmap.h
@@ -12,7 +12,7 @@ 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/XNPixmap.h,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTPIXMAP_H
#define XNESTPIXMAP_H
@@ -37,8 +37,9 @@ typedef struct {
#define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++)
-PixmapPtr xnestCreatePixmap();
-Bool xnestDestroyPixmap();
-RegionPtr xnestPixmapToRegion();
+PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height,
+ int depth);
+Bool xnestDestroyPixmap(PixmapPtr pPixmap);
+RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
#endif /* XNESTPIXMAP_H */
diff --git a/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h
index 28d95941e..8b5f39115 100644
--- a/hw/xnest/XNWindow.h
+++ b/hw/xnest/XNWindow.h
@@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/XNWindow.h,v 1.4 2003/11/16 05:05:20 dawes Exp $ */
#ifndef XNESTWINDOW_H
#define XNESTWINDOW_H
@@ -57,23 +58,22 @@ extern int xnestWindowPrivateIndex;
#define CWParent CWSibling
#define CWStackingOrder CWStackMode
-extern WindowPtr *WindowTable;
-
-WindowPtr xnestWindowPtr();
-Bool xnestCreateWindow();
-Bool xnestDestroyWindow();
-Bool xnestPositionWindow();
-void xnestConfigureWindow();
-Bool xnestChangeWindowAttributes();
-Bool xnestRealizeWindow();
-Bool xnestUnrealizeWindow();
-void xnestPaintWindowBackground();
-void xnestPaintWindowBorder();
-void xnestCopyWindow();
-void xnestClipNotify();
-void xnestWindowExposures();
+WindowPtr xnestWindowPtr(Window window);
+Bool xnestCreateWindow(WindowPtr pWin);
+Bool xnestDestroyWindow(WindowPtr pWin);
+Bool xnestPositionWindow(WindowPtr pWin, int x, int y);
+void xnestConfigureWindow(WindowPtr pWin, unsigned int mask);
+Bool xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
+Bool xnestRealizeWindow(WindowPtr pWin);
+Bool xnestUnrealizeWindow(WindowPtr pWin);
+void xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what);
+void xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what);
+void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion);
+void xnestClipNotify(WindowPtr pWin, int dx, int dy);
+void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn,
+ RegionPtr other_exposed);
#ifdef SHAPE
-void xnestShapeWindow();
+void xnestShapeWindow(WindowPtr pWin);
#endif /* SHAPE */
#endif /* XNESTWINDOW_H */
diff --git a/hw/xnest/Xnest.man.pre b/hw/xnest/Xnest.man.pre
index 474569a47..488489189 100644
--- a/hw/xnest/Xnest.man.pre
+++ b/hw/xnest/Xnest.man.pre
@@ -25,7 +25,7 @@
.\" other dealings in this Software without prior written authorization
.\" from the X Consortium.
.\"
-.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.6 2001/01/27 18:21:00 dawes Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.7 2003/10/24 17:22:33 dawes Exp $
.\"
.TH XNEST 1 __xorgversion__
.SH NAME
@@ -102,7 +102,7 @@ saver is software generated since \fIXnest\fP does not control any
actual hardware. However, it is treated as a hardware screen saver
within the sample server code.
.TP 4
-.B \-geometry \fIW+H+X+Y\fP
+.B \-geometry \fIWxH+X+Y\fP
This option specifies geometry parameters for the top level
\fIXnest\fP windows. These windows corresponds to the root windows of
the nested server. The width and height specified with this option
diff --git a/hw/xnest/os2Stub.c b/hw/xnest/os2Stub.c
index b770f546f..15282d206 100644
--- a/hw/xnest/os2Stub.c
+++ b/hw/xnest/os2Stub.c
@@ -26,7 +26,7 @@
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xnest/os2Stub.c,v 3.1 2002/05/31 18:46:04 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xnest/os2Stub.c,v 3.2 2003/11/06 03:25:46 dawes Exp $ */
/* This below implements select() for calls in xnest. It has been */
/* somewhat optimized for improved performance, but assumes a few */
@@ -111,7 +111,7 @@ if(FirstTime){
}
rc = DosResetEventSem(hPipeSem, &postCount); */ /* Done in xtrans code for servers*/
-fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem);
+ /*fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem);*/
FirstTime = FALSE;
}
@@ -153,7 +153,7 @@ fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeS
}
else if (np == -1) { return(-1); }
while(!any_ready){
- rc = DosWaitEventSem(hPipeSem, timeout_ms);
+ rc = DosWaitEventSem(hPipeSem, 1L);
/* if(rc) fprintf(stderr,"Sem-wait timeout, rc = %d\n",rc); */
if(rc == 640) {
return(0);
@@ -191,7 +191,8 @@ fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeS
while (!any_ready && timeout_ms){
- rc = DosWaitEventSem(hPipeSem, 10L);
+ rc = DosWaitEventSem(hPipeSem, 1L);
+ if (rc==640) return(0);
if(rc == 0){
np = os2_check_pipes(&sd,readfds,writefds);
if(np > 0){
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index a9f69aad5..de84a7aee 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -26,9 +26,10 @@
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.12 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.13 2003/07/29 21:25:15 dawes Exp $ */
#include "win.h"
+#include "../../Xext/xf86miscproc.h"
CARD32 g_c32LastInputEventTime = 0;
@@ -117,6 +118,34 @@ InitInput (int argc, char *argv[])
AddEnabledDevice (g_fdMessageQueue);
}
+#if 0
+ {
+ MiscExtReturn ret;
+ pointer kbd;
+
+#if 0
+ if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
+ return BadAlloc;
+#else
+ kbd = MiscExtCreateStruct (MISC_KEYBOARD);
+#endif
+
+ MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, 0);
+ MiscExtSetKbdValue(kbd, MISC_KBD_RATE, 0);
+ MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, 0);
+ MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, 0);
+
+ switch ((ret = MiscExtApply (kbd, MISC_KEYBOARD)))
+ {
+ case MISC_RET_SUCCESS: break;
+ case MISC_RET_BADVAL:
+ case MISC_RET_BADKBDTYPE:
+ default:
+ ErrorF ("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret);
+ }
+ }
+#endif
+
#if CYGDEBUG
ErrorF ("InitInput - returning\n");
#endif
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index c434e58d1..3202ae8d9 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -26,11 +26,11 @@ 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.35 2003/10/08 11:13:02 eich Exp $ */
#include "win.h"
#include "winconfig.h"
-
+#include "winprefs.h"
/*
* General global variables
@@ -47,11 +47,16 @@ 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;
+HWND g_hDlgExit = NULL;
Bool g_fCalledSetLocale = FALSE;
+Bool g_fCalledXInitThreads = FALSE;
+int g_iLogVerbose = 4;
+char * g_pszLogFile = WIN_LOG_FNAME;
+Bool g_fLogInited = FALSE;
+const char * g_pszQueryHost = NULL;
/*
@@ -151,6 +156,7 @@ winInitializeDefaultScreens (void)
g_ScreenInfo[i].fClipboard = FALSE;
g_ScreenInfo[i].fLessPointer = FALSE;
g_ScreenInfo[i].fScrollbars = FALSE;
+ g_ScreenInfo[i].fNoTrayIcon = FALSE;
g_ScreenInfo[i].iE3BTimeout = WIN_E3B_OFF;
g_ScreenInfo[i].dwWidth_mm = (dwWidth / WIN_DEFAULT_DPI)
* 25.4;
@@ -177,6 +183,10 @@ ddxGiveUp()
ErrorF ("ddxGiveUp\n");
#endif
+ /* Notify the worker threads we're exiting */
+ winDeinitClipboard ();
+ winDeinitMultiWindowWM ();
+
/* Close our handle to our message queue */
if (g_fdMessageQueue != WIN_FD_INVALID)
{
@@ -187,15 +197,11 @@ ddxGiveUp()
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;
- }
+ if (!g_fLogInited) {
+ LogInit(g_pszLogFile, NULL);
+ g_fLogInited = TRUE;
+ }
+ LogClose();
/*
* At this point we aren't creating any new screens, so
@@ -239,12 +245,15 @@ 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
+ if (!g_fLogInited) {
+ LogInit(g_pszLogFile, NULL);
+ g_fLogInited = TRUE;
+ }
+ LogSetParameter(XLOG_FLUSH, 1);
+ LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose);
+
/* Add a default screen if no screens were specified */
if (g_iNumScreens == 0)
{
@@ -328,6 +337,12 @@ ddxUseMsg (void)
"\tMoreover, if the window has decorations, one can now resize\n"
"\tit.\n");
+ ErrorF ("-[no]trayicon\n"
+ "\tDo not create a tray icon. Default is to create one\n"
+ "\ticon per screen. You can globally disable tray icons with\n"
+ "\t-notrayicon, then enable it for specific screens with\n"
+ "\t-trayicon for those screens.\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"
@@ -393,10 +408,6 @@ ddxProcessArgument (int argc, char *argv[], int i)
* 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;
@@ -761,6 +772,8 @@ ddxProcessArgument (int argc, char *argv[], int i)
return 1;
}
+
+
/*
* Look for the '-clipboard' argument
*/
@@ -1106,6 +1119,58 @@ ddxProcessArgument (int argc, char *argv[], int i)
}
/*
+ * Look for the '-notrayicon' argument
+ */
+ if (strcmp (argv[i], "-notrayicon") == 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].fNoTrayIcon = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fNoTrayIcon = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-trayicon' argument
+ */
+ if (strcmp (argv[i], "-trayicon") == 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].fNoTrayIcon = FALSE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fNoTrayIcon = FALSE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
* Look for the '-fp' argument
*/
if (IS_OPTION ("-fp"))
@@ -1126,6 +1191,16 @@ ddxProcessArgument (int argc, char *argv[], int i)
}
/*
+ * Look for the '-query' argument
+ */
+ if (IS_OPTION ("-query"))
+ {
+ CHECK_ARGS (1);
+ g_pszQueryHost = argv[++i];
+ return 0; /* Let DIX parse this again */
+ }
+
+ /*
* Look for the '-xf86config' argument
*/
if (IS_OPTION ("-xf86config"))
@@ -1145,6 +1220,26 @@ ddxProcessArgument (int argc, char *argv[], int i)
return 2;
}
+ /*
+ * Look for the '-logfile' argument
+ */
+ if (IS_OPTION ("-logfile"))
+ {
+ CHECK_ARGS (1);
+ g_pszLogFile = argv[++i];
+ return 2;
+ }
+
+ /*
+ * Look for the '-logverbose' argument
+ */
+ if (IS_OPTION ("-logverbose"))
+ {
+ CHECK_ARGS (1);
+ g_iLogVerbose = atoi(argv[++i]);
+ return 2;
+ }
+
return 0;
}
@@ -1255,6 +1350,8 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
}
}
+ LoadPreferences();
+
#if CYGDEBUG || YES
ErrorF ("InitOutput - Returning.\n");
#endif
diff --git a/hw/xwin/XWin.man b/hw/xwin/XWin.man
index 09bdcd235..fe78047c4 100644
--- a/hw/xwin/XWin.man
+++ b/hw/xwin/XWin.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xwin/XWin.man,v 1.6 2002/10/17 08:18:21 alanh Exp $
+.\" $XFree86: xc/programs/Xserver/hw/xwin/XWin.man,v 1.7 2003/10/02 13:30:09 eich Exp $
.TH XWIN 1 __vendorversion__
.SH NAME
XWin \- X Server for the Cygwin environment on Microsoft Windows
@@ -87,7 +87,7 @@ Ctrl+Alt+Backspace exits the X Server
Alt+F4 exits the X Server
.SH "SEE ALSO"
.PP
-X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(5)
.SH BUGS
.I XWin
and this man page still have many limitations. Some of the more obvious
diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc
index 73533ba4e..7b5708af2 100644
--- a/hw/xwin/XWin.rc
+++ b/hw/xwin/XWin.rc
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/XWin.rc,v 1.1 2002/10/17 08:18:21 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/XWin.rc,v 1.2 2003/07/29 21:25:15 dawes Exp $ */
#include "resource.h"
@@ -36,8 +36,10 @@
* Dialogs
*/
+/* Depth_Change */
+
DEPTH_CHANGE_BOX DIALOG DISCARDABLE 32, 32, 180, 100
-STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTER
FONT 8, "MS Sans Serif"
CAPTION "Cygwin/XFree86"
BEGIN
@@ -48,10 +50,35 @@ BEGIN
END
+/* Exit */
+
+EXIT_DIALOG DIALOG DISCARDABLE 32, 32, 180, 70
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTER
+FONT 8, "MS Sans Serif"
+CAPTION "Cygwin/XFree86 - Exit?"
+BEGIN
+ PUSHBUTTON "E&xit", IDOK, 55, 48, 30, 14
+ DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 48, 30, 14
+ CTEXT "Exiting will close all screens running on this display.", IDC_STATIC, 7, 12, 166, 8
+ CTEXT "Proceed with shutdown of this display/server?", IDC_STATIC, 7, 24, 166, 8
+END
+
+
/*
* Menus
*/
+IDM_TRAYICON_MENU MENU DISCARDABLE
+BEGIN
+ POPUP "TRAYICON_MENU"
+ BEGIN
+ MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT
+ MENUITEM "&Show Root Window", ID_APP_SHOW_ROOT
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_APP_EXIT
+ END
+END
+
/*
* Icons
diff --git a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
new file mode 100644
index 000000000..dbd79f2bf
--- /dev/null
+++ b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
@@ -0,0 +1,105 @@
+# XWin Server Resource File - EXAMPLE
+# Earle F. Philhower, III
+
+# Place in ~/.XWinrc or in /usr/X11R6/lib/X11/system.XWinrc
+
+# Keywords are case insensitive, comments legal pretty much anywhere
+# you can have an end-of-line
+
+# Comments begin with "#" or "//" and go to the end-of-line
+
+# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc)
+
+# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons)
+
+# Menus are defined as...
+# MENU <name> {
+# <Menu Text> EXEC <command>
+# ^^ This command will have any "%display%"
+# string replaced with the proper display
+# variable (i.e. 127.0.0.1:<display>.0)
+# or <Menu Text> MENU <name-of-some-prior-defined-menu>
+# or <Menu Text> ALWAYSONTOP
+# ^^ Sets the window to display above all others
+# or <Menu Text> RELOAD
+# ^^ Causes ~/.XWinrc or the system.XWinrc file
+# to be reloaded and icons and menus regenerated
+# or SEPARATOR
+# ...
+# }
+
+# Set the taskmar menu with
+# ROOTMENU <name-of-some-prior-defined-menu>
+
+# If you want a menu to be applied to all popup window's system menu
+# DEFAULTSYSMENU <name-of-some-prior-defined-menu> <atstart|atend>
+
+# To choose a specific menu for a specific WM_CLASS or WM_NAME use ...
+# SYSMENU {
+# <class-or-name-of-window> <name-of-prior-defined-menu> <atstart|atend>
+# ...
+# }
+
+# To define where ICO files live (** Windows path**)
+# ICONDIRECTORY <windows-path i.e. c:\cygwin\usr\icons>
+
+# To define a replacement for the standard X icon for apps w/o specified icons
+# DEFAULTICON <name-of-windows-ico-file-in-icondirectory>
+
+# To define substitute icons on a per-window basis use...
+# ICONS {
+# <class-or-name-of-window> <icon-file-name.ico>
+# ...
+# }
+# In the case where multiple matches occur, the first listed in the ICONS
+# section will be chosen.
+
+# DEBUG <string> prints out the string to the XWin.log file
+
+// Below are just some silly menus to demonstrate writing your
+// own configuration file.
+
+// Make some menus...
+menu apps {
+ xterm exec "xterm"
+ "Emacs" exec "emacs"
+ notepad exec notepad
+ xload exec "xload -display %display%" # Comment
+}
+
+menu root {
+// Comments fit here, too...
+ "Reload .XWinrc" RELOAD
+ "Applications" menu apps
+ SEParATOR
+}
+
+menu aot {
+ Separator
+ "Always on Top" alwaysontop
+}
+
+menu xtermspecial {
+ "Emacs" exec "emacs"
+ "Always on Top" alwaysontop
+ SepArAtor
+}
+
+RootMenu root
+
+DefaultSysMenu aot atend
+
+SysMenu {
+ "xterm" xtermspecial atstart
+}
+
+# IconDirectory "c:\winnt\"
+
+# DefaultIcon "reinstall.ico"
+
+# Icons {
+# "xterm" "uninstall.ico"
+# }
+
+DEBUG "Done parsing the configuration file..."
+
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 684e98cc1..6ecf5ada0 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -31,7 +31,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.38 2003/10/08 11:13:02 eich Exp $ */
#ifndef _WIN_H_
#define _WIN_H_
@@ -93,8 +93,14 @@
| (1 << ( 8 - 1)))
#define WIN_CHECK_DEPTH YES
+/*
+ * Timer IDs for WM_TIMER
+ */
+#define WIN_E3B_TIMER_ID 1
+#define WIN_POLLING_MOUSE_TIMER_ID 2
+
+
#define WIN_E3B_OFF -1
-#define WIN_E3B_TIMER_ID 1
#define WIN_FD_INVALID -1
#define WIN_SERVER_NONE 0x0L /* 0 */
@@ -144,7 +150,6 @@
#include "pixmapstr.h"
#include "pixmap.h"
#include "region.h"
-#include "regionstr.h"
#include "gcstruct.h"
#include "colormap.h"
#include "colormapst.h"
@@ -184,6 +189,15 @@
/*
+ * Define Windows constants
+ */
+
+#define WM_TRAYICON (WM_USER + 1000)
+#define WM_INIT_SYS_MENU (WM_USER + 1001)
+#define WM_GIVEUP (WM_USER + 1002)
+
+
+/*
* Multi-Window Window Manager header
*/
@@ -222,7 +236,7 @@ if (fDebugProcMsg) \
#define DEBUG_MSG(str,...)
#endif
-#if CYGDEBUG || YES
+#if CYGDEBUG
#define DEBUG_FN_NAME(str) PTSTR szFunctionName = str
#else
#define DEBUG_FN_NAME(str)
@@ -387,6 +401,7 @@ typedef struct
Bool fClipboard;
Bool fLessPointer;
Bool fScrollbars;
+ Bool fNoTrayIcon;
int iE3BTimeout;
/* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */
Bool fUseWinKillKey;
@@ -422,6 +437,9 @@ typedef struct _winPrivScreenRec
DWORD dwModeKeyStates;
+ /* Handle to icons that must be freed */
+ HICON hiconNotifyIcon;
+
/* Clipboard support */
pthread_t ptClipboardProc;
@@ -482,7 +500,11 @@ typedef struct _winPrivScreenRec
/* Privates used by multi-window server */
pthread_t ptWMProc;
+ pthread_t ptXMsgProc;
void *pWMInfo;
+ Bool fWindowOrderChanged;
+ Bool fRestacking;
+ Bool fRootWindowShown;
/* Privates used for any module running in a seperate thread */
pthread_mutex_t pmServerStarted;
@@ -531,6 +553,12 @@ typedef struct _winPrivScreenRec
} winPrivScreenRec;
+typedef struct {
+ pointer value;
+ XID id;
+} WindowIDPairRec, *WindowIDPairPtr;
+
+
/*
* Extern declares for general global variables
*/
@@ -549,6 +577,10 @@ extern CARD32 g_c32LastInputEventTime;
extern DWORD g_dwEnginesSupported;
extern HINSTANCE g_hInstance;
extern HWND g_hDlgDepthChange;
+extern HWND g_hDlgExit;
+extern int g_copyROP[];
+extern int g_patternROP[];
+extern const char * g_pszQueryHost;
/*
@@ -703,6 +735,13 @@ winInitClipboard (pthread_t *ptClipboardProc,
pthread_mutex_t *ppmServerStarted,
DWORD dwScreen);
+/*
+ * winclipboardthread.c
+ */
+
+void
+winDeinitClipboard ();
+
/*
* wincmap.c
@@ -772,6 +811,18 @@ winCrossScreen (ScreenPtr pScreen, Bool fEntering);
/*
+ * windialogs.c
+ */
+
+void
+winDisplayExitDialog (winPrivScreenPtr pScreenPriv);
+
+
+void
+winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv);
+
+
+/*
* winengine.c
*/
@@ -1377,6 +1428,33 @@ winSetShapePRootless (WindowPtr pWindow);
/*
+ * winmultiwindowicons.c
+ */
+
+HICON
+winXIconToHICON (WindowPtr pWin);
+
+void
+winUpdateIcon (Window id);
+
+
+/*
+ * winmultiwindowshape.c
+ */
+
+#ifdef SHAPE
+void
+winReshapeMultiWindow (WindowPtr pWin);
+
+void
+winSetShapeMultiWindow (WindowPtr pWindow);
+
+void
+winUpdateRgnMultiWindow (WindowPtr pWindow);
+#endif
+
+
+/*
* winmultiwindowwindow.c
*/
@@ -1404,10 +1482,42 @@ winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent);
void
winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib);
-#ifdef SHAPE
void
-winSetShapeMultiWindow (WindowPtr pWindow);
-#endif
+winReorderWindowsMultiWindow (ScreenPtr pScreen);
+
+void
+winMoveXWindow (WindowPtr pWin, int x, int y);
+
+void
+winResizeXWindow (WindowPtr pWin, int w, int h);
+
+XID
+winGetWindowID (WindowPtr pWin);
+
+
+/*
+ * winmultiwindowwndproc.c
+ */
+
+LRESULT CALLBACK
+winTopLevelWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+
+/*
+ * wintrayicon.c
+ */
+
+void
+winInitNotifyIcon (winPrivScreenPtr pScreenPriv);
+
+void
+winDeleteNotifyIcon (winPrivScreenPtr pScreenPriv);
+
+LRESULT
+winHandleIconMessage (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam,
+ winPrivScreenPtr pScreenPriv);
/*
diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c
index 45d509fea..cc057eed6 100644
--- a/hw/xwin/winblock.c
+++ b/hw/xwin/winblock.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winblock.c,v 1.6 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winblock.c,v 1.7 2003/07/29 21:25:16 dawes Exp $ */
#include "win.h"
@@ -68,9 +68,13 @@ winBlockHandler_ProcessMessages:
/* Process all messages on our queue */
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
- if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ if ((g_hDlgDepthChange == 0
+ || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ && (g_hDlgExit == 0
+ || !IsDialogMessage (g_hDlgExit, &msg)))
{
DispatchMessage (&msg);
}
}
+ winReorderWindowsMultiWindow ((ScreenPtr)pBlockData);
}
diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
index 6e6cf44a9..8f9bae789 100644
--- a/hw/xwin/winclipboard.h
+++ b/hw/xwin/winclipboard.h
@@ -27,7 +27,7 @@
*
* Authors: Harold Hunt
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboard.h,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboard.h,v 1.3 2003/10/02 13:30:10 eich Exp $ */
#ifndef _WINCLIPBOARD_H_
@@ -119,6 +119,8 @@ winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength);
void *
winClipboardProc (void *pArg);
+void
+winDeinitClipboard ();
/*
* winclipboardunicode.c
diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c
index 22c068c48..a1f7b0b6d 100644
--- a/hw/xwin/winclipboardinit.c
+++ b/hw/xwin/winclipboardinit.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardinit.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardinit.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
#include "winclipboard.h"
diff --git a/hw/xwin/winclipboardtextconv.c b/hw/xwin/winclipboardtextconv.c
index f97681c5f..09ef40076 100644
--- a/hw/xwin/winclipboardtextconv.c
+++ b/hw/xwin/winclipboardtextconv.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardtextconv.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardtextconv.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
#include "win.h"
#include <stdio.h>
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index ce4590b98..06a985533 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardthread.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardthread.c,v 1.3 2003/10/02 13:30:10 eich Exp $ */
#include "winclipboard.h"
@@ -43,6 +43,7 @@ extern Bool g_fCalledSetLocale;
*/
static jmp_buf g_jmpEntry;
+static Bool g_shutdown = FALSE;
/*
@@ -79,7 +80,6 @@ winClipboardProc (void *pArg)
int iRetries;
Bool fUnicodeSupport;
char szDisplay[512];
- int i;
ClipboardProcArgPtr pProcArg = (ClipboardProcArgPtr) pArg;
ErrorF ("winClipboardProc - Hello\n");
@@ -93,7 +93,7 @@ winClipboardProc (void *pArg)
ErrorF ("winClipboardProc - Calling pthread_mutex_lock ()\n");
- /* Grab our garbage mutex to satisfy pthread_cond_wait */
+ /* Grab the server started mutex - pause until we get it */
iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
if (iReturn != 0)
{
@@ -129,11 +129,6 @@ winClipboardProc (void *pArg)
/* 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)
{
@@ -143,6 +138,11 @@ winClipboardProc (void *pArg)
ErrorF ("winClipboardProc - XInitThreads () returned.\n");
+ /* Release the server started mutex */
+ pthread_mutex_unlock (pProcArg->ppmServerStarted);
+
+ ErrorF ("winClipboardProc - pthread_mutex_unlock () returned.\n");
+
/* Set jump point for Error exits */
iReturn = setjmp (g_jmpEntry);
@@ -155,6 +155,12 @@ winClipboardProc (void *pArg)
iReturn);
pthread_exit (NULL);
}
+ else if (g_shutdown)
+ {
+ /* Shutting down, the X server severed out connection! */
+ ErrorF ("winClipboardProc - Detected shutdown in progress\n");
+ pthread_exit (NULL);
+ }
else if (iReturn == WIN_JMP_ERROR_IO)
{
ErrorF ("winClipboardProc - setjmp returned and hwnd: %08x\n", hwnd);
@@ -163,13 +169,12 @@ winClipboardProc (void *pArg)
/* 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
+ snprintf (szDisplay,
+ 512,
+ "127.0.0.1:%s.%d",
+ display,
+ (int) pProcArg->dwScreen);
/* Print the display connection string */
ErrorF ("winClipboardProc - DISPLAY=%s\n", szDisplay);
@@ -434,14 +439,18 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr)
sizeof (pszErrorMsg));
ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n", pszErrorMsg);
- if (pErr->error_code==BadWindow
- || pErr->error_code==BadMatch
- || pErr->error_code==BadDrawable)
+ if (pErr->error_code == BadWindow
+ || pErr->error_code == BadMatch
+ || pErr->error_code == BadDrawable)
{
+#if 0
pthread_exit (NULL);
+#endif
}
+#if 0
pthread_exit (NULL);
+#endif
return 0;
}
@@ -461,3 +470,15 @@ winClipboardIOErrorHandler (Display *pDisplay)
return 0;
}
+
+
+/*
+ * Notify the clipboard thread we're exiting and not to reconnect
+ */
+
+void
+winDeinitClipboard ()
+{
+ ErrorF ("winDeinitClipboard - Noting shutdown in progress\n");
+ g_shutdown = TRUE;
+}
diff --git a/hw/xwin/winclipboardunicode.c b/hw/xwin/winclipboardunicode.c
index fdbcb8e69..9eb2b0d87 100644
--- a/hw/xwin/winclipboardunicode.c
+++ b/hw/xwin/winclipboardunicode.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardunicode.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardunicode.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
#include "win.h"
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
index d27bb4861..c577d060e 100644
--- a/hw/xwin/winclipboardwndproc.c
+++ b/hw/xwin/winclipboardwndproc.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardwndproc.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardwndproc.c,v 1.2 2003/07/29 21:25:16 dawes Exp $ */
#include "winclipboard.h"
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index a09c7c185..8b3a56489 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardxevents.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardxevents.c,v 1.3 2003/10/02 13:30:10 eich Exp $ */
#include "winclipboard.h"
@@ -81,11 +81,12 @@ winClipboardFlushXEvents (HWND hwnd,
case ClientMessage:
if (event.xclient.data.l[0] == atomDeleteWindow)
{
- ErrorF ("\nReceived WM_DELETE_WINDOW\n\n");
+ ErrorF ("\nwinClipboardFlushXEvents - Received "
+ "WM_DELETE_WINDOW\n\n");
fReturn = FALSE;
}
else
- ErrorF ("\nUnknown ClientMessage\n\n");
+ ErrorF ("\nwinClipboardFlushXEvents - Unknown ClientMessage\n\n");
break;
case SelectionClear:
@@ -98,7 +99,8 @@ winClipboardFlushXEvents (HWND hwnd,
CurrentTime);
if (iReturn == BadAtom || iReturn == BadWindow)
{
- ErrorF ("SelectionClear - XConvertSelection () failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionClear - "
+ "XConvertSelection () failed\n");
pthread_exit (NULL);
}
break;
@@ -146,7 +148,8 @@ winClipboardFlushXEvents (HWND hwnd,
(XEvent *) &eventSelection);
if (iReturn == BadValue || iReturn == BadWindow)
{
- ErrorF ("SelectionRequest - XSendEvent () failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XSendEvent () failed\n");
pthread_exit (NULL);
}
@@ -176,7 +179,8 @@ winClipboardFlushXEvents (HWND hwnd,
|| iReturn == BadValue
|| iReturn == BadWindow)
{
- ErrorF ("SelectionRequest - XChangeProperty failed: %d\n",
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XChangeProperty failed: %d\n",
iReturn);
}
@@ -201,7 +205,8 @@ winClipboardFlushXEvents (HWND hwnd,
(XEvent *) &eventSelection);
if (iReturn == BadValue || iReturn == BadWindow)
{
- ErrorF ("SelectionRequest - XSendEvent () failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XSendEvent () failed\n");
}
break;
}
@@ -209,7 +214,8 @@ winClipboardFlushXEvents (HWND hwnd,
/* Access the clipboard */
if (!OpenClipboard (hwnd))
{
- ErrorF ("SelectionRequest - OpenClipboard () failed: %08x\n",
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "OpenClipboard () failed: %08x\n",
GetLastError ());
pthread_exit (NULL);
}
@@ -235,7 +241,8 @@ winClipboardFlushXEvents (HWND hwnd,
hGlobal = GetClipboardData (CF_TEXT);
if (!hGlobal)
{
- ErrorF ("SelectionRequest - GetClipboardData () failed: %08x\n",
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "GetClipboardData () failed: %08x\n",
GetLastError ());
pthread_exit (NULL);
}
@@ -283,8 +290,8 @@ winClipboardFlushXEvents (HWND hwnd,
&xtpText);
if (iReturn == XNoMemory || iReturn == XLocaleNotSupported)
{
- ErrorF ("SelectionRequest - Xutf8TextListToTextProperty "
- "failed: %d\n",
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "Xutf8TextListToTextProperty failed: %d\n",
iReturn);
exit(1);
}
@@ -324,7 +331,8 @@ winClipboardFlushXEvents (HWND hwnd,
|| iReturn == BadMatch || iReturn == BadValue
|| iReturn == BadWindow)
{
- ErrorF ("SelectionRequest - XChangeProperty failed: %d\n",
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XChangeProperty failed: %d\n",
iReturn);
pthread_exit (NULL);
}
@@ -359,7 +367,8 @@ winClipboardFlushXEvents (HWND hwnd,
(XEvent *) &eventSelection);
if (iReturn == BadValue || iReturn == BadWindow)
{
- ErrorF ("SelectionRequest - XSendEvent () failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionRequest - "
+ "XSendEvent () failed\n");
pthread_exit (NULL);
}
break;
@@ -379,7 +388,7 @@ winClipboardFlushXEvents (HWND hwnd,
pszAtomName = XGetAtomName (pDisplay,
event.xselection.selection);
- ErrorF ("SelectionNotify - ATOM: %s\n",
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - ATOM: %s\n",
pszAtomName);
XFree (pszAtomName);
@@ -406,13 +415,15 @@ winClipboardFlushXEvents (HWND hwnd,
if(event.xselection.target == XA_STRING)
{
#if 0
- ErrorF ("SelectionNotify XA_STRING\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "XA_STRING\n");
#endif
return fReturn;
}
else if (event.xselection.target == atomUTF8String)
{
- ErrorF ("SelectionNotify UTF8\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify "
+ "UTF8\n");
iReturn = XConvertSelection (pDisplay,
event.xselection.selection,
XA_STRING,
@@ -421,15 +432,16 @@ winClipboardFlushXEvents (HWND hwnd,
CurrentTime);
if (iReturn == BadAtom || iReturn == BadWindow)
{
- ErrorF ("SelectionNotify - XConvertSelection () "
- "failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify "
+ "- XConvertSelection () failed\n");
pthread_exit (NULL);
}
return fReturn;
}
else if (event.xselection.target == atomCompoundText)
{
- ErrorF ("SelectionNotify CompoundText\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify "
+ "CompoundText\n");
iReturn = XConvertSelection (pDisplay,
event.xselection.selection,
atomUTF8String,
@@ -438,15 +450,15 @@ winClipboardFlushXEvents (HWND hwnd,
CurrentTime);
if (iReturn == BadAtom || iReturn == BadWindow)
{
- ErrorF ("SelectionNotify - XConvertSelection () "
- "failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify "
+ "- XConvertSelection () failed\n");
pthread_exit (NULL);
}
return fReturn;
}
else
{
- ErrorF("Unknown format\n");
+ ErrorF ("winClipboardFlushXEvents - Unknown format\n");
return fReturn;
}
}
@@ -481,7 +493,8 @@ winClipboardFlushXEvents (HWND hwnd,
&pszReturnData);
if (iReturn != Success)
{
- ErrorF ("SelectionNotify - XGetWindowProperty () failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "XGetWindowProperty () failed\n");
pthread_exit (NULL);
}
@@ -523,7 +536,8 @@ winClipboardFlushXEvents (HWND hwnd,
&pszReturnData);
if (iReturn != Success)
{
- ErrorF ("SelectionNotify - XGetWindowProperty () failed\n");
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "XGetWindowProperty () failed\n");
pthread_exit (NULL);
}
@@ -591,14 +605,16 @@ winClipboardFlushXEvents (HWND hwnd,
/* Access the Windows clipboard */
if (!OpenClipboard (hwnd))
{
- ErrorF ("OpenClipboard () failed: %08x\n", GetLastError ());
+ ErrorF ("winClipboardFlushXEvents - OpenClipboard () failed: "
+ "%08x\n", GetLastError ());
pthread_exit (NULL);
}
/* Take ownership of the Window clipboard */
if (!EmptyClipboard ())
{
- ErrorF ("EmptyClipboard () failed: %08x\n", GetLastError ());
+ ErrorF ("winClipboardFlushXEvents - EmptyClipboard () failed: "
+ "%08x\n", GetLastError ());
pthread_exit (NULL);
}
@@ -613,7 +629,8 @@ winClipboardFlushXEvents (HWND hwnd,
pszGlobalData = GlobalLock (hGlobal);
if (pszGlobalData == NULL)
{
- ErrorF ("Could not lock global memory for clipboard transfer\n");
+ ErrorF ("winClipboardFlushXEvents - Could not lock global "
+ "memory for clipboard transfer\n");
pthread_exit (NULL);
}
@@ -655,7 +672,9 @@ winClipboardFlushXEvents (HWND hwnd,
/* Release the clipboard */
if (!CloseClipboard ())
{
- ErrorF ("CloseClipboard () failed: %08x\n", GetLastError ());
+ ErrorF ("winClipboardFlushXEvents - CloseClipboard () failed: "
+ "%08x\n",
+ GetLastError ());
pthread_exit (NULL);
}
@@ -669,8 +688,9 @@ winClipboardFlushXEvents (HWND hwnd,
pszAtomName = XGetAtomName (pDisplay,
event.xselection.selection);
- ErrorF ("SelectionNotify - Could not reassert ownership "
- "of selection ATOM: %s\n", pszAtomName);
+ ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
+ "Could not reassert ownership of selection ATOM: %s\n",
+ pszAtomName);
XFree (pszAtomName);
pszAtomName = NULL;
pthread_exit (NULL);
@@ -695,7 +715,8 @@ winClipboardFlushXEvents (HWND hwnd,
iWindow, CurrentTime);
if (iReturn == BadAtom || iReturn == BadWindow)
{
- ErrorF ("Could not reassert ownership of selection\n");
+ ErrorF ("winClipboardFlushXEvents - Could not reassert "
+ "ownership of selection\n");
pthread_exit (NULL);
}
#endif
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index bc336527c..b42b1d6bf 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -27,7 +27,7 @@
*
* Authors: Alexander Gottwald
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winconfig.c,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winconfig.c,v 1.4 2003/10/08 11:13:02 eich Exp $ */
#include "win.h"
#include "winconfig.h"
@@ -112,11 +112,10 @@ static Bool GetBoolValue (OptionInfoPtr p, const char *s);
Bool
winReadConfigfile ()
{
- Bool retval = TRUE;
- const char *filename;
-
- MessageType from = X_DEFAULT;
- char *xf86ConfigFile = NULL;
+ Bool retval = TRUE;
+ const char *filename;
+ MessageType from = X_DEFAULT;
+ char *xf86ConfigFile = NULL;
if (g_cmdline.configFile)
{
@@ -146,16 +145,7 @@ winReadConfigfile ()
}
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");
+ LogPrintMarkers();
/* set options from data structure */
@@ -213,9 +203,46 @@ winReadConfigfile ()
/* Set the keyboard configuration */
+typedef struct {
+ unsigned int winlayout;
+ int winkbtype;
+ char *xkbmodel;
+ char *xkblayout;
+ char *xkbvariant;
+ char *xkboptions;
+ char *layoutname;
+} WinKBLayoutRec, *WinKBLayoutPtr;
+
+WinKBLayoutRec winKBLayouts[] = {
+ { 0x405, -1, "pc105", "cz", NULL, NULL, "Czech"},
+ { 0x406, -1, "pc105", "dk", NULL, NULL, "Danish"},
+ { 0x407, -1, "pc105", "de", NULL, NULL, "German (Germany)"},
+ {0x10407, -1, "pc105", "de", NULL, NULL, "German (Germany, IBM)"},
+ { 0x807, -1, "pc105", "de_CH", NULL, NULL, "German (Switzerland)"},
+ {0x10409, -1, "pc105", "dvorak", NULL, NULL, "English (USA, Dvorak)"},
+ {0x20409, -1, "pc105", "us_intl", NULL, NULL, "English (USA, International)"},
+ { 0x809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"},
+ { 0x40a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain, Traditional Sort)"},
+ { 0x40b, -1, "pc105", "fi", NULL, NULL, "Finnish"},
+ { 0x40c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"},
+ { 0x80c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"},
+ { 0x410, -1, "pc105", "it", NULL, NULL, "Italian"},
+ { 0x411, -1, "jp", "jp", NULL, NULL, "Japanese"},
+ { 0x414, -1, "pc105", "no", NULL, NULL, "Norwegian"},
+ { 0x416, -1, "pc105", "pt", NULL, NULL, "Portuguese (Brazil, ABNT)"},
+ {0x10416, -1, "abnt2", "br", NULL, NULL, "Portuguese (Brazil, ABNT2)"},
+ { 0x816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"},
+ { 0x41d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"},
+ { -1, -1, NULL, NULL, NULL, NULL, NULL}
+};
+
+
Bool
winConfigKeyboard (DeviceIntPtr pDevice)
{
+ char layoutName[KL_NAMELENGTH];
+ unsigned int layoutNum;
+ int keyboardType;
XF86ConfInputPtr kbd = NULL;
XF86ConfInputPtr input_list = NULL;
MessageType from = X_DEFAULT;
@@ -237,6 +264,44 @@ winConfigKeyboard (DeviceIntPtr pDevice)
g_winInfo.xkb.variant = NULL;
g_winInfo.xkb.options = NULL;
# endif /* PC98 */
+
+
+
+ keyboardType = GetKeyboardType (0);
+ if (keyboardType > 0 && GetKeyboardLayoutName (layoutName))
+ {
+ WinKBLayoutPtr pLayout;
+
+ layoutNum = strtoul (layoutName, (char **)NULL, 16);
+ if ((layoutNum & 0xffff) == 0x411) {
+ /* The japanese layouts know a lot of different IMEs which all have
+ different layout numbers set. Map them to a single entry.
+ Same might apply for chinese, korean and other symbol languages
+ too */
+ layoutNum = (layoutNum & 0xffff);
+ }
+ winMsg (X_DEFAULT, "winConfigKeyboard - Layout: \"%s\" (%08x) \n",
+ layoutName, layoutNum);
+
+ for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++)
+ {
+ if (pLayout->winlayout != layoutNum)
+ continue;
+ if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
+ continue;
+
+ winMsg (X_DEFAULT,
+ "Using preset keyboard for \"%s\" (%s), type \"%d\"\n",
+ pLayout->layoutname, layoutName, keyboardType);
+
+ g_winInfo.xkb.model = pLayout->xkbmodel;
+ g_winInfo.xkb.layout = pLayout->xkblayout;
+ g_winInfo.xkb.variant = pLayout->xkbvariant;
+ g_winInfo.xkb.options = pLayout->xkboptions;
+ break;
+ }
+ }
+
g_winInfo.xkb.initialMap = NULL;
g_winInfo.xkb.keymap = NULL;
g_winInfo.xkb.types = NULL;
@@ -265,7 +330,7 @@ winConfigKeyboard (DeviceIntPtr pDevice)
{
/* Check if device name matches requested name */
if (g_cmdline.keyboard && winNameCompare (input_list->inp_identifier,
- g_cmdline.keyboard))
+ g_cmdline.keyboard))
continue;
kbd = input_list;
}
@@ -416,7 +481,7 @@ winConfigMouse (DeviceIntPtr pDevice)
{
/* Check if device name matches requested name */
if (g_cmdline.mouse && winNameCompare (input_list->inp_identifier,
- g_cmdline.mouse))
+ g_cmdline.mouse))
continue;
mouse = input_list;
}
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index 3c725f248..336131c8a 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/wincreatewnd.c,v 1.5 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wincreatewnd.c,v 1.7 2003/10/08 11:13:03 eich Exp $ */
#include "win.h"
#include "shellapi.h"
@@ -57,6 +57,7 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
int iHeight = pScreenInfo->dwHeight;
HWND *phwnd = &pScreenPriv->hwndScreen;
WNDCLASS wc;
+ char szTitle[256];
#if CYGDEBUG
ErrorF ("winCreateBoundingWindowFullScreen\n");
@@ -75,10 +76,23 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
wc.lpszClassName = WINDOW_CLASS;
RegisterClass (&wc);
+ /* Set display and screen-specific tooltip text */
+ if (g_pszQueryHost != NULL)
+ snprintf (szTitle,
+ sizeof (szTitle),
+ WINDOW_TITLE_XDMCP,
+ g_pszQueryHost);
+ else
+ snprintf (szTitle,
+ sizeof (szTitle),
+ WINDOW_TITLE,
+ display,
+ (int) pScreenInfo->dwScreen);
+
/* Create the window */
*phwnd = CreateWindowExA (WS_EX_TOPMOST, /* Extended styles */
WINDOW_CLASS, /* Class name */
- WINDOW_TITLE, /* Window name */
+ szTitle, /* Window name */
WS_POPUP,
0, /* Horizontal position */
0, /* Vertical position */
@@ -102,7 +116,7 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
ShowWindow (*phwnd, SW_SHOWNORMAL);
break;
}
-
+
/* Send first paint message */
UpdateWindow (*phwnd);
@@ -128,6 +142,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
WNDCLASS wc;
RECT rcClient, rcWorkArea;
DWORD dwWindowStyle;
+ char szTitle[256];
ErrorF ("winCreateBoundingWindowWindowed - User w: %d h: %d\n",
pScreenInfo->dwUserWidth, pScreenInfo->dwUserHeight);
@@ -267,10 +282,23 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
iWidth, iHeight);
#endif
+ /* Set display and screen-specific tooltip text */
+ if (g_pszQueryHost != NULL)
+ snprintf (szTitle,
+ sizeof (szTitle),
+ WINDOW_TITLE_XDMCP,
+ g_pszQueryHost);
+ else
+ snprintf (szTitle,
+ sizeof (szTitle),
+ WINDOW_TITLE,
+ display,
+ (int) pScreenInfo->dwScreen);
+
/* Create the window */
*phwnd = CreateWindowExA (0, /* Extended styles */
WINDOW_CLASS, /* Class name */
- WINDOW_TITLE, /* Window name */
+ szTitle, /* Window name */
dwWindowStyle,
rcWorkArea.left, /* Horizontal position */
rcWorkArea.top, /* Vertical position */
@@ -369,7 +397,10 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
/* Show the window */
if (pScreenInfo->fMultiWindow)
- ShowWindow (*phwnd, SW_SHOWMINNOACTIVE);
+ {
+ pScreenPriv->fRootWindowShown = FALSE;
+ ShowWindow (*phwnd, SW_HIDE);
+ }
else
ShowWindow (*phwnd, SW_SHOWNORMAL);
if (!UpdateWindow (*phwnd))
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index cd12bb632..e7c3ba7e7 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -30,7 +30,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wincursor.c,v 1.6 2003/07/29 21:25:17 dawes Exp $ */
#include "win.h"
@@ -47,6 +47,21 @@ winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
{
winScreenPriv(pScreen);
RECT rcClient;
+ static Bool s_fInitialWarp = TRUE;
+
+ /* Discard first warp call */
+ if (s_fInitialWarp)
+ {
+ /* First warp moves mouse to center of window, just ignore it */
+
+ /* Don't ignore subsequent warps */
+ s_fInitialWarp = FALSE;
+
+ ErrorF ("winPointerWarpCursor - Discarding first warp: %d %d\n",
+ x, y);
+
+ return;
+ }
/* Only update the Windows cursor position if we are active */
if (pScreenPriv->hwndScreen == GetForegroundWindow ())
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
new file mode 100755
index 000000000..d905ad81c
--- /dev/null
+++ b/hw/xwin/windialogs.c
@@ -0,0 +1,320 @@
+/*
+ *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/windialogs.c,v 1.1 2003/07/29 21:25:17 dawes Exp $ */
+
+#include "win.h"
+
+extern Bool g_fCursor;
+
+BOOL CALLBACK
+winExitDlgProc (HWND hDialog, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+BOOL CALLBACK
+winChangeDepthDlgProc (HWND hDialog, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+
+/*
+ * Display the Exit dialog box
+ */
+
+void
+winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
+{
+ /* Check if dialog already exists */
+ if (g_hDlgExit != NULL)
+ {
+ /* Dialog box already exists, display it */
+ ShowWindow (g_hDlgExit, SW_SHOWDEFAULT);
+
+ /* User has lost the dialog. Show them where it is. */
+ SetForegroundWindow (g_hDlgExit);
+
+ return;
+ }
+
+ /* Create dialog box */
+ g_hDlgExit = CreateDialogParam (g_hInstance,
+ "EXIT_DIALOG",
+ pScreenPriv->hwndScreen,
+ winExitDlgProc,
+ (int) pScreenPriv);
+
+ /* Drop minimize and maximize buttons */
+ SetWindowLong (g_hDlgExit, GWL_STYLE,
+ GetWindowLong (g_hDlgExit, GWL_STYLE)
+ & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
+ SetWindowLong (g_hDlgExit, GWL_EXSTYLE,
+ GetWindowLong (g_hDlgExit, GWL_EXSTYLE) & ~WS_EX_APPWINDOW );
+ SetWindowPos (g_hDlgExit, 0, 0, 0, 0, 0,
+ SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE);
+
+ /* Show the dialog box */
+ ShowWindow (g_hDlgExit, SW_SHOW);
+
+ /* Needed to get keyboard controls (tab, arrows, enter, esc) to work */
+ SetForegroundWindow (g_hDlgExit);
+
+ /* Set focus to the Cancel buton */
+ PostMessage (g_hDlgExit, WM_NEXTDLGCTL,
+ (int) GetDlgItem (g_hDlgExit, IDCANCEL), TRUE);
+}
+
+
+/*
+ * Exit dialog window procedure
+ */
+
+BOOL CALLBACK
+winExitDlgProc (HWND hDialog, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ static winPrivScreenPtr s_pScreenPriv = NULL;
+ static winScreenInfo *s_pScreenInfo = NULL;
+ static ScreenPtr s_pScreen = NULL;
+
+ /* Branch on message type */
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ /* Store pointers to private structures for future use */
+ s_pScreenPriv = (winPrivScreenPtr) lParam;
+ s_pScreenInfo = s_pScreenPriv->pScreenInfo;
+ s_pScreen = s_pScreenInfo->pScreen;
+
+ /* Set icon to standard app icon */
+ PostMessage (hDialog,
+ WM_SETICON,
+ ICON_SMALL,
+ (LPARAM) LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)));
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD (wParam))
+ {
+ case IDOK:
+ /* Send message to call the GiveUp function */
+ PostMessage (s_pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0);
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+
+ /* Fix to make sure keyboard focus isn't trapped */
+ PostMessage (s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
+ return TRUE;
+
+ case IDCANCEL:
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+
+ /* Fix to make sure keyboard focus isn't trapped */
+ PostMessage (s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
+ return TRUE;
+ }
+ break;
+
+ case WM_MOUSEMOVE:
+ case WM_NCMOUSEMOVE:
+ /* Show the cursor if it is hidden */
+ if (!g_fCursor)
+ {
+ g_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+ return TRUE;
+
+ case WM_CLOSE:
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+
+ /* Fix to make sure keyboard focus isn't trapped */
+ PostMessage (s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * Display the Depth Change dialog box
+ */
+
+void
+winDisplayDepthChangeDialog (winPrivScreenPtr pScreenPriv)
+{
+ /* Check if dialog already exists */
+ if (g_hDlgDepthChange != NULL)
+ {
+ /* Dialog box already exists, display it */
+ ShowWindow (g_hDlgDepthChange, SW_SHOWDEFAULT);
+
+ /* User has lost the dialog. Show them where it is. */
+ SetForegroundWindow (g_hDlgDepthChange);
+
+ return;
+ }
+
+ /*
+ * 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 (g_hInstance,
+ "DEPTH_CHANGE_BOX",
+ pScreenPriv->hwndScreen,
+ winChangeDepthDlgProc,
+ (int) pScreenPriv);
+
+ /* Drop minimize and maximize buttons */
+ SetWindowLong (g_hDlgDepthChange, GWL_STYLE,
+ GetWindowLong (g_hDlgDepthChange, GWL_STYLE)
+ & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
+ SetWindowLong (g_hDlgDepthChange, GWL_EXSTYLE,
+ GetWindowLong (g_hDlgDepthChange, GWL_EXSTYLE)
+ & ~WS_EX_APPWINDOW );
+ SetWindowPos (g_hDlgDepthChange, 0, 0, 0, 0, 0,
+ SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE);
+
+ /* Show the dialog box */
+ ShowWindow (g_hDlgDepthChange, SW_SHOW);
+
+ ErrorF ("winDisplayDepthChangeDialog - DialogBox returned: %d\n",
+ g_hDlgDepthChange);
+ ErrorF ("winDisplayDepthChangeDialog - GetLastError: %d\n", GetLastError ());
+
+ /* Minimize the display window */
+ ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
+}
+
+
+/*
+ * 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
+
+ /* Set icon to standard app icon */
+ PostMessage (hwndDialog,
+ WM_SETICON,
+ ICON_SMALL,
+ (LPARAM) LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN)));
+
+ 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;
+}
diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c
index aff90bdaf..d76e58628 100644
--- a/hw/xwin/winengine.c
+++ b/hw/xwin/winengine.c
@@ -27,12 +27,19 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winengine.c,v 1.4 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winengine.c,v 1.5 2003/07/29 21:25:17 dawes Exp $ */
#include "win.h"
/*
+ * External global variables
+ */
+
+extern const GUID _IID_IDirectDraw4;
+
+
+/*
* Detect engines supported by current Windows version
* DirectDraw version and hardware
*/
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index c18f10dde..8a1e0df85 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -27,29 +27,21 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winerror.c,v 1.4 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winerror.c,v 1.6 2003/10/02 13:30:10 eich 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);
+ LogVWrite(0, pszFormat, va_args);
/* Unlock the printing mutex */
pthread_mutex_unlock (&s_pmPrinting);
diff --git a/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c
index faf9c67fc..9ac536274 100644
--- a/hw/xwin/winfillsp.c
+++ b/hw/xwin/winfillsp.c
@@ -26,11 +26,27 @@
*from the XFree86 Project.
*
* Authors: Harold L Hunt II
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winfillsp.c,v 1.9 2001/11/01 12:19:40 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winfillsp.c,v 1.10 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
+extern void ROP16(HDC hdc, int rop);
+
+#define TRANSLATE_COLOR(color) \
+{ \
+ if (pDrawable->depth == 15) \
+ color = ((color & 0x1F) << 19) | ((color & 0x03E0) << 6) | \
+ ((color & 0xF800) >> 8); \
+ else if (pDrawable->depth == 16) \
+ color = ((color & 0x1F) << 19) | ((color & 0x07E0) << 5) | \
+ ((color & 0xF800) >> 8); \
+ else if (pDrawable->depth == 24 || pDrawable->depth == 32) \
+ color = ((color & 0xFF) << 16) | (color & 0xFF00) | \
+ ((color & 0xFF0000) >> 16); \
+}
+
/* See Porting Layer Definition - p. 54 */
void
winFillSpansNativeGDI (DrawablePtr pDrawable,
@@ -41,87 +57,57 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
int fSorted)
{
winGCPriv(pGC);
- int iSpan;
- DDXPointPtr pPoint = NULL;
- int *piWidth = 0;
HBITMAP hbmpOrig = NULL, hbmpOrigStipple = NULL;
+ HBITMAP hPenOrig = NULL;
+ HBITMAP hBitmap = 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;
+ HDC hdcStipple = NULL, hdcTile = NULL;
+ HPEN hPen = NULL;
int iX;
- DEBUG_FN_NAME("winFillSpans");
- DEBUGVARS;
- DEBUGPROC_MSG;
+ int fg, bg;
+ RegionPtr pClip = pGC->pCompositeClip;
+ BoxPtr pextent, pbox;
+ int nbox;
+ int extentX1, extentX2, extentY1, extentY2;
+ int fullX1, fullX2, fullY1;
+ HRGN hrgn = NULL, combined = NULL;
+
+ nbox = REGION_NUM_RECTS (pClip);
+ pbox = REGION_RECTS (pClip);
+
+ if (!nbox) return;
+
+ combined = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
+ nbox--; pbox++;
+
+ while (nbox--)
+ {
+ hrgn = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
+ CombineRgn (combined, combined, hrgn, RGN_OR);
+ DeleteObject (hrgn);
+ hrgn = NULL;
+ pbox++;
+ }
+
+ pextent = REGION_EXTENTS (pGC->pScreen, pClip);
+ extentX1 = pextent->x1;
+ extentY1 = pextent->y1;
+ extentX2 = pextent->x2;
+ extentY2 = pextent->y2;
/* 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
+
+ SelectClipRgn (pGCPriv->hdcMem, combined);
+ DeleteObject (combined);
+ combined = NULL;
/* Get a pixmap pointer from the drawable pointer, and fetch privates */
pPixmap = (PixmapPtr) pDrawable;
@@ -131,268 +117,639 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
hbmpOrig = SelectObject (pGCPriv->hdcMem, pPixmapPriv->hBitmap);
if (hbmpOrig == NULL)
FatalError ("winFillSpans - DRAWABLE_PIXMAP - "
- "SelectObject () failed on pPixmapPriv->hBitmap\n");
+ "SelectObject () failed on\n\tpPixmapPriv->hBitmap: "
+ "%08x\n", pPixmapPriv->hBitmap);
/* 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)
+
+ ROP16 (pGCPriv->hdcMem, pGC->alu);
+
+ if (pDrawable->depth == 1)
{
- /* 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);
+ if (pGC->fgPixel == 0)
+ hPenOrig = SelectObject (pGCPriv->hdcMem,
+ GetStockObject (BLACK_PEN));
+ else
+ hPenOrig = SelectObject (pGCPriv->hdcMem,
+ GetStockObject (WHITE_PEN));
+ }
+ else
+ {
+ fg = pGC->fgPixel;
+ TRANSLATE_COLOR (fg);
+ hPen = CreatePen (PS_SOLID, 0, fg);
+ hPenOrig = SelectObject (pGCPriv->hdcMem, hPen);
+ }
+
+ while (iSpans--)
+ {
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ MoveToEx (pGCPriv->hdcMem, fullX1, fullY1, NULL);
+ LineTo (pGCPriv->hdcMem, fullX2, fullY1);
}
- /*
- * 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;
+ SetROP2 (pGCPriv->hdcMem, R2_COPYPEN);
- case FillStippled:
- ErrorF ("winFillSpans - DRAWABLE_PIXMAP - FillStippled %08x\n",
- pDrawable);
+ /* Give back the Pen */
+ SelectObject (pGCPriv->hdcMem, hPenOrig);
- /*
- * FIXME: Assuming that pGC->patOrg.x = pGC->patOrg.y = 0
- */
+ if (pDrawable->depth != 1)
+ DeleteObject (hPen);
+ break;
+
+ case FillOpaqueStippled:
pStipple = pGC->stipple;
pStipplePriv = winGetPixmapPriv (pStipple);
- /* Create a memory DC to hold the stipple */
- hdcStipple = CreateCompatibleDC (pGCPriv->hdc);
+ /* Create a device-dependent bitmap for the stipple */
+ hBitmap = CreateDIBitmap (pGCPriv->hdcMem,
+ (BITMAPINFOHEADER *)pStipplePriv->pbmih,
+ CBM_INIT,
+ pStipplePriv->pbBits,
+ (BITMAPINFO *)pStipplePriv->pbmih,
+ DIB_RGB_COLORS);
- /* Create a destination sized compatible bitmap */
- hbmpFilledStipple = winCreateDIBNativeGDI (pDrawable->width,
- pDrawable->height,
- pDrawable->depth,
- &pbbitsFilledStipple,
- NULL);
+ /* Create a memory DC to hold the stipple */
+ hdcStipple = CreateCompatibleDC (pGCPriv->hdcMem);
/* Select the stipple bitmap into the stipple DC */
- hbmpOrigStipple = SelectObject (hdcStipple, hbmpFilledStipple);
+ hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
if (hbmpOrigStipple == NULL)
FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
- "SelectObject () failed on hbmpFilledStipple\n");
+ "SelectObject () failed on hbmpOrigStipple\n");
- /* Create a pattern brush from the original stipple */
- hbrushStipple = CreatePatternBrush (pStipplePriv->hBitmap);
+ /* Make a temporary copy of the foreground and background colors */
+ bg = pGC->bgPixel;
+ fg = pGC->fgPixel;
- /* Select the original stipple brush into the stipple DC */
- SelectObject (hdcStipple, hbrushStipple);
+ /* Translate the depth-dependent colors to Win32 COLORREFs */
+ TRANSLATE_COLOR (fg);
+ TRANSLATE_COLOR (bg);
+ SetTextColor (pGCPriv->hdcMem, fg);
+ SetBkColor (pGCPriv->hdcMem, bg);
- /* PatBlt the original stipple to the filled stipple */
- PatBlt (hdcStipple,
- 0, 0,
- pDrawable->width, pDrawable->height,
- PATCOPY);
+ while (iSpans--)
+ {
+ int width = pStipple->drawable.width;
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ for (iX = fullX1; iX < fullX2; iX += width)
+ {
+ int xoffset;
+
+ if ((iX + pStipple->drawable.width) > fullX2)
+ width = fullX2 - iX;
+ else
+ width = pStipple->drawable.width;
+
+ if (iX == fullX1)
+ xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
+ else
+ xoffset = 0;
+
+ if (xoffset + width > pStipple->drawable.width)
+ width = pStipple->drawable.width - xoffset;
+
+ BitBlt (pGCPriv->hdcMem,
+ iX, fullY1,
+ width, 1,
+ hdcStipple,
+ xoffset,
+ (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
+ g_copyROP[pGC->alu]);
+ }
+ }
- /*
- * 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)
+ /* Clear the stipple HDC */
+ SelectObject (hdcStipple, hbmpOrigStipple);
+ DeleteDC (hdcStipple);
+
+ /* Delete the device dependent stipple bitmap */
+ DeleteObject (hBitmap);
+
+ break;
+ case FillStippled:
+
+ pStipple = pGC->stipple;
+ pStipplePriv = winGetPixmapPriv (pStipple);
+
+ /* Create a device-dependent bitmap for the stipple */
+ hBitmap = CreateDIBitmap (pGCPriv->hdcMem,
+ (BITMAPINFOHEADER *)pStipplePriv->pbmih,
+ CBM_INIT,
+ pStipplePriv->pbBits,
+ (BITMAPINFO *)pStipplePriv->pbmih,
+ DIB_RGB_COLORS);
+
+ /* Create a memory DC to hold the stipple */
+ hdcStipple = CreateCompatibleDC (pGCPriv->hdcMem);
+
+ /* Select the stipple bitmap into the stipple DC */
+ hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
+ if (hbmpOrigStipple == 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.
+ "SelectObject () failed on hbmpOrigStipple\n");
+
+ /* Make a temporary copy of the foreground and background colors */
+ bg = pGC->bgPixel;
+ fg = pGC->fgPixel;
+
+ /* Translate the depth-dependent colors to Win32 COLORREFs */
+ TRANSLATE_COLOR (fg);
+ TRANSLATE_COLOR (bg);
+
+ /* this is fudgy, we should only invert on the last one
+ * We need to get the black/white pixels right in the
+ * colormap. But yeah ! it's working..
*/
- 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));
+ if (pGC->bgPixel != -1 && pGC->fgPixel != -1)
+ {
+ SetTextColor (pGCPriv->hdcMem, fg);
+ SetBkColor (pGCPriv->hdcMem, bg);
+ BitBlt (hdcStipple,
+ 0, 0,
+ pStipple->drawable.width, pStipple->drawable.height,
+ hdcStipple,
+ 0, 0,
+ 0x330008);
+ }
+ else if (pGC->bgPixel == -1)
+ {
+ SetTextColor (pGCPriv->hdcMem, fg);
+ SetBkMode (pGCPriv->hdcMem, TRANSPARENT);
+ BitBlt (hdcStipple,
+ 0, 0,
+ pStipple->drawable.width, pStipple->drawable.height,
+ hdcStipple,
+ 0, 0,
+ 0x330008);
+ }
+ else if (pGC->fgPixel == -1)
+ {
+ SetTextColor (pGCPriv->hdcMem, bg);
+ SetBkMode (pGCPriv->hdcMem, TRANSPARENT);
+#if 0
+ BitBlt (hdcStipple,
+ 0, 0,
+ pStipple->drawable.width, pStipple->drawable.height,
+ hdcStipple,
+ 0, 0,
+ 0x330008);
+#endif
+ }
- /* Destroy the original stipple pattern brush */
- DeleteObject (hbrushStipple);
+ while (iSpans--)
+ {
+ int width = pStipple->drawable.width;
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ for (iX = fullX1; iX < fullX2; iX += width)
+ {
+ int xoffset;
+
+ if ((iX + pStipple->drawable.width) > fullX2)
+ width = fullX2 - iX;
+ else
+ width = pStipple->drawable.width;
+
+ if (iX == fullX1)
+ xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
+ else
+ xoffset = 0;
+
+ if (xoffset + width > pStipple->drawable.width)
+ width = pStipple->drawable.width - xoffset;
+
+ BitBlt (pGCPriv->hdcMem,
+ iX, fullY1,
+ width, 1,
+ hdcStipple,
+ xoffset,
+ (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
+ g_copyROP[pGC->alu]);
+ }
+ }
- /* Clear the memory DC */
- SelectObject (pGCPriv->hdcMem, hbmpOrig);
+ /* Clear the stipple HDC */
+ SelectObject (hdcStipple, hbmpOrigStipple);
+ DeleteDC (hdcStipple);
- /* Free the masked foreground bitmap */
- DeleteObject (hbmpMaskedForeground);
+ /* Delete the device dependent stipple bitmap */
+ DeleteObject (hBitmap);
- /* Point the drawable to the new bitmap */
- pPixmapPriv->hBitmap = hbmpFilledStipple;
- pPixmapPriv->pbBits = pbbitsFilledStipple;
+ /* Restore the background mode */
+ SetBkMode (pGCPriv->hdcMem, OPAQUE);
break;
case FillTiled:
- FatalError ("\nwinFillSpans - DRAWABLE_PIXMAP - FillTiled\n\n");
- break;
- case FillOpaqueStippled:
- FatalError ("winFillSpans - DRAWABLE_PIXMAP - OpaqueStippled\n");
+ /* Get a pixmap pointer from the tile pointer, and fetch privates */
+ pTile = (PixmapPtr) pGC->tile.pixmap;
+ pTilePriv = winGetPixmapPriv (pTile);
+
+ /* Create a memory DC to hold the tile */
+ hdcTile = CreateCompatibleDC (pGCPriv->hdcMem);
+
+ /* Select the tile into a DC */
+ hbmpOrig = SelectObject (hdcTile, pTilePriv->hBitmap);
+ if (hbmpOrig == NULL)
+ FatalError ("winFillSpans - DRAWABLE_PIXMAP - FillTiled - "
+ "SelectObject () failed on pTilePriv->hBitmap\n");
+
+ while (iSpans--)
+ {
+ int width = pTile->drawable.width;
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ for (iX = fullX1; iX < fullX2; iX += width)
+ {
+ int xoffset;
+
+ if ((iX + pTile->drawable.width) > fullX2)
+ width = fullX2 - iX;
+ else
+ width = pTile->drawable.width;
+
+ if (iX == fullX1)
+ xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pTile->drawable.width) - pTile->drawable.width)) % pTile->drawable.width;
+ else
+ xoffset = 0;
+
+ if (xoffset + width > pTile->drawable.width)
+ width = pTile->drawable.width - xoffset;
+
+ BitBlt (pGCPriv->hdcMem,
+ iX, fullY1,
+ width, 1,
+ hdcTile,
+ xoffset,
+ (fullY1 - (pDrawable->y + (pGC->patOrg.y % pTile->drawable.height) - pTile->drawable.height)) % pTile->drawable.height,
+ g_copyROP[pGC->alu]);
+ }
+ }
+
+ /* Push the tile pixmap out of the memory HDC */
+ SelectObject (hdcTile, hbmpOrig);
+
+ /* Delete the tile */
+ DeleteDC (hdcTile);
break;
default:
- FatalError ("winFillSpans - DRAWABLE_PIXMAP - Unknown "
- "fillStyle\n");
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - Unknown fillStyle\n");
break;
}
+
+ /* Reset clip region */
+ SelectClipRgn (pGCPriv->hdcMem, NULL);
+
+ /* Push the drawable pixmap out of the GC HDC */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
break;
-
+
case DRAWABLE_WINDOW:
+
+ SelectClipRgn (pGCPriv->hdc, combined);
+ DeleteObject (combined);
+ combined = NULL;
+
/* Branch on fill style */
switch (pGC->fillStyle)
{
case FillSolid:
- ErrorF ("\nwinFillSpans - DRAWABLE_WINDOW - FillSolid\n\n");
- /* Enumerate spans */
- for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ ROP16 (pGCPriv->hdc, pGC->alu);
+
+ if (pDrawable->depth == 1)
+ {
+ if (pGC->fgPixel == 0)
+ hPenOrig = SelectObject (pGCPriv->hdc,
+ GetStockObject (BLACK_PEN));
+ else
+ hPenOrig = SelectObject (pGCPriv->hdc,
+ GetStockObject (WHITE_PEN));
+ }
+ else
+ {
+ fg = pGC->fgPixel;
+ TRANSLATE_COLOR (fg);
+ hPen = CreatePen (PS_SOLID, 0, fg);
+ hPenOrig = SelectObject (pGCPriv->hdc, hPen);
+ }
+
+ while (iSpans--)
{
- /* 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);
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ MoveToEx (pGCPriv->hdc, fullX1, fullY1, NULL);
+ LineTo (pGCPriv->hdc, fullX2, fullY1);
}
+
+ SetROP2 (pGCPriv->hdc, R2_COPYPEN);
+
+ /* Give back the Brush */
+ SelectObject (pGCPriv->hdc, hPenOrig);
+
+ if (pDrawable->depth != 1)
+ DeleteObject (hPen);
+ break;
+
+ case FillOpaqueStippled:
+
+ pStipple = pGC->stipple;
+ pStipplePriv = winGetPixmapPriv (pStipple);
+
+ /* Create a device-dependent bitmap for the stipple */
+ hBitmap = CreateDIBitmap (pGCPriv->hdc,
+ (BITMAPINFOHEADER *)pStipplePriv->pbmih,
+ CBM_INIT,
+ pStipplePriv->pbBits,
+ (BITMAPINFO *)pStipplePriv->pbmih,
+ DIB_RGB_COLORS);
+
+ /* Create a memory DC to hold the stipple */
+ hdcStipple = CreateCompatibleDC (pGCPriv->hdc);
+
+ /* Select the stipple bitmap into the stipple DC */
+ hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
+ if (hbmpOrigStipple == NULL)
+ FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
+ "SelectObject () failed on hbmpOrigStipple\n");
+
+ /* Make a temporary copy of the foreground and background colors */
+ bg = pGC->bgPixel;
+ fg = pGC->fgPixel;
+
+ /* Translate the depth-dependent colors to Win32 COLORREFs */
+ TRANSLATE_COLOR (fg);
+ TRANSLATE_COLOR (bg);
+ SetTextColor (pGCPriv->hdc, fg);
+ SetBkColor (pGCPriv->hdc, bg);
+
+ while (iSpans--)
+ {
+ int width = pStipple->drawable.width;
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ for (iX = fullX1; iX < fullX2; iX += width)
+ {
+ int xoffset;
+
+ if ((iX + pStipple->drawable.width) > fullX2)
+ width = fullX2 - iX;
+ else
+ width = pStipple->drawable.width;
+
+ if (iX == fullX1)
+ xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
+ else
+ xoffset = 0;
+
+ if (xoffset + width > pStipple->drawable.width)
+ width = pStipple->drawable.width - xoffset;
+
+ BitBlt (pGCPriv->hdc,
+ iX, fullY1,
+ width, 1,
+ hdcStipple,
+ xoffset,
+ (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
+ g_copyROP[pGC->alu]);
+ }
+ }
+
+ /* Clear the stipple HDC */
+ SelectObject (hdcStipple, hbmpOrigStipple);
+ DeleteDC (hdcStipple);
+
+ /* Delete the device dependent stipple bitmap */
+ DeleteObject (hBitmap);
+
break;
case FillStippled:
- FatalError ("winFillSpans - DRAWABLE_WINDOW - FillStippled\n\n");
+ pStipple = pGC->stipple;
+ pStipplePriv = winGetPixmapPriv (pStipple);
+
+ /* Create a device-dependent bitmap for the stipple */
+ hBitmap = CreateDIBitmap (pGCPriv->hdcMem,
+ (BITMAPINFOHEADER *)pStipplePriv->pbmih,
+ CBM_INIT,
+ pStipplePriv->pbBits,
+ (BITMAPINFO *)pStipplePriv->pbmih,
+ DIB_RGB_COLORS);
+
+ /* Create a memory DC to hold the stipple */
+ hdcStipple = CreateCompatibleDC (pGCPriv->hdc);
+
+ /* Select the stipple bitmap into the stipple DC */
+ hbmpOrigStipple = SelectObject (hdcStipple, hBitmap);
+ if (hbmpOrigStipple == NULL)
+ FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
+ "SelectObject () failed on hbmpOrigStipple\n");
+
+ /* Make a temporary copy of the foreground and background colors */
+ bg = pGC->bgPixel;
+ fg = pGC->fgPixel;
+
+ /* Translate the depth-dependent colors to Win32 COLORREFs */
+ TRANSLATE_COLOR (fg);
+ TRANSLATE_COLOR (bg);
+
+ /* this is fudgy, we should only invert on the last one
+ * We need to get the black/white pixels right in the
+ * colormap. But yeah ! it's working..
+ */
+ if (pGC->bgPixel != -1 && pGC->fgPixel != -1)
+ {
+ SetTextColor (pGCPriv->hdc, fg);
+ SetBkColor (pGCPriv->hdc, bg);
+ BitBlt (hdcStipple,
+ 0, 0,
+ pStipple->drawable.width, pStipple->drawable.height,
+ hdcStipple,
+ 0,0,
+ 0x330008);
+ }
+ else if (pGC->bgPixel == -1)
+ {
+ SetTextColor (pGCPriv->hdc, fg);
+ SetBkMode (pGCPriv->hdc, TRANSPARENT);
+ BitBlt (hdcStipple,
+ 0, 0,
+ pStipple->drawable.width, pStipple->drawable.height,
+ hdcStipple,
+ 0,0,
+ 0x330008);
+ }
+ else if (pGC->fgPixel == -1)
+ {
+ SetTextColor (pGCPriv->hdc, bg);
+ SetBkMode (pGCPriv->hdc, TRANSPARENT);
+#if 0
+ BitBlt (hdcStipple,
+ 0, 0,
+ pStipple->drawable.width, pStipple->drawable.height,
+ hdcStipple,
+ 0, 0,
+ 0x330008);
+#endif
+ }
+
+ while (iSpans--)
+ {
+ int width = pStipple->drawable.width;
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ for (iX = fullX1; iX < fullX2; iX += width)
+ {
+ int xoffset;
+
+ if ((iX + pStipple->drawable.width) > fullX2)
+ width = fullX2 - iX;
+ else
+ width = pStipple->drawable.width;
+
+ if (iX == fullX1)
+ xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pStipple->drawable.width) - pStipple->drawable.width)) % pStipple->drawable.width;
+ else
+ xoffset = 0;
+
+ if (xoffset + width > pStipple->drawable.width)
+ width = pStipple->drawable.width - xoffset;
+
+ BitBlt (pGCPriv->hdc,
+ iX, fullY1,
+ width, 1,
+ hdcStipple,
+ xoffset,
+ (fullY1 - (pDrawable->y + (pGC->patOrg.y % pStipple->drawable.height) - pStipple->drawable.height)) % pStipple->drawable.height,
+ g_copyROP[pGC->alu]);
+ }
+ }
+
+ /* Clear the stipple HDC */
+ SelectObject (hdcStipple, hbmpOrigStipple);
+ DeleteDC (hdcStipple);
+
+ /* Delete the device dependent stipple bitmap */
+ DeleteObject (hBitmap);
+
+ /* Restore the background mode */
+ SetBkMode (pGCPriv->hdc, OPAQUE);
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;
@@ -402,136 +759,105 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
hbmpOrig = SelectObject (pGCPriv->hdcMem, pTilePriv->hBitmap);
if (hbmpOrig == NULL)
FatalError ("winFillSpans - DRAWABLE_WINDOW - FillTiled - "
- "SelectObject () failed on pTilePric->hBitmap\n");
+ "SelectObject () failed on pTilePriv->hBitmap\n");
- /* Enumerate spans */
- for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ while (iSpans--)
{
- /* 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 */
+ int width = pTile->drawable.width;
+ fullX1 = pPoints->x;
+ fullY1 = pPoints->y;
+ fullX2 = fullX1 + (int) *piWidths;
+ pPoints++;
+ piWidths++;
+
+ if (fullY1 < extentY1 || extentY2 <= fullY1)
+ continue;
+
+ if (fullX1 < extentX1)
+ fullX1 = extentX1;
+ if (fullX2 > extentX2)
+ fullX2 = extentX2;
+
+ if (fullX1 >= fullX2)
+ continue;
+
+ for (iX = fullX1; iX < fullX2; iX += width)
+ {
+ int xoffset;
+
+ if ((iX + pTile->drawable.width) > fullX2)
+ width = fullX2 - iX;
+ else
+ width = pTile->drawable.width;
+
+ if (iX == fullX1)
+ xoffset = (fullX1 - (pDrawable->x + (pGC->patOrg.x % pTile->drawable.width) - pTile->drawable.width)) % pTile->drawable.width;
+ else
+ xoffset = 0;
+
+ if (xoffset + width > pTile->drawable.width)
+ width = pTile->drawable.width - xoffset;
+
BitBlt (pGCPriv->hdc,
- pPoint->x + iX, pPoint->y,
- pTile->drawable.width, 1,
+ iX, fullY1,
+ width, 1,
pGCPriv->hdcMem,
- 0, pPoint->y % pTile->drawable.height,
- SRCCOPY);
+ xoffset,
+ (fullY1 - (pDrawable->y + (pGC->patOrg.y % pTile->drawable.height) - pTile->drawable.height)) % pTile->drawable.height,
+ g_copyROP[pGC->alu]);
}
}
-
- /* 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");
+ /* Push the tile pixmap out of the memory HDC */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
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");
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - Unknown fillStyle\n");
break;
}
+
+ /* Reset clip region */
+ SelectClipRgn (pGCPriv->hdc, NULL);
break;
-
- case UNDRAWABLE_WINDOW:
- FatalError ("winFillSpans - UNDRAWABLE_WINDOW\n\n");
+ case UNDRAWABLE_WINDOW:
+ /* UNDRAWABLE_WINDOW doesn't appear to get called when running xterm */
switch (pGC->fillStyle)
{
case FillSolid:
- ErrorF ("\nwinFillSpans - UNDRAWABLE_WINDOW - FillSolid\n\n");
+ ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillSolid - "
+ "Unimplemented\n");
break;
case FillStippled:
- ErrorF ("\nwinFillSpans - UNDRAWABLE_WINDOW - FillStippled\n\n");
+ ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillStippled - "
+ "Unimplemented\n");
break;
case FillTiled:
- ErrorF ("\nwinFillSpans - UNDRAWABLE_WINDOW - FillTiled\n\n");
+ ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - FillTiled - "
+ "Unimplemented\n");
break;
case FillOpaqueStippled:
- FatalError ("winFillSpans () - UNDRAWABLE_WINDOW - "
- "OpaqueStippled\n");
+ ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - OpaqueStippled - "
+ "Unimplemented\n");
break;
default:
- FatalError ("winFillSpans () - UNDRAWABLE_WINDOW - Unknown "
- "fillStyle\n");
+ ErrorF ("winFillSpans - UNDRAWABLE_WINDOW - Unknown fillStyle\n");
+ break;
}
break;
case DRAWABLE_BUFFER:
- FatalError ("winFillSpansNativeGDI - DRAWABLE_BUFFER\n");
+ /* DRAWABLE_BUFFER seems to be undocumented. */
+ ErrorF ("winFillSpans - DRAWABLE_BUFFER - Unimplemented\n");
break;
default:
- FatalError ("winFillSpansNativeGDI - Unknown drawable type\n");
+ ErrorF ("winFillSpans - Unknown drawable type\n");
break;
}
}
diff --git a/hw/xwin/winfont.c b/hw/xwin/winfont.c
index b249d8643..97bd7967b 100644
--- a/hw/xwin/winfont.c
+++ b/hw/xwin/winfont.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winfont.c,v 1.2 2001/06/04 13:04:41 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winfont.c,v 1.3 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -36,7 +36,9 @@
Bool
winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
{
+#if CYGDEBUG
ErrorF ("winRealizeFont()\n");
+#endif
return TRUE;
}
@@ -45,6 +47,8 @@ winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
Bool
winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
{
+#if CYGDEBUG
ErrorF ("winUnrealizeFont()\n");
+#endif
return TRUE;
}
diff --git a/hw/xwin/wingc.c b/hw/xwin/wingc.c
index 6ad58d8ed..a4e2a53cb 100644
--- a/hw/xwin/wingc.c
+++ b/hw/xwin/wingc.c
@@ -27,9 +27,11 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/wingc.c,v 1.10 2001/10/30 15:39:09 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wingc.c,v 1.11 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
+void
+winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg);
#if 0
/* GC Handling Routines */
@@ -45,8 +47,8 @@ const GCFuncs winGCFuncs = {
#else
const GCFuncs winGCFuncs = {
winValidateGCNativeGDI,
- winChangeGCNativeGDI,
- winCopyGCNativeGDI,
+ miChangeGC,
+ miCopyGC,
winDestroyGCNativeGDI,
miChangeClip,
miDestroyClip,
@@ -73,9 +75,14 @@ const GCOps winGCOps = {
miPolyText16,
miImageText8,
miImageText16,
+#if 0
+ winImageGlyphBltNativeGDI,
+ winPolyGlyphBltNativeGDI,
+#else
miImageGlyphBlt,
miPolyGlyphBlt,
- miPushPixels
+#endif
+ winPushPixels
#ifdef NEED_LINEHELPER
,NULL
#endif
@@ -91,23 +98,21 @@ winCreateGCNativeGDI (GCPtr pGC)
winPrivGCPtr pGCPriv = NULL;
winPrivScreenPtr pScreenPriv = NULL;
- ErrorF ("winCreateGCNativeGDI () depth: %d\n",
+#if 0
+ ErrorF ("winCreateGCNativeGDI - depth: %d\n",
pGC->depth);
+#endif
pGC->clientClip = NULL;
pGC->clientClipType = CT_NONE;
+ pGC->freeCompClip = FALSE;
+ pGC->pCompositeClip = 0;
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;
+ /* We want all coordinates passed to spans functions to be screen relative */
+ pGC->miTranslate = TRUE;
/* Allocate privates for this GC */
pGCPriv = winGetGCPriv (pGC);
@@ -117,9 +122,9 @@ winCreateGCNativeGDI (GCPtr pGC)
return FALSE;
}
- /* Copy the screen DC to the local privates */
+ /* Create a new screen DC for the display window */
pScreenPriv = winGetScreenPriv (pGC->pScreen);
- pGCPriv->hdc = pScreenPriv->hdcScreen;
+ pGCPriv->hdc = GetDC (pScreenPriv->hwndScreen);
/* Allocate a memory DC for the GC */
pGCPriv->hdcMem = CreateCompatibleDC (pGCPriv->hdc);
@@ -132,7 +137,7 @@ winCreateGCNativeGDI (GCPtr pGC)
void
winChangeGCNativeGDI (GCPtr pGC, unsigned long ulChanges)
{
-#if CYGDEBUG
+#if 0
ErrorF ("winChangeGCNativeGDI () - Doing nothing\n");
#endif
}
@@ -143,225 +148,11 @@ 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;
- }
+ if ((ulChanges & (GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode))
+ || (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
+ {
+ miComputeCompositeClip (pGC, pDrawable);
+ }
}
@@ -378,6 +169,10 @@ void
winDestroyGCNativeGDI (GCPtr pGC)
{
winGCPriv(pGC);
+ winScreenPriv(pGC->pScreen);
+
+ if (pGC->freeCompClip)
+ REGION_DESTROY (pGC->pScreen, pGC->pCompositeClip);
/* Free the memory DC */
if (pGCPriv->hdcMem != NULL)
@@ -386,8 +181,12 @@ winDestroyGCNativeGDI (GCPtr pGC)
pGCPriv->hdcMem = NULL;
}
- /* Invalidate the screen DC pointer */
- pGCPriv->hdc = NULL;
+ /* Release the screen DC for the display window */
+ if (pGCPriv->hdc != NULL)
+ {
+ ReleaseDC (pScreenPriv->hwndScreen, pGCPriv->hdc);
+ pGCPriv->hdc = NULL;
+ }
/* Invalidate the GC privates pointer */
winSetGCPriv (pGC, NULL);
diff --git a/hw/xwin/wingetsp.c b/hw/xwin/wingetsp.c
index 637debb9e..49ba7f2fb 100644
--- a/hw/xwin/wingetsp.c
+++ b/hw/xwin/wingetsp.c
@@ -26,8 +26,9 @@
*from the XFree86 Project.
*
* Authors: Harold L Hunt II
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/wingetsp.c,v 1.7 2001/11/01 12:19:40 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wingetsp.c,v 1.8 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -46,107 +47,132 @@ winGetSpansNativeGDI (DrawablePtr pDrawable,
DDXPointPtr pPoint = NULL;
int *piWidth = NULL;
char *pDst = pDsts;
- int iBytesToCopy;
- HBITMAP hbmpWindow, hbmpOrig;
+ HBITMAP hbmpWindow, hbmpOrig, hbmpOrig1;
BYTE *pbWindow = NULL;
- HDC hdcMem;
+ HDC hdcMem, hdcMem1;
ScreenPtr pScreen = pDrawable->pScreen;
winScreenPriv(pScreen);
- int iByteWidth;
/* Branch on the drawable type */
switch (pDrawable->type)
{
case DRAWABLE_PIXMAP:
+#if 0
ErrorF ("winGetSpans - DRAWABLE_PIXMAP %08x\n",
pDrawable);
+#endif
pPixmap = (PixmapPtr) pDrawable;
pPixmapPriv = winGetPixmapPriv (pPixmap);
+ /* Open a memory HDC */
+ hdcMem1 = CreateCompatibleDC (NULL);
+ hdcMem = CreateCompatibleDC (NULL);
+
+ /* Select the drawable pixmap into a DC */
+ hbmpOrig1 = SelectObject (hdcMem1, pPixmapPriv->hBitmap);
+
+ if (hbmpOrig1 == NULL)
+ FatalError ("winGetSpans - DRAWABLE_PIXMAP - SelectObject () "
+ "failed on pPixmapPriv->hBitmap\n");
+
/* Loop through spans */
for (iSpan = 0; iSpan < iSpans; ++iSpan)
{
pPoint = pPoints + iSpan;
piWidth = piWidths + iSpan;
-
- iBytesToCopy = PixmapBytePad (*piWidth, pDrawable->depth);
+
+ hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
+ pDrawable->depth,
+ &pbWindow,
+ NULL);
+
+ hbmpOrig = SelectObject (hdcMem, hbmpWindow);
+
+ /* Transfer the window bits to the window bitmap */
+ BitBlt (hdcMem,
+ 0, 0,
+ *piWidth, 1,
+ hdcMem1,
+ pPoint->x, pPoint->y,
+ SRCCOPY);
memcpy (pDst,
- pPixmapPriv->pbBits
- + pPixmapPriv->dwScanlineBytes * pPoint->y,
- iBytesToCopy);
+ (char*) pbWindow,
+ PixmapBytePad (*piWidth, pDrawable->depth));
+
+ /* Pop the window bitmap out of the HDC and delete the bitmap */
+ SelectObject (hdcMem, hbmpOrig);
+ DeleteObject (hbmpWindow);
+#if 0
ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
pDrawable->width, pDrawable->height, pDrawable->depth,
pPoint->x, pPoint->y, *piWidth);
+#endif
/* Calculate offset of next bit destination */
- pDst += 4 * ((*piWidth + 31) / 32);
+ pDst += PixmapBytePad (*piWidth, pDrawable->depth);
}
+
+ /* Pop the pixmap's bitmap out of the HDC */
+ SelectObject (hdcMem1, hbmpOrig1);
+
+ /* Delete the HDCs */
+ DeleteDC (hdcMem1);
+ DeleteDC (hdcMem);
break;
case DRAWABLE_WINDOW:
+#if 0
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);
+#endif
/* 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);
+ hbmpWindow = winCreateDIBNativeGDI (*piWidth, 1,
+ pDrawable->depth,
+ &pbWindow,
+ NULL);
+
+ hbmpOrig = SelectObject (hdcMem, hbmpWindow);
+
+ /* Transfer the window bits to the window bitmap */
+ BitBlt (hdcMem,
+ 0, 0,
+ *piWidth, 1,
+ pScreenPriv->hdcScreen,
+ pPoint->x, pPoint->y,
+ SRCCOPY);
memcpy (pDst,
- pbWindow + iByteWidth * (pPoint->y - pPoints->y),
- iBytesToCopy);
-
+ (char*) pbWindow,
+ PixmapBytePad (*piWidth, pDrawable->depth));
+
+ /* Pop the window bitmap out of the HDC */
+ SelectObject (hdcMem, hbmpOrig);
+
+ DeleteObject (hbmpWindow);
+
+#if 0
ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
pDrawable->width, pDrawable->height, pDrawable->depth,
pPoint->x, pPoint->y, *piWidth);
+#endif
/* Calculate offset of next bit destination */
- pDst += 4 * ((*piWidth + 31) / 32);
+ pDst += PixmapBytePad (*piWidth, pDrawable->depth);
}
/* Delete the window bitmap */
- DeleteObject (hbmpWindow);
+ DeleteDC (hdcMem);
break;
case UNDRAWABLE_WINDOW:
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 20df053c2..95f245e57 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -30,7 +30,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.c,v 1.13 2003/07/29 21:25:17 dawes Exp $ */
#include "win.h"
@@ -649,31 +649,23 @@ 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 */
+ /* Loop through all keys */
for (i = 0; i < NUM_KEYCODES; ++i)
{
- if (g_winKeyState[i]) winSendKeyEvent (i, FALSE);
+ /* Pop key if pressed */
+ if (g_winKeyState[i])
+ winSendKeyEvent (i, FALSE);
+
+ /* Reset pressed flag for keys */
+ g_winKeyState[i] = FALSE;
}
#endif
-#endif
}
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
index 35342c359..ce8ac4199 100644
--- a/hw/xwin/winmsg.c
+++ b/hw/xwin/winmsg.c
@@ -27,7 +27,7 @@
*
* Authors: Alexander Gottwald
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.c,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.c,v 1.2 2003/10/02 13:30:10 eich Exp $ */
#include "win.h"
#include "winmsg.h"
@@ -45,26 +45,7 @@ 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);
+ LogVMessageVerb(type, verb, format, ap);
}
@@ -73,7 +54,7 @@ winDrvMsg (int scrnIndex, MessageType type, const char *format, ...)
{
va_list ap;
va_start (ap, format);
- winVMsg (scrnIndex, type, 0, format, ap);
+ LogVMessageVerb(type, 0, format, ap);
va_end (ap);
}
@@ -83,7 +64,7 @@ winMsg (MessageType type, const char *format, ...)
{
va_list ap;
va_start (ap, format);
- winVMsg (0, type, 0, format, ap);
+ LogVMessageVerb(type, 0, format, ap);
va_end (ap);
}
@@ -94,7 +75,7 @@ winDrvMsgVerb (int scrnIndex, MessageType type, int verb, const char *format,
{
va_list ap;
va_start (ap, format);
- winVMsg (scrnIndex, type, verb, format, ap);
+ LogVMessageVerb(type, verb, format, ap);
va_end (ap);
}
@@ -104,7 +85,7 @@ winMsgVerb (MessageType type, int verb, const char *format, ...)
{
va_list ap;
va_start (ap, format);
- winVMsg (0, type, verb, format, ap);
+ LogVMessageVerb(type, verb, format, ap);
va_end (ap);
}
@@ -114,6 +95,6 @@ winErrorFVerb (int verb, const char *format, ...)
{
va_list ap;
va_start (ap, format);
- winVMsg (0, X_NONE, verb, format, ap);
+ LogVMessageVerb(X_NONE, verb, format, ap);
va_end (ap);
}
diff --git a/hw/xwin/winmsg.h b/hw/xwin/winmsg.h
index c873d4beb..16ec536b0 100644
--- a/hw/xwin/winmsg.h
+++ b/hw/xwin/winmsg.h
@@ -27,36 +27,11 @@
*
* Authors: Alexander Gottwald
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.h,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.h,v 1.2 2003/10/02 13:30:10 eich 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
*/
diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c
new file mode 100755
index 000000000..21be64977
--- /dev/null
+++ b/hw/xwin/winmultiwindowclass.c
@@ -0,0 +1,284 @@
+/*
+ *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: Earle F. Philhower, III
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowclass.c,v 1.2 2003/10/02 13:30:10 eich Exp $ */
+
+#include <Xatom.h>
+#include "propertyst.h"
+#include "windowstr.h"
+#include "winmultiwindowclass.h"
+
+int
+winMultiWindowGetClassHint (WindowPtr pWin, char **res_name, char **res_class)
+{
+ struct _Window *pwin;
+ struct _Property *prop;
+ int len_name, len_class;
+
+ if (!pWin || !res_name || !res_class)
+ {
+ ErrorF ("winMultiWindowGetClassHint - pWin, res_name, or res_class was "
+ "NULL\n");
+ return 0;
+ }
+
+ pwin = (struct _Window*) pWin;
+
+ if (pwin->optional)
+ prop = (struct _Property *) pwin->optional->userProps;
+ else
+ prop = NULL;
+
+ *res_name = *res_class = NULL;
+
+ while (prop)
+ {
+ if (prop->propertyName == XA_WM_CLASS
+ && prop->type == XA_STRING
+ && prop->format == 8
+ && prop->data)
+ {
+ len_name = strlen ((char *) prop->data);
+
+ (*res_name) = malloc (len_name + 1);
+
+ if (!*res_name)
+ {
+ ErrorF ("winMultiWindowGetClassHint - *res_name was NULL\n");
+ return 0;
+ }
+
+ /* Add one to len_name to allow copying of trailing 0 */
+ strncpy ((*res_name), prop->data, len_name + 1);
+
+ if (len_name == prop->size)
+ len_name--;
+
+ len_class = strlen (((char *)prop->data) + 1 + len_name);
+
+ (*res_class) = malloc (len_class + 1);
+
+ if (!*res_class)
+ {
+ ErrorF ("winMultiWindowGetClassHint - *res_class was NULL\n");
+
+ /* Free the previously allocated res_name */
+ free (*res_name);
+ return 0;
+ }
+
+ strcpy ((*res_class), ((char *)prop->data) + 1 + len_name);
+
+ return 1;
+ }
+ else
+ prop = prop->next;
+ }
+
+ return 0;
+}
+
+
+int
+winMultiWindowGetWMHints (WindowPtr pWin, WinXWMHints *hints)
+{
+ struct _Window *pwin;
+ struct _Property *prop;
+
+ if (!pWin || !hints)
+ {
+ ErrorF ("winMultiWindowGetWMHints - pWin or hints was NULL\n");
+ return 0;
+ }
+
+ pwin = (struct _Window*) pWin;
+
+ if (pwin->optional)
+ prop = (struct _Property *) pwin->optional->userProps;
+ else
+ prop = NULL;
+
+ memset (hints, 0, sizeof (WinXWMHints));
+
+ while (prop)
+ {
+ if (prop->propertyName == XA_WM_HINTS
+ && prop->data)
+ {
+ memcpy (hints, prop->data, sizeof (WinXWMHints));
+ return 1;
+ }
+ else
+ prop = prop->next;
+ }
+
+ return 0;
+}
+
+
+int
+winMultiWindowGetWindowRole (WindowPtr pWin, char **res_role)
+{
+ struct _Window *pwin;
+ struct _Property *prop;
+ int len_role;
+ static Atom atmWmWindowRole = 0;
+
+ if (!pWin || !res_role)
+ return 0;
+
+ /* Initialize the window role atom, not in XAtom.h */
+ if (!atmWmWindowRole)
+ atmWmWindowRole = MakeAtom ("WM_WINDOW_ROLE", 14, 1);
+
+ pwin = (struct _Window*) pWin;
+
+ if (pwin->optional)
+ prop = (struct _Property *) pwin->optional->userProps;
+ else
+ prop = NULL;
+
+ *res_role = NULL;
+ while (prop)
+ {
+ if (prop->propertyName == atmWmWindowRole
+ && prop->type == XA_STRING
+ && prop->format == 8
+ && prop->data)
+ {
+ len_role= strlen ((char *) prop->data);
+
+ (*res_role) = malloc (len_role + 1);
+
+ if (!*res_role)
+ {
+ ErrorF ("winMultiWindowGetWindowRole - *res_role was NULL\n");
+ return 0;
+ }
+
+ strcpy ((*res_role), prop->data);
+
+ return 1;
+ }
+ else
+ prop = prop->next;
+ }
+
+ return 0;
+}
+
+
+int
+winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints)
+{
+ struct _Window *pwin;
+ struct _Property *prop;
+
+ if (!pWin || !hints)
+ {
+ ErrorF ("winMultiWindowGetWMNormalHints - pWin or hints was NULL\n");
+ return 0;
+ }
+
+ pwin = (struct _Window*) pWin;
+
+ if (pwin->optional)
+ prop = (struct _Property *) pwin->optional->userProps;
+ else
+ prop = NULL;
+
+ memset (hints, 0, sizeof (WinXSizeHints));
+
+ while (prop)
+ {
+ if (prop->propertyName == XA_WM_NORMAL_HINTS
+ && prop->data)
+ {
+ memcpy (hints, prop->data, sizeof (WinXSizeHints));
+ return 1;
+ }
+ else
+ prop = prop->next;
+ }
+
+ return 0;
+}
+
+
+int
+winMultiWindowGetWMName (WindowPtr pWin, char **wmName)
+{
+ struct _Window *pwin;
+ struct _Property *prop;
+ int len_name;
+
+ if (!pWin || !wmName)
+ {
+ ErrorF ("winMultiWindowGetClassHint - pWin, res_name, or res_class was "
+ "NULL\n");
+ return 0;
+ }
+
+ pwin = (struct _Window*) pWin;
+
+ if (pwin->optional)
+ prop = (struct _Property *) pwin->optional->userProps;
+ else
+ prop = NULL;
+
+ *wmName = NULL;
+
+ while (prop)
+ {
+ if (prop->propertyName == XA_WM_NAME
+ && prop->type == XA_STRING
+ && prop->data)
+ {
+ len_name = strlen ((char *) prop->data);
+
+ (*wmName) = malloc (len_name + 1);
+
+ if (!*wmName)
+ {
+ ErrorF ("winMultiWindowGetWMName - *wmName was NULL\n");
+ return 0;
+ }
+
+ /* Add one to len_name to allow copying of trailing 0 */
+ strncpy ((*wmName), prop->data, len_name+1);
+
+ return 1;
+ }
+ else
+ prop = prop->next;
+ }
+
+ return 0;
+}
+
diff --git a/hw/xwin/winmultiwindowclass.h b/hw/xwin/winmultiwindowclass.h
new file mode 100755
index 000000000..b6ad55d8b
--- /dev/null
+++ b/hw/xwin/winmultiwindowclass.h
@@ -0,0 +1,110 @@
+/*
+ *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: Earle F. Philhower, III
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowclass.h,v 1.2 2003/10/02 13:30:10 eich Exp $ */
+
+
+/*
+ * Structures
+ */
+
+typedef struct {
+ long flags; /* marks which fields in this structure are defined */
+ Bool input; /* does this application rely on the window manager to
+ get keyboard input? */
+ int initial_state; /* see below */
+ Pixmap icon_pixmap; /* pixmap to be used as icon */
+ Window icon_window; /* window to be used as icon */
+ int icon_x, icon_y; /* initial position of icon */
+ Pixmap icon_mask; /* icon mask bitmap */
+ XID window_group; /* id of related window group */
+ /* this structure may be extended in the future */
+} WinXWMHints;
+
+
+/*
+ * new version containing base_width, base_height, and win_gravity fields;
+ * used with WM_NORMAL_HINTS.
+ */
+typedef struct {
+ long flags; /* marks which fields in this structure are defined */
+ int x, y; /* obsolete for new window mgrs, but clients */
+ int width, height; /* should set so old wm's don't mess up */
+ int min_width, min_height;
+ int max_width, max_height;
+ int width_inc, height_inc;
+ struct {
+ int x; /* numerator */
+ int y; /* denominator */
+ } min_aspect, max_aspect;
+ int base_width, base_height; /* added by ICCCM version 1 */
+ int win_gravity; /* added by ICCCM version 1 */
+} WinXSizeHints;
+
+/*
+ * The next block of definitions are for window manager properties that
+ * clients and applications use for communication.
+ */
+
+/* flags argument in size hints */
+#define USPosition (1L << 0) /* user specified x, y */
+#define USSize (1L << 1) /* user specified width, height */
+
+#define PPosition (1L << 2) /* program specified position */
+#define PSize (1L << 3) /* program specified size */
+#define PMinSize (1L << 4) /* program specified minimum size */
+#define PMaxSize (1L << 5) /* program specified maximum size */
+#define PResizeInc (1L << 6) /* program specified resize increments */
+#define PAspect (1L << 7) /* program specified min and max aspect ratios */
+#define PBaseSize (1L << 8) /* program specified base for incrementing */
+#define PWinGravity (1L << 9) /* program specified window gravity */
+
+/* obsolete */
+#define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect)
+
+
+/*
+ * Function prototypes
+ */
+
+int
+winMultiWindowGetWMHints (WindowPtr pWin, WinXWMHints *hints);
+
+int
+winMultiWindowGetClassHint (WindowPtr pWin, char **res_name, char **res_class);
+
+int
+winMultiWindowGetWindowRole (WindowPtr pWin, char **res_role);
+
+int
+winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints);
+
+int
+winMultiWindowGetWMName (WindowPtr pWin, char **wmName);
+
diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c
new file mode 100755
index 000000000..dd56db6d6
--- /dev/null
+++ b/hw/xwin/winmultiwindowicons.c
@@ -0,0 +1,378 @@
+/*
+ *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: Earle F. Philhower, III
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowicons.c,v 1.2 2003/10/02 13:30:10 eich Exp $ */
+
+#include "win.h"
+#include "dixevents.h"
+#include "winmultiwindowclass.h"
+#include "winprefs.h"
+
+
+/*
+ * External global variables
+ */
+
+extern HICON g_hiconX;
+
+
+/*
+ * Prototypes for local functions
+ */
+
+static void
+winScaleXBitmapToWindows (int iconSize, int effBPP,
+ PixmapPtr pixmap, unsigned char *image);
+
+
+/*
+ * Scale an X icon bitmap into a Windoze icon bitmap
+ */
+
+static void
+winScaleXBitmapToWindows (int iconSize,
+ int effBPP,
+ PixmapPtr pixmap,
+ unsigned char *image)
+{
+ int row, column, effXBPP, effXDepth;
+ unsigned char *outPtr;
+ unsigned char *iconData = 0;
+ int stride, xStride;
+ float factX, factY;
+ int posX, posY;
+ unsigned char *ptr;
+ unsigned int zero;
+ unsigned int color;
+
+
+ if (pixmap->drawable.bitsPerPixel == 15)
+ effXBPP = 16;
+ else
+ effXBPP = pixmap->drawable.bitsPerPixel;
+
+ if (pixmap->drawable.depth == 15)
+ effXDepth = 16;
+ else
+ effXDepth = pixmap->drawable.depth;
+
+ /* Need 32-bit aligned rows */
+ stride = ((iconSize * effBPP + 31) & (~31)) / 8;
+ xStride = ((pixmap->drawable.width * effXBPP + 31) & (~31)) / 8;
+
+ iconData = malloc (xStride * pixmap->drawable.height);
+ miGetImage ((DrawablePtr) &(pixmap->drawable), 0, 0,
+ pixmap->drawable.width, pixmap->drawable.height,
+ ZPixmap, 0xffffffff, iconData);
+
+ /* Keep aspect ratio */
+ factX = ((float)pixmap->drawable.width) / ((float)iconSize);
+ factY = ((float)pixmap->drawable.height) / ((float)iconSize);
+ if (factX > factY)
+ factY = factX;
+ else
+ factX = factY;
+
+ /* Out-of-bounds, fill icon with zero */
+ zero = 0;
+
+ for (row = 0; row < iconSize; row++)
+ {
+ outPtr = image + stride * row;
+ for (column = 0; column < iconSize; column++)
+ {
+ posX = factX * column;
+ posY = factY * row;
+
+ ptr = iconData + posY*xStride;
+ if (effXBPP == 1)
+ {
+ ptr += posX / 8;
+
+ /* Out of X icon bounds, leave space blank */
+ if (posX >= pixmap->drawable.width
+ || posY >= pixmap->drawable.height)
+ ptr = (unsigned char *) &zero;
+
+ if ((*ptr) & (1 << (posX & 7)))
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = 0;
+ case 24:
+ *(outPtr++) = 0;
+ case 16:
+ *(outPtr++) = 0;
+ case 8:
+ *(outPtr++) = 0;
+ break;
+ case 1:
+ outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
+ break;
+ }
+ else
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = 255;
+ *(outPtr++) = 255;
+ *(outPtr++) = 255;
+ *(outPtr++) = 0;
+ break;
+ case 24:
+ *(outPtr++) = 255;
+ case 16:
+ *(outPtr++) = 255;
+ case 8:
+ *(outPtr++) = 255;
+ break;
+ case 1:
+ outPtr[column / 8] |= (1 << (7 - (column & 7)));
+ break;
+ }
+ }
+ else if (effXDepth == 24 || effXDepth == 32)
+ {
+ ptr += posX * (effXBPP / 8);
+
+ /* Out of X icon bounds, leave space blank */
+ if (posX >= pixmap->drawable.width
+ || posY >= pixmap->drawable.height)
+ ptr = (unsigned char *) &zero;
+ color = (((*ptr) << 16)
+ + ((*(ptr + 1)) << 8)
+ + ((*(ptr + 2)) << 0));
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = *(ptr++); // b
+ *(outPtr++) = *(ptr++); // g
+ *(outPtr++) = *(ptr++); // r
+ *(outPtr++) = 0; // resvd
+ break;
+ case 24:
+ *(outPtr++) = *(ptr++);
+ *(outPtr++) = *(ptr++);
+ *(outPtr++) = *(ptr++);
+ break;
+ case 16:
+ color = ((((*ptr) >> 2) << 10)
+ + (((*(ptr + 1)) >> 2) << 5)
+ + (((*(ptr + 2)) >> 2)));
+ *(outPtr++) = (color >> 8);
+ *(outPtr++) = (color & 255);
+ break;
+ case 8:
+ color = (((*ptr))) + (((*(ptr + 1)))) + (((*(ptr + 2))));
+ color /= 3;
+ *(outPtr++) = color;
+ break;
+ case 1:
+ if (color)
+ outPtr[column / 8] |= (1 << (7 - (column & 7)));
+ else
+ outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
+ }
+ }
+ else if (effXDepth == 16)
+ {
+ ptr += posX * (effXBPP / 8);
+
+ /* Out of X icon bounds, leave space blank */
+ if (posX >= pixmap->drawable.width
+ || posY >= pixmap->drawable.height)
+ ptr = (unsigned char *) &zero;
+ color = ((*ptr) << 8) + (*(ptr + 1));
+ switch (effBPP)
+ {
+ case 32:
+ *(outPtr++) = (color & 31) << 2;
+ *(outPtr++) = ((color >> 5) & 31) << 2;
+ *(outPtr++) = ((color >> 10) & 31) << 2;
+ *(outPtr++) = 0; // resvd
+ break;
+ case 24:
+ *(outPtr++) = (color & 31) << 2;
+ *(outPtr++) = ((color >> 5) & 31) << 2;
+ *(outPtr++) = ((color >> 10) & 31) << 2;
+ break;
+ case 16:
+ *(outPtr++) = *(ptr++);
+ *(outPtr++) = *(ptr++);
+ break;
+ case 8:
+ *(outPtr++) = (((color & 31)
+ + ((color >> 5) & 31)
+ + ((color >> 10) & 31)) / 3) << 2;
+ break;
+ case 1:
+ if (color)
+ outPtr[column / 8] |= (1 << (7 - (column & 7)));
+ else
+ outPtr[column / 8] &= ~(1 << (7 - (column & 7)));
+ break;
+ } /* end switch(effbpp) */
+ } /* end if effxbpp==16) */
+ } /* end for column */
+ } /* end for row */
+ free (iconData);
+}
+
+
+/*
+ * Attempt to create a custom icon from the WM_HINTS bitmaps
+ */
+
+HICON
+winXIconToHICON (WindowPtr pWin)
+{
+ unsigned char *mask, *image, *imageMask;
+ unsigned char *dst, *src;
+ PixmapPtr iconPtr;
+ PixmapPtr maskPtr;
+ int iconSize, planes, bpp, effBPP, stride, maskStride, i;
+ HDC hDC;
+ ICONINFO ii;
+ WinXWMHints hints;
+ HICON hIcon;
+
+ winMultiWindowGetWMHints (pWin, &hints);
+ if (!hints.icon_pixmap) return NULL;
+
+ iconPtr = LookupIDByType (hints.icon_pixmap, RT_PIXMAP);
+
+ if (!iconPtr) return NULL;
+
+ iconSize = 32;
+
+ hDC = GetDC (GetDesktopWindow ());
+ planes = GetDeviceCaps (hDC, PLANES);
+ bpp = GetDeviceCaps (hDC, BITSPIXEL);
+ ReleaseDC (GetDesktopWindow (), hDC);
+
+ /* 15 BPP is really 16BPP as far as we care */
+ if (bpp == 15)
+ effBPP = 16;
+ else
+ effBPP = bpp;
+
+ /* Need 32-bit aligned rows */
+ stride = ((iconSize * effBPP + 31) & (~31)) / 8;
+
+ /* Mask is 1-bit deep */
+ maskStride = ((iconSize * 1 + 31) & (~31)) / 8;
+
+ image = (unsigned char * ) malloc (stride * iconSize);
+ imageMask = (unsigned char *) malloc (stride * iconSize);
+ mask = (unsigned char *) malloc (maskStride * iconSize);
+
+ /* Default to a completely black mask */
+ memset (mask, 0, maskStride * iconSize);
+
+ winScaleXBitmapToWindows (iconSize, effBPP, iconPtr, image);
+ maskPtr = LookupIDByType (hints.icon_mask, RT_PIXMAP);
+
+ if (maskPtr)
+ {
+ winScaleXBitmapToWindows (iconSize, 1, maskPtr, mask);
+
+ winScaleXBitmapToWindows (iconSize, effBPP, maskPtr, imageMask);
+
+ /* Now we need to set all bits of the icon which are not masked */
+ /* on to 0 because Color is really an XOR, not an OR function */
+ dst = image;
+ src = imageMask;
+
+ for (i = 0; i < (stride * iconSize); i++)
+ if ((*(src++)))
+ *(dst++) = 0;
+ else
+ dst++;
+ }
+
+ ii.fIcon = TRUE;
+ ii.xHotspot = 0; /* ignored */
+ ii.yHotspot = 0; /* ignored */
+
+ /* Create Win32 mask from pixmap shape */
+ ii.hbmMask = CreateBitmap (iconSize, iconSize, planes, 1, mask);
+
+ /* Create Win32 bitmap from pixmap */
+ ii.hbmColor = CreateBitmap (iconSize, iconSize, planes, bpp, image);
+
+ /* Merge Win32 mask and bitmap into icon */
+ hIcon = CreateIconIndirect (&ii);
+
+ /* Release Win32 mask and bitmap */
+ DeleteObject (ii.hbmMask);
+ DeleteObject (ii.hbmColor);
+
+ /* Free X mask and bitmap */
+ free (mask);
+ free (image);
+ free (imageMask);
+
+ return hIcon;
+}
+
+
+
+/*
+ * Change the Windows window icon
+ */
+
+void
+winUpdateIcon (Window id)
+{
+ WindowPtr pWin;
+ HICON hIcon, hiconOld;
+
+ pWin = LookupIDByType (id, RT_WINDOW);
+ hIcon = (HICON)winOverrideIcon ((unsigned long)pWin);
+
+ if (!hIcon)
+ hIcon = winXIconToHICON (pWin);
+
+ if (hIcon)
+ {
+ winWindowPriv(pWin);
+
+ if (pWinPriv->hWnd)
+ {
+ hiconOld = (HICON) SetClassLong (pWinPriv->hWnd,
+ GCL_HICON,
+ (int) hIcon);
+
+ /* Delete the icon if its not the default */
+ if (hiconOld != g_hiconX &&
+ !winIconIsOverride((unsigned long)hiconOld))
+ DeleteObject (hiconOld);
+ }
+ }
+}
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c
new file mode 100755
index 000000000..5c623d14e
--- /dev/null
+++ b/hw/xwin/winmultiwindowshape.c
@@ -0,0 +1,212 @@
+/*
+ *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
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowshape.c,v 1.2 2003/11/10 18:22:44 tsi Exp $ */
+
+#ifdef SHAPE
+
+#include "win.h"
+
+
+/*
+ * External global variables
+ */
+
+extern HICON g_hiconX;
+
+
+/*
+ * winSetShapeMultiWindow - See Porting Layer Definition - p. 42
+ */
+
+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);
+
+ /* Update the Windows window's shape */
+ winReshapeMultiWindow (pWin);
+ winUpdateRgnMultiWindow (pWin);
+
+ return;
+}
+
+
+/*
+ * winUpdateRgnMultiWindow - Local function to update a Windows window region
+ */
+
+void
+winUpdateRgnMultiWindow (WindowPtr pWin)
+{
+ SetWindowRgn (winGetWindowPriv(pWin)->hWnd,
+ winGetWindowPriv(pWin)->hRgn, TRUE);
+}
+
+
+/*
+ * winReshapeMultiWindow - Computes the composite clipping region for a window
+ */
+
+void
+winReshapeMultiWindow (WindowPtr pWin)
+{
+ int nRects;
+ 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_NULL(pScreen, &rrNewShape);
+ 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
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 57d209e2a..15e508659 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -26,11 +26,22 @@
*from the XFree86 Project.
*
* Authors: Kensuke Matsuzaki
+ * Earle F. Philhower, III
+ * Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwindow.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwindow.c,v 1.3 2003/10/02 13:30:10 eich Exp $ */
#include "win.h"
#include "dixevents.h"
+#include "winmultiwindowclass.h"
+#include "winprefs.h"
+
+
+/*
+ * External global variables
+ */
+
+extern HICON g_hiconX;
/*
@@ -46,31 +57,12 @@ 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;
+winFindWindow (pointer value, XID id, pointer cdata);
#if 0
-static BOOL s_fMoveByX = FALSE;
+static void
+winRestackXWindow (WindowPtr pWin, int smode);
#endif
@@ -78,9 +70,8 @@ static BOOL s_fMoveByX = FALSE;
* Constant defines
*/
+#define MOUSE_POLLING_INTERVAL 500
-#define MOUSE_POLLING_INTERVAL 500
-#define WIN_MULTIWINDOW_SHAPE YES
/*
* Macros
@@ -118,6 +109,7 @@ winCreateWindowMultiWindow (WindowPtr pWin)
pWinPriv->hWnd = NULL;
pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
pWinPriv->fXKilled = FALSE;
+ pWinPriv->fNeedRestore = FALSE;
return fResult;
}
@@ -191,8 +183,8 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
iBorder = wBorderWidth (pWin);
/* Get the X and Y location of the X window */
- iX = pWin->drawable.x;
- iY = pWin->drawable.y;
+ iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
/* Get the height and width of the X window */
iWidth = pWin->drawable.width;
@@ -336,9 +328,10 @@ winMapWindowMultiWindow (WindowPtr pWin)
/* Refresh/redisplay the Windows window associated with this X window */
winUpdateWindowsWindow (pWin);
-#if WIN_MULTIWINDOW_SHAPE
- winReshape (pWin);
- winUpdateRgn (pWin);
+#ifdef SHAPE
+ /* Update the Windows window's shape */
+ winReshapeMultiWindow (pWin);
+ winUpdateRgnMultiWindow (pWin);
#endif
return fResult;
@@ -376,6 +369,7 @@ winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
WindowPtr pPrevWin;
UINT uFlags;
HWND hInsertAfter;
+ HWND hWnd = NULL;
winWindowPriv(pWin);
#if CYGMULTIWINDOW_DEBUG
@@ -387,6 +381,9 @@ winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
winGetScreenPriv(pWin->drawable.pScreen)->RestackWindow (pWin,
pOldNextSib);
+ if (winGetScreenPriv(pWin->drawable.pScreen)->fRestacking)
+ return;
+
/* Bail out if no window privates or window handle is invalid */
if (!pWinPriv || !pWinPriv->hWnd)
return;
@@ -409,6 +406,22 @@ winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
/* Valid sibling - get handle to insert window after */
hInsertAfter = winGetWindowPriv(pPrevWin)->hWnd;
uFlags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE;
+
+ hWnd = GetNextWindow (pWinPriv->hWnd, GW_HWNDPREV);
+
+ do
+ {
+ if (GetProp (hWnd, WIN_WINDOW_PROP))
+ {
+ if (hWnd == winGetWindowPriv(pPrevWin)->hWnd)
+ {
+ uFlags |= SWP_NOZORDER;
+ }
+ break;
+ }
+ hWnd = GetNextWindow (hWnd, GW_HWNDPREV);
+ }
+ while (hWnd);
}
else
{
@@ -427,966 +440,111 @@ winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
/*
- * 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
+ * winCreateWindowsWindow - Create a Windows window associated with an X window
*/
-#ifdef SHAPE
-static
-void
-winReshape (WindowPtr pWin)
+static void
+winCreateWindowsWindow (WindowPtr pWin)
{
- int nRects;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- RegionRec rrNewShape;
- BoxPtr pShape, pRects, pEnd;
- HRGN hRgn, hRgnRect;
+ int iX, iY;
+ int iWidth;
+ int iHeight;
+ int iBorder;
+ HWND hWnd;
+ WNDCLASS wc;
winWindowPriv(pWin);
+ HICON hIcon;
+#define CLASS_NAME_LENGTH 512
+ char pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
+ char *res_name, *res_class, *res_role;
+ static int s_iWindowID = 0;
-#if CYGDEBUG
- ErrorF ("winReshape ()\n");
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
#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;
+ iBorder = wBorderWidth (pWin);
- /* Free any existing window region stored in the window privates */
- if (pWinPriv->hRgn != NULL)
- {
- DeleteObject (pWinPriv->hRgn);
- pWinPriv->hRgn = NULL;
- }
+ iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN);
- /* Bail if the window has no bounding region defined */
- if (!wBoundingShape (pWin))
- return;
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
- 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);
+ /* Load default X icon in case it's not ready yet */
+ if (!g_hiconX)
+ g_hiconX = (HICON)winOverrideDefaultIcon();
- /* 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);
+ if (!g_hiconX)
+ g_hiconX = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
- 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;
+ /* Try and get the icon from WM_HINTS */
+ hIcon = winXIconToHICON (pWin);
- /* 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
- }
+ /* Use default X icon if no icon loaded from WM_HINTS */
+ if (!hIcon)
+ hIcon = g_hiconX;
+ /* Set standard class name prefix so we can identify window easily */
+ strncpy (pszClass, WINDOW_CLASS_X, strlen (WINDOW_CLASS_X));
-
- /* Branch on message type */
- switch (message)
+ if (winMultiWindowGetClassHint (pWin, &res_name, &res_class))
{
- 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
+ strncat (pszClass, "-", 1);
+ strncat (pszClass, res_name, CLASS_NAME_LENGTH - strlen (pszClass));
+ strncat (pszClass, "-", 1);
+ strncat (pszClass, res_class, CLASS_NAME_LENGTH - strlen (pszClass));
- /* 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)
+ /* Check if a window class is provided by the WM_WINDOW_ROLE property,
+ * if not use the WM_CLASS information.
+ * For further information see:
+ * http://tronche.com/gui/x/icccm/sec-5.html
+ */
+ if (winMultiWindowGetWindowRole (pWin, &res_role) )
{
- /* Tell our Window Manager thread to raise the window */
- wmMsg.msg = WM_WM_RAISE;
- winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ strcat (pszClass, "-");
+ strcat (pszClass, res_role);
+ free (res_role);
}
-
- /* 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;
+ free (res_name);
+ free (res_class);
}
- 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);
+ /* Add incrementing window ID to make unique class name */
+ sprintf (pszWindowID, "-%x", s_iWindowID++);
+ strcat (pszClass, pszWindowID);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
+ ErrorF ("winCreateWindowsWindow - Creating class: %s\n", pszClass);
#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.hIcon = hIcon;
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
wc.lpszMenuName = NULL;
- wc.lpszClassName = WINDOW_CLASS_X;
+ wc.lpszClassName = pszClass;
RegisterClass (&wc);
/* Create the window */
- hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
- WINDOW_CLASS_X, /* Class name */
- WINDOW_TITLE_X, /* Window name */
+ hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
+ pszClass, /* 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 */
+ 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",
@@ -1395,7 +553,9 @@ winCreateWindowsWindow (WindowPtr pWin)
pWinPriv->hWnd = hWnd;
-
+ /* Cause the "Always On Top" to be added in main WNDPROC */
+ PostMessage (hWnd, WM_INIT_SYS_MENU, 0, 0);
+
SetProp (pWinPriv->hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin));
/* Flag that this Windows window handles its own activation */
@@ -1404,7 +564,8 @@ winCreateWindowsWindow (WindowPtr pWin)
/*
- * winDestroyWindowsWindow - Destroy a Windows window associated with an X window
+ * winDestroyWindowsWindow - Destroy a Windows window associated
+ * with an X window
*/
static void
@@ -1412,21 +573,30 @@ winDestroyWindowsWindow (WindowPtr pWin)
{
MSG msg;
winWindowPriv(pWin);
+ HICON hiconClass;
+ HMODULE hInstance;
+ int iReturn;
+ char pszClass[512];
#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);
+
+ /* Store the info we need to destroy after this window is gone */
+ hInstance = (HINSTANCE) GetClassLong (pWinPriv->hWnd, GCL_HMODULE);
+ hiconClass = (HICON) GetClassLong (pWinPriv->hWnd, GCL_HICON);
+ iReturn = GetClassName (pWinPriv->hWnd, pszClass, 512);
+ /* Destroy the Windows window */
DestroyWindow (pWinPriv->hWnd);
+ /* Null our handle to the Window so referencing it will cause an error */
pWinPriv->hWnd = NULL;
/* Process all messages on our queue */
@@ -1437,7 +607,30 @@ winDestroyWindowsWindow (WindowPtr pWin)
DispatchMessage (&msg);
}
}
-
+
+ /* Only if we were able to get the name */
+ if (iReturn)
+ {
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winDestroyWindowsWindow - Unregistering %s: ", pszClass);
+#endif
+ iReturn = UnregisterClass (pszClass, hInstance);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winDestroyWindowsWindow - %d Deleting Icon: ", iReturn);
+#endif
+
+ /* Only delete if it's not the default */
+ if (hiconClass != g_hiconX &&
+ !winIconIsOverride((unsigned long)hiconClass))
+ {
+ iReturn = DestroyIcon (hiconClass);
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winDestroyWindowsWindow - %d\n", iReturn);
+#endif
+ }
+ }
+
#if CYGMULTIWINDOW_DEBUG
ErrorF ("-winDestroyWindowsWindow\n");
#endif
@@ -1445,7 +638,8 @@ winDestroyWindowsWindow (WindowPtr pWin)
/*
- * winUpdateWindowsWindow - Redisplay/redraw a Windows window associated with an X window
+ * winUpdateWindowsWindow - Redisplay/redraw a Windows window
+ * associated with an X window
*/
static void
@@ -1489,19 +683,57 @@ winUpdateWindowsWindow (WindowPtr pWin)
}
+/*
+ * winGetWindowID -
+ */
+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;
+}
+/*
+ * winMoveXWindow -
+ */
-typedef struct {
- pointer value;
- XID id;
-} WindowIDPairRec, *WindowIDPairPtr;
+void
+winMoveXWindow (WindowPtr pWin, int x, int y)
+{
+ XID *vlist = malloc(sizeof(long)*2);
+ (CARD32*)vlist[0] = x;
+ (CARD32*)vlist[1] = y;
+ ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin));
+ free(vlist);
+}
+/*
+ * winResizeXWindow -
+ */
+
+void
+winResizeXWindow (WindowPtr pWin, int w, int h)
+{
+ XID *vlist = malloc(sizeof(long)*2);
+
+ (CARD32*)vlist[0] = w;
+ (CARD32*)vlist[1] = h;
+ ConfigureWindow (pWin, CWWidth | CWHeight, vlist, wClient(pWin));
+ free(vlist);
+}
/*
@@ -1520,55 +752,111 @@ winFindWindow (pointer value, XID id, pointer cdata)
}
+#if 0
/*
- * winGetWindowID -
+ * winRestackXWindow -
*/
-static XID
-winGetWindowID (WindowPtr pWin)
+static void
+winRestackXWindow (WindowPtr pWin, int smode)
{
- WindowIDPairRec wi = {pWin, 0};
- ClientPtr c = wClient(pWin);
-
- /* */
- FindClientResourcesByType (c, RT_WINDOW, winFindWindow, &wi);
+ XID *vlist = malloc(sizeof(unsigned long));
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winGetWindowID - Window ID: %d\n", wi.id);
-#endif
+ if (vlist == NULL)
+ {
+ ErrorF ("winRestackXWindow - malloc () failed\n");
+ return;
+ }
- return wi.id;
+ if (pWin == NULL)
+ {
+ ErrorF ("winRestackXWindow - NULL window\n");
+ free(vlist);
+ return;
+ }
+
+ *((unsigned long*)vlist) = smode;
+ ConfigureWindow (pWin, CWStackMode, vlist, wClient(pWin));
+
+ free(vlist);
}
+#endif
/*
- * SendConfigureNotify -
+ * winReorderWindowsMultiWindow -
*/
-static void
-SendConfigureNotify(WindowPtr pWin)
+void
+winReorderWindowsMultiWindow (ScreenPtr pScreen)
{
- xEvent event;
- winWindowPriv(pWin);
+ winScreenPriv(pScreen);
+ HWND hwnd = NULL;
+ WindowPtr pWin = NULL;
+ WindowPtr pWinSib = NULL;
- event.u.u.type = ConfigureNotify;
- event.u.configureNotify.window = pWin->drawable.id;
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winOrderWindowsMultiWindow\n");
+#endif
- if (pWin->nextSib)
- event.u.configureNotify.aboveSibling = pWin->nextSib->drawable.id;
- else
- event.u.configureNotify.aboveSibling = None;
+ pScreenPriv->fRestacking = TRUE;
- event.u.configureNotify.x = pWinPriv->iX - wBorderWidth (pWin);
- event.u.configureNotify.y = pWinPriv->iY - wBorderWidth (pWin);
+ if (pScreenPriv->fWindowOrderChanged)
+ {
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winOrderWindowsMultiWindow - Need to restack\n");
+#endif
+ hwnd = GetTopWindow (NULL);
- event.u.configureNotify.width = pWinPriv->iWidth;
- event.u.configureNotify.height = pWinPriv->iHeight;
+ while (hwnd)
+ {
+ if (GetProp (hwnd, WIN_WINDOW_PROP))
+ {
+ pWinSib = pWin;
+ pWin = GetProp (hwnd, WIN_WINDOW_PROP);
+
+ if (pWinSib)
+ {
+ XID *vlist = malloc (sizeof(long) * 2);
+
+ if (vlist == NULL)
+ {
+ ErrorF ("winOrderWindowsMultiWindow - malloc () "
+ "failed\n");
+ return;
+ }
+
+ ((long*)vlist)[0] = winGetWindowID (pWinSib);
+ ((long*)vlist)[1] = Below;
+
+ ConfigureWindow (pWin, CWSibling | CWStackMode,
+ vlist, wClient(pWin));
+
+ free (vlist);
+ }
+ }
+ hwnd = GetNextWindow (hwnd, GW_HWNDNEXT);
+ }
+ }
- event.u.configureNotify.borderWidth = wBorderWidth (pWin);
+ pScreenPriv->fRestacking = FALSE;
+ pScreenPriv->fWindowOrderChanged = FALSE;
+}
- event.u.configureNotify.override = pWin->overrideRedirect;
- /* */
- DeliverEvents (pWin, &event, 1, NullWindow);
+/*
+ * winMinimizeWindow - Minimize in response to WM_CHANGE_STATE
+ */
+
+void
+winMinimizeWindow (Window id)
+{
+ WindowPtr pWin;
+ winPrivWinPtr pWinPriv;
+
+ pWin = LookupIDByType (id, RT_WINDOW);
+
+ pWinPriv = winGetWindowPriv (pWin);
+
+ ShowWindow (pWinPriv->hWnd, SW_MINIMIZE);
}
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index ab4dd27f6..a60d36135 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -27,7 +27,7 @@
*
* Authors: Kensuke Matsuzaki
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwm.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwm.c,v 1.3 2003/10/02 13:30:11 eich Exp $ */
/* X headers */
#include <stdio.h>
@@ -61,7 +61,6 @@
#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
@@ -87,6 +86,7 @@ typedef struct _WMInfo {
WMMsgQueueRec wmMsgQueue;
Atom atmWmProtos;
Atom atmWmDelete;
+ Atom atmPrivMap;
} WMInfoRec, *WMInfoPtr;
typedef struct _WMProcArgRec {
@@ -95,6 +95,13 @@ typedef struct _WMProcArgRec {
pthread_mutex_t *ppmServerStarted;
} WMProcArgRec, *WMProcArgPtr;
+typedef struct _XMsgProcArgRec {
+ Display *pDisplay;
+ DWORD dwScreen;
+ WMInfoPtr pWMInfo;
+ pthread_mutex_t *ppmServerStarted;
+} XMsgProcArgRec, *XMsgProcArgPtr;
+
/*
* References to external symbols
@@ -103,6 +110,7 @@ typedef struct _WMProcArgRec {
extern char *display;
extern void ErrorF (const char* /*f*/, ...);
extern Bool g_fCalledSetLocale;
+extern Bool g_fCalledXInitThreads;
/*
@@ -113,7 +121,7 @@ static void
PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode);
static WMMsgNodePtr
-PopMessage (WMMsgQueuePtr pQueue);
+PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo);
static Bool
InitQueue (WMMsgQueuePtr pQueue);
@@ -124,15 +132,18 @@ GetWindowName (Display * pDpy, Window iWin, char **ppName);
static int
SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData);
+static void
+UpdateName (WMInfoPtr pWMInfo, Window iWindow);
+
static void*
winMultiWindowWMProc (void* pArg);
-static Bool
-FlushXEvents (WMInfoPtr pWMInfo);
-
static int
winMultiWindowWMErrorHandler (Display *pDisp, XErrorEvent *e);
+static void *
+winMultiWindowXMsgProc (void *pArg);
+
static void
winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg);
@@ -146,6 +157,7 @@ winMutliWindowWMIOErrorHandler (Display *pDisplay);
static int g_nQueueSize;
static jmp_buf g_jmpEntry;
+static Bool g_shutdown = FALSE;
@@ -212,7 +224,7 @@ PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
}
-#if 0
+#if CYGMULTIWINDOW_DEBUG
/*
* QueueSize - Return the size of the queue
*/
@@ -233,11 +245,11 @@ QueueSize (WMMsgQueuePtr pQueue)
/*
- * PopMessage -
+ * PopMessage - Pop a message from the queue
*/
static WMMsgNodePtr
-PopMessage (WMMsgQueuePtr pQueue)
+PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo)
{
WMMsgNodePtr pNode;
@@ -339,7 +351,7 @@ InitQueue (WMMsgQueuePtr pQueue)
/*
- * GetWindowName -
+ * GetWindowName - Retrieve the title of an X Window
*/
static void
@@ -360,7 +372,9 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
nResult = XGetWMName (pDisplay, iWin, &xtpName);
if (!nResult || !xtpName.value || !xtpName.nitems)
{
+#if CYGMULTIWINDOW_DEBUG
ErrorF ("GetWindowName - XGetWMName failed. No name.\n");
+#endif
return;
}
@@ -375,7 +389,7 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
}
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("XA_STRING %s\n", *ppName);
+ ErrorF ("GetWindowName - XA_STRING %s\n", *ppName);
#endif
}
else
@@ -383,7 +397,7 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
XmbTextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum);
/* */
- if (nNum && *ppList)
+ if (nNum && ppList && *ppList)
{
XFree (xtpName.value);
*ppName = strdup (*ppList);
@@ -391,13 +405,14 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
}
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("%s %s\n", XGetAtomName (pDisplay, xtpName.encoding), *ppName);
+ ErrorF ("GetWindowName - %s %s\n",
+ XGetAtomName (pDisplay, xtpName.encoding), *ppName);
#endif
}
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("-GetWindowName\n");
+ ErrorF ("GetWindowName - Returning\n");
#endif
}
@@ -425,6 +440,66 @@ SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData)
/*
+ * Updates the name of a HWND according to its X WM_NAME property
+ */
+
+static void
+UpdateName (WMInfoPtr pWMInfo, Window iWindow)
+{
+ char *pszName;
+ Atom atmType;
+ int fmtRet;
+ unsigned long items, remain;
+ HWND *retHwnd, hWnd;
+ XWindowAttributes attr;
+
+ hWnd = 0;
+
+ /* See if we can get the cached HWND for this window... */
+ if (XGetWindowProperty (pWMInfo->pDisplay,
+ iWindow,
+ pWMInfo->atmPrivMap,
+ 0,
+ 1,
+ False,
+ pWMInfo->atmPrivMap,
+ &atmType,
+ &fmtRet,
+ &items,
+ &remain,
+ (unsigned char **) &retHwnd) == Success)
+ {
+ if (retHwnd)
+ {
+ hWnd = *retHwnd;
+ XFree (retHwnd);
+ }
+ }
+
+ /* Some sanity checks */
+ if (!hWnd) return;
+ if (!IsWindow (hWnd)) return;
+
+ /* Set the Windows window name */
+ GetWindowName (pWMInfo->pDisplay, iWindow, &pszName);
+ if (pszName)
+ {
+ /* Get the window attributes */
+ XGetWindowAttributes (pWMInfo->pDisplay,
+ iWindow,
+ &attr);
+ if (!attr.override_redirect)
+ {
+ SetWindowText (hWnd, pszName);
+ winUpdateIcon (iWindow);
+ }
+
+ free (pszName);
+ }
+}
+
+
+/*
* winMultiWindowWMProc
*/
@@ -447,7 +522,7 @@ winMultiWindowWMProc (void *pArg)
WMMsgNodePtr pNode;
/* Pop a message off of our queue */
- pNode = PopMessage (&pWMInfo->wmMsgQueue);
+ pNode = PopMessage (&pWMInfo->wmMsgQueue, pWMInfo);
if (pNode == NULL)
{
/* Bail if PopMessage returns without a message */
@@ -496,25 +571,17 @@ winMultiWindowWMProc (void *pArg)
#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);
- }
- }
+ /* Put a note as to the HWND associated with this Window */
+ XChangeProperty (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmPrivMap,
+ pWMInfo->atmPrivMap,
+ 32,
+ PropModeReplace,
+ (unsigned char *) &(pNode->msg.hwndWindow),
+ 1);
+ UpdateName (pWMInfo, pNode->msg.iWindow);
+ winUpdateIcon (pNode->msg.iWindow);
break;
case WM_WM_UNMAP:
@@ -523,7 +590,7 @@ winMultiWindowWMProc (void *pArg)
#endif
/* Unmap the window */
- XUnmapWindow(pWMInfo->pDisplay, pNode->msg.iWindow);
+ XUnmapWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
break;
case WM_WM_KILL:
@@ -571,9 +638,17 @@ winMultiWindowWMProc (void *pArg)
CurrentTime);
break;
- case WM_WM_X_EVENT:
- /* Process all X events in the Window Manager event queue */
- FlushXEvents (pWMInfo);
+ case WM_WM_NAME_EVENT:
+ UpdateName (pWMInfo, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_HINTS_EVENT:
+ winUpdateIcon (pNode->msg.iWindow);
+ break;
+
+ case WM_WM_CHANGE_STATE:
+ /* Minimize the window in Windows */
+ winMinimizeWindow (pNode->msg.iWindow);
break;
default:
@@ -605,71 +680,227 @@ winMultiWindowWMProc (void *pArg)
/*
- * FlushXEvents - Process any pending X events
+ * winMultiWindowWMErrorHandler - Our application specific error handler
*/
-static Bool
-FlushXEvents (WMInfoPtr pWMInfo)
+static int
+winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
{
- XEvent event;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("FlushXEvents ()\n");
-#endif
+ char pszErrorMsg[100];
- /* Process all pending events */
- while (XPending (pWMInfo->pDisplay))
+ if (pErr->request_code == X_ChangeWindowAttributes
+ && pErr->error_code == BadAccess)
{
- /* Get the next event - will not block because one is ready */
- XNextEvent (pWMInfo->pDisplay, &event);
-
+ ErrorF ("winMultiWindowWMErrorHandler - ChangeWindowAttributes "
+ "BadAccess.\n");
#if 0
- /* Branch on the event type */
- switch (event.type)
- {
- }
+ pthread_exit (NULL);
#endif
+ return 0;
}
+
+ XGetErrorText (pDisplay,
+ pErr->error_code,
+ pszErrorMsg,
+ sizeof (pszErrorMsg));
+ ErrorF ("winMultiWindowWMErrorHandler - ERROR: %s\n", pszErrorMsg);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("-FlushXEvents ()\n");
+ if (pErr->error_code == BadWindow
+ || pErr->error_code == BadMatch
+ || pErr->error_code == BadDrawable)
+ {
+#if 0
+ pthread_exit (NULL);
#endif
+ return 0;
+ }
- return True;
+ pthread_exit (NULL);
+ return 0;
}
/*
- * winMultiWindowWMErrorHandler - Our application specific error handler
+ *
*/
-static int
-winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
+static void *
+winMultiWindowXMsgProc (void *pArg)
{
- char pszErrorMsg[100];
+ winWMMessageRec msg;
+ XMsgProcArgPtr pProcArg = (XMsgProcArgPtr) pArg;
+ char pszDisplay[512];
+ int iRetries;
+ XEvent event;
+ Atom atmWmName;
+ Atom atmWmHints;
+ Atom atmWmChange;
+ int iReturn;
+ XIconSize *xis;
- if (pErr->request_code == X_ChangeWindowAttributes
- && pErr->error_code == BadAccess)
+ ErrorF ("winMultiWindowXMsgProc - Hello\n");
+
+ /* Check that argument pointer is not invalid */
+ if (pProcArg == NULL)
{
- ErrorF ("ChangeWindowAttributes BadAccess.\n");
+ ErrorF ("winMultiWindowXMsgProc - pProcArg is NULL, bailing.\n");
pthread_exit (NULL);
}
+
+ ErrorF ("winMultiWindowXMsgProc - Calling pthread_mutex_lock ()\n");
+
+ /* Grab the server started mutex - pause until we get it */
+ iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () failed: %d\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winMultiWindowXMsgProc - pthread_mutex_lock () returned.\n");
+
+ /* Only call XInitThreads once for the whole process */
+ if (!g_fCalledXInitThreads)
+ {
+ /* Allow multiple threads to access Xlib */
+ if (XInitThreads () == 0)
+ {
+ ErrorF ("winMultiWindowXMsgProc - XInitThreads () failed.\n");
+ pthread_exit (NULL);
+ }
+
+ /* Flag that XInitThreads has been called */
+ g_fCalledXInitThreads = TRUE;
+
+ ErrorF ("winMultiWindowXMsgProc - XInitThreads () returned.\n");
+ }
+
+ /* Release the server started mutex */
+ pthread_mutex_unlock (pProcArg->ppmServerStarted);
+
+ ErrorF ("winMultiWindowXMsgProc - pthread_mutex_unlock () returned.\n");
+
+ /* Setup the display connection string x */
+ snprintf (pszDisplay,
+ 512, "127.0.0.1:%s.%d", display, (int)pProcArg->dwScreen);
+
+ /* Print the display connection string */
+ ErrorF ("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay);
- XGetErrorText (pDisplay,
- pErr->error_code,
- pszErrorMsg,
- sizeof (pszErrorMsg));
- ErrorF ("ERROR: %s\n", pszErrorMsg);
+ iRetries = 0;
- if (pErr->error_code==BadWindow
- || pErr->error_code==BadMatch
- || pErr->error_code==BadDrawable)
+ /* Open the X display */
+ do
{
+ /* Try to open the display */
+ pProcArg->pDisplay = XOpenDisplay (pszDisplay);
+ if (pProcArg->pDisplay == NULL)
+ {
+ ErrorF ("winMultiWindowXMsgProc - Could not open display, try: %d, "
+ "sleeping: %d\n\f",
+ iRetries + 1, WIN_CONNECT_DELAY);
+ ++iRetries;
+ sleep (WIN_CONNECT_DELAY);
+ continue;
+ }
+ else
+ break;
+ }
+ while (pProcArg->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
+
+ /* Make sure that the display opened */
+ if (pProcArg->pDisplay == NULL)
+ {
+ ErrorF ("winMultiWindowXMsgProcwinInitMultiWindowWM - "
+ "Failed opening the display, giving up.\n\f");
pthread_exit (NULL);
}
- pthread_exit (NULL);
- return 0;
+ ErrorF ("winMultiWindowXMsgProc - XOpenDisplay () returned and "
+ "successfully opened the display.\n");
+
+ /* Install our error handler */
+ XSetErrorHandler (winMultiWindowWMErrorHandler);
+ XSetIOErrorHandler (winMutliWindowWMIOErrorHandler);
+
+ XSelectInput (pProcArg->pDisplay,
+ RootWindow(pProcArg->pDisplay, pProcArg->dwScreen),
+ SubstructureNotifyMask);
+
+ /* Set up the supported icon sizes */
+ xis = XAllocIconSize ();
+ if (xis)
+ {
+ xis->min_width = xis->min_height = 16;
+ xis->max_width = xis->max_height = 48;
+ xis->width_inc = xis->height_inc = 16;
+ XSetIconSizes (pProcArg->pDisplay,
+ RootWindow (pProcArg->pDisplay, pProcArg->dwScreen),
+ xis,
+ 1);
+ XFree (xis);
+ }
+
+ atmWmName = XInternAtom (pProcArg->pDisplay,
+ "WM_NAME",
+ False);
+ atmWmHints = XInternAtom (pProcArg->pDisplay,
+ "WM_HINTS",
+ False);
+ atmWmChange = XInternAtom (pProcArg->pDisplay,
+ "WM_CHANGE_STATE",
+ False);
+
+ /* Loop until we explicitly break out */
+ while (1)
+ {
+ /* Fetch next event */
+ XNextEvent (pProcArg->pDisplay, &event);
+
+ /* Branch on event type */
+ if (event.type == CreateNotify)
+ {
+ XSelectInput (pProcArg->pDisplay,
+ event.xcreatewindow.window,
+ PropertyChangeMask);
+ }
+ else if (event.type == PropertyNotify
+ && event.xproperty.atom == atmWmName)
+ {
+ memset (&msg, 0, sizeof (msg));
+
+ msg.msg = WM_WM_NAME_EVENT;
+ msg.iWindow = event.xproperty.window;
+
+ /* Other fields ignored */
+ winSendMessageToWM (pProcArg->pWMInfo, &msg);
+ }
+ else if (event.type == PropertyNotify
+ && event.xproperty.atom == atmWmHints)
+ {
+ memset (&msg, 0, sizeof (msg));
+
+ msg.msg = WM_WM_HINTS_EVENT;
+ msg.iWindow = event.xproperty.window;
+
+ /* Other fields ignored */
+ winSendMessageToWM (pProcArg->pWMInfo, &msg);
+ }
+ else if (event.type == ClientMessage
+ && event.xclient.message_type == atmWmChange
+ && event.xclient.data.l[0] == IconicState)
+ {
+ ErrorF ("winMultiWindowXMsgProc - WM_CHANGE_STATE - IconicState\n");
+
+ memset (&msg, 0, sizeof (msg));
+
+ msg.msg = WM_WM_CHANGE_STATE;
+ msg.iWindow = event.xclient.window;
+
+ winSendMessageToWM (pProcArg->pWMInfo, &msg);
+ }
+ }
}
@@ -682,12 +913,14 @@ winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
Bool
winInitWM (void **ppWMInfo,
pthread_t *ptWMProc,
+ pthread_t *ptXMsgProc,
pthread_mutex_t *ppmServerStarted,
int dwScreen)
{
- WMProcArgPtr pArg = (WMProcArgPtr)malloc (sizeof(WMProcArgRec));
- WMInfoPtr pWMInfo = (WMInfoPtr)malloc (sizeof(WMInfoRec));
-
+ WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec));
+ WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec));
+ XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc (sizeof(XMsgProcArgRec));
+
/* Bail if the input parameters are bad */
if (pArg == NULL || pWMInfo == NULL)
{
@@ -714,7 +947,18 @@ winInitWM (void **ppWMInfo,
if (pthread_create (ptWMProc, NULL, winMultiWindowWMProc, pArg))
{
/* Bail if thread creation failed */
- ErrorF ("winInitWM - pthread_create failed.\n");
+ ErrorF ("winInitWM - pthread_create failed for Window Manager.\n");
+ return FALSE;
+ }
+
+ /* Spawn the XNextEvent thread, will send messages to WM */
+ pXMsgArg->dwScreen = dwScreen;
+ pXMsgArg->pWMInfo = pWMInfo;
+ pXMsgArg->ppmServerStarted = ppmServerStarted;
+ if (pthread_create (ptXMsgProc, NULL, winMultiWindowXMsgProc, pXMsgArg))
+ {
+ /* Bail if thread creation failed */
+ ErrorF ("winInitWM - pthread_create failed on XMSG.\n");
return FALSE;
}
@@ -788,21 +1032,28 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
/* Flag that we have called setlocale */
g_fCalledSetLocale = TRUE;
- /* Release the garbage mutex */
+ /* Only call XInitThreads once for the whole process */
+ if (!g_fCalledXInitThreads)
+ {
+ /* Allow multiple threads to access Xlib */
+ if (XInitThreads () == 0)
+ {
+ ErrorF ("winInitMultiWindowWM - XInitThreads () failed.\n");
+ pthread_exit (NULL);
+ }
+
+ /* Flag that XInitThreads has been called */
+ g_fCalledXInitThreads = TRUE;
+
+ ErrorF ("winInitMultiWindowWM - XInitThreads () returned.\n");
+ }
+
+ /* Release the server started 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 */
+ /* Set jump point for IO Error exits */
iReturn = setjmp (g_jmpEntry);
/* Check if we should continue operations */
@@ -814,13 +1065,23 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
iReturn);
pthread_exit (NULL);
}
+ else if (g_shutdown)
+ {
+ /* Shutting down, the X server severed out connection! */
+ ErrorF ("winInitMultiWindowWM - Detected shutdown in progress\n");
+ 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);
+ snprintf (pszDisplay,
+ 512,
+ "127.0.0.1:%s.%d",
+ display,
+ (int) pProcArg->dwScreen);
/* Print the display connection string */
ErrorF ("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay);
@@ -866,6 +1127,9 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
pWMInfo->atmWmDelete = XInternAtom (pWMInfo->pDisplay,
"WM_DELETE_WINDOW",
False);
+ pWMInfo->atmPrivMap = XInternAtom (pWMInfo->pDisplay,
+ WIN_HWND_CACHE,
+ False);
}
@@ -905,3 +1169,15 @@ winMutliWindowWMIOErrorHandler (Display *pDisplay)
return 0;
}
+
+
+/*
+ * Notify the MWM thread we're exiting and not to reconnect
+ */
+
+void
+winDeinitMultiWindowWM ()
+{
+ ErrorF ("winDeinitMultiWindowWM - Noting shutdown in progress\n");
+ g_shutdown = TRUE;
+}
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
new file mode 100755
index 000000000..d90abb61f
--- /dev/null
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -0,0 +1,1005 @@
+/*
+ *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
+ * Earle F. Philhower, III
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwndproc.c,v 1.3 2003/10/08 11:13:03 eich Exp $ */
+
+#include "win.h"
+#include "dixevents.h"
+#include "winmultiwindowclass.h"
+#include "winprefs.h"
+
+/*
+ * External global variables
+ */
+
+extern Bool g_fCursor;
+
+
+/*
+ * Global variables
+ */
+
+HICON g_hiconX = NULL;
+
+
+/*
+ * Local globals
+ */
+
+static UINT_PTR g_uipMousePollingTimerID = 0;
+
+
+/*
+ * Constant defines
+ */
+
+#define MOUSE_POLLING_INTERVAL 500
+#define WIN_MULTIWINDOW_SHAPE YES
+
+
+
+/*
+ * ConstrainSize - Taken from TWM sources - Respects hints for sizing
+ */
+#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) )
+static void
+ConstrainSize (WinXSizeHints hints, int *widthp, int *heightp)
+{
+ int minWidth, minHeight, maxWidth, maxHeight, xinc, yinc, delta;
+ int baseWidth, baseHeight;
+ int dwidth = *widthp, dheight = *heightp;
+
+ if (hints.flags & PMinSize)
+ {
+ minWidth = hints.min_width;
+ minHeight = hints.min_height;
+ }
+ else if (hints.flags & PBaseSize)
+ {
+ minWidth = hints.base_width;
+ minHeight = hints.base_height;
+ }
+ else
+ minWidth = minHeight = 1;
+
+ if (hints.flags & PBaseSize)
+ {
+ baseWidth = hints.base_width;
+ baseHeight = hints.base_height;
+ }
+ else if (hints.flags & PMinSize)
+ {
+ baseWidth = hints.min_width;
+ baseHeight = hints.min_height;
+ }
+ else
+ baseWidth = baseHeight = 0;
+
+ if (hints.flags & PMaxSize)
+ {
+ maxWidth = hints.max_width;
+ maxHeight = hints.max_height;
+ }
+ else
+ {
+ maxWidth = MAXINT;
+ maxHeight = MAXINT;
+ }
+
+ if (hints.flags & PResizeInc)
+ {
+ xinc = hints.width_inc;
+ yinc = hints.height_inc;
+ }
+ else
+ xinc = yinc = 1;
+
+ /*
+ * First, clamp to min and max values
+ */
+ if (dwidth < minWidth)
+ dwidth = minWidth;
+ if (dheight < minHeight)
+ dheight = minHeight;
+
+ if (dwidth > maxWidth)
+ dwidth = maxWidth;
+ if (dheight > maxHeight)
+ dheight = maxHeight;
+
+ /*
+ * Second, fit to base + N * inc
+ */
+ dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth;
+ dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight;
+
+ /*
+ * Third, adjust for aspect ratio
+ */
+
+ /*
+ * The math looks like this:
+ *
+ * minAspectX dwidth maxAspectX
+ * ---------- <= ------- <= ----------
+ * minAspectY dheight maxAspectY
+ *
+ * If that is multiplied out, then the width and height are
+ * invalid in the following situations:
+ *
+ * minAspectX * dheight > minAspectY * dwidth
+ * maxAspectX * dheight < maxAspectY * dwidth
+ *
+ */
+
+ if (hints.flags & PAspect)
+ {
+ if (hints.min_aspect.x * dheight > hints.min_aspect.y * dwidth)
+ {
+ delta = makemult(hints.min_aspect.x * dheight / hints.min_aspect.y - dwidth, xinc);
+ if (dwidth + delta <= maxWidth)
+ dwidth += delta;
+ else
+ {
+ delta = makemult(dheight - dwidth*hints.min_aspect.y/hints.min_aspect.x, yinc);
+ if (dheight - delta >= minHeight)
+ dheight -= delta;
+ }
+ }
+
+ if (hints.max_aspect.x * dheight < hints.max_aspect.y * dwidth)
+ {
+ delta = makemult(dwidth * hints.max_aspect.y / hints.max_aspect.x - dheight, yinc);
+ if (dheight + delta <= maxHeight)
+ dheight += delta;
+ else
+ {
+ delta = makemult(dwidth - hints.max_aspect.x*dheight/hints.max_aspect.y, xinc);
+ if (dwidth - delta >= minWidth)
+ dwidth -= delta;
+ }
+ }
+ }
+
+ /* Return computed values */
+ *widthp = dwidth;
+ *heightp = dheight;
+}
+#undef makemult
+
+
+
+/*
+ * ValidateSizing - Ensures size request respects hints
+ */
+static int
+ValidateSizing (HWND hwnd, WindowPtr pWin,
+ WPARAM wParam, LPARAM lParam)
+{
+ WinXSizeHints sizeHints;
+ RECT *rect;
+ int iWidth, iHeight, iTopBorder;
+ POINT pt;
+
+ /* Invalid input checking */
+ if (pWin==NULL || lParam==0)
+ return FALSE;
+
+ /* No size hints, no checking */
+ if (!winMultiWindowGetWMNormalHints (pWin, &sizeHints))
+ return FALSE;
+
+ /* Avoid divide-by-zero */
+ if (sizeHints.flags & PResizeInc)
+ {
+ if (sizeHints.width_inc == 0) sizeHints.width_inc = 1;
+ if (sizeHints.height_inc == 0) sizeHints.height_inc = 1;
+ }
+
+ rect = (RECT*)lParam;
+
+ iWidth = rect->right - rect->left;
+ iHeight = rect->bottom - rect->top;
+
+ /* Get title bar height, there must be an easier way?! */
+ pt.x = pt.y = 0;
+ ClientToScreen(hwnd, &pt);
+ iTopBorder = pt.y - rect->top;
+
+ /* Now remove size of any borders */
+ iWidth -= 2 * GetSystemMetrics(SM_CXSIZEFRAME);
+ iHeight -= GetSystemMetrics(SM_CYSIZEFRAME) + iTopBorder;
+
+ /* Constrain the size to legal values */
+ ConstrainSize (sizeHints, &iWidth, &iHeight);
+
+ /* Add back the borders */
+ iWidth += 2 * GetSystemMetrics(SM_CXSIZEFRAME);
+ iHeight += GetSystemMetrics(SM_CYSIZEFRAME) + iTopBorder;
+
+ /* Adjust size according to where we're dragging from */
+ switch(wParam) {
+ case WMSZ_TOP:
+ case WMSZ_TOPRIGHT:
+ case WMSZ_BOTTOM:
+ case WMSZ_BOTTOMRIGHT:
+ case WMSZ_RIGHT:
+ rect->right = rect->left + iWidth;
+ break;
+ default:
+ rect->left = rect->right - iWidth;
+ break;
+ }
+ switch(wParam) {
+ case WMSZ_BOTTOM:
+ case WMSZ_BOTTOMRIGHT:
+ case WMSZ_BOTTOMLEFT:
+ case WMSZ_RIGHT:
+ case WMSZ_LEFT:
+ rect->bottom = rect->top + iHeight;
+ break;
+ default:
+ rect->top = rect->bottom - iHeight;
+ break;
+ }
+ return TRUE;
+}
+
+
+/*
+ * 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;
+ Bool fWMMsgInitialized = FALSE;
+ static Bool s_fTracking = FALSE;
+
+ /* 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 */
+ hwndScreen = s_pScreenPriv->hwndScreen;
+
+ /* */
+ wmMsg.msg = 0;
+ wmMsg.hwndWindow = hwnd;
+ wmMsg.iWindow = (Window)GetProp (hwnd, WIN_WID_PROP);
+
+ wmMsg.iX = pWinPriv->iX;
+ wmMsg.iY = pWinPriv->iY;
+ wmMsg.iWidth = pWinPriv->iWidth;
+ wmMsg.iHeight = pWinPriv->iHeight;
+
+ fWMMsgInitialized = TRUE;
+
+#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_INIT_SYS_MENU:
+ /*
+ * Add whatever the setup file wants to for this window
+ */
+ SetupSysMenu ((unsigned long)hwnd);
+ return 0;
+
+ case WM_SYSCOMMAND:
+ /*
+ * Any window menu items go through here
+ */
+ HandleCustomWM_COMMAND ((unsigned long)hwnd, LOWORD(wParam));
+ break;
+
+ case WM_INITMENU:
+ /* Checks/Unchecks any menu items before they are displayed */
+ HandleCustomWM_INITMENU ((unsigned long)hwnd, wParam);
+ break;
+
+ 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);
+
+ /* 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),
+ (LPTSTR) &lpMsgBuf,
+ 0, NULL);
+
+ ErrorF ("winTopLevelWindowProc - BitBlt failed: %s\n",
+ (LPSTR)lpMsgBuf);
+ LocalFree (lpMsgBuf);
+ }
+
+ /* EndPaint frees the DC */
+ EndPaint (hwndScreen, &ps);
+ return 0;
+
+ 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);
+
+ /* Screen Coords from (-X, -Y) -> Root Window (0, 0) */
+ ptMouse.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
+ ptMouse.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ /* 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 (g_fCursor)
+ {
+ /* Hide Windows cursor */
+ g_fCursor = FALSE;
+ ShowCursor (FALSE);
+ }
+
+ /* Kill the timer used to poll mouse events */
+ if (g_uipMousePollingTimerID != 0)
+ {
+ KillTimer (s_pScreenPriv->hwndScreen, WIN_POLLING_MOUSE_TIMER_ID);
+ g_uipMousePollingTimerID = 0;
+ }
+
+ /* 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 (!g_fCursor)
+ {
+ g_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+
+ /*
+ * Timer to poll mouse events. This is needed to make
+ * programs like xeyes follow the mouse properly.
+ */
+ if (g_uipMousePollingTimerID == 0)
+ g_uipMousePollingTimerID = SetTimer (s_pScreenPriv->hwndScreen,
+ WIN_POLLING_MOUSE_TIMER_ID,
+ 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 (!g_fCursor)
+ {
+ g_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+
+ /*
+ * Timer to poll mouse events. This is needed to make
+ * programs like xeyes follow the mouse properly.
+ */
+ if (g_uipMousePollingTimerID == 0)
+ g_uipMousePollingTimerID = SetTimer (s_pScreenPriv->hwndScreen,
+ WIN_POLLING_MOUSE_TIMER_ID,
+ 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);
+
+ 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_KILLFOCUS:
+ /* Pop any pressed keys since we are losing keyboard focus */
+ winKeybdReleaseKeys ();
+ return 0;
+
+ case WM_SYSDEADCHAR:
+ case WM_DEADCHAR:
+ /*
+ * NOTE: We do nothing with WM_*CHAR messages,
+ * nor does the root window, so we can just toss these messages.
+ */
+ return 0;
+
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_*KEYDOWN\n");
+#endif
+
+ /*
+ * Don't pass Alt-F4 key combo to root window,
+ * let Windows translate to WM_CLOSE and close this top-level window.
+ *
+ * NOTE: We purposely don't check the fUseWinKillKey setting because
+ * it should only apply to the key handling for the root window,
+ * not for top-level window-manager windows.
+ *
+ * ALSO NOTE: We do pass Ctrl-Alt-Backspace to the root window
+ * because that is a key combo that no X app should be expecting to
+ * receive, since it has historically been used to shutdown the X server.
+ * Passing Ctrl-Alt-Backspace to the root window preserves that
+ * behavior, assuming that -unixkill has been passed as a parameter.
+ */
+ if (wParam == VK_F4 && (GetKeyState (VK_MENU) & 0x8000))
+ break;
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+ return 0;
+
+ case WM_SYSKEYUP:
+ case WM_KEYUP:
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_*KEYUP\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;
+
+ case WM_ACTIVATE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_ACTIVATE\n");
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+
+ if (s_pScreenPriv != NULL)
+ s_pScreenPriv->fWindowOrderChanged = TRUE;
+
+ if (LOWORD(wParam) != WA_INACTIVE)
+ {
+ /* Tell our Window Manager thread to activate the window */
+ wmMsg.msg = WM_WM_ACTIVATE;
+ if (fWMMsgInitialized)
+ 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;
+
+ 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;
+ if (fWMMsgInitialized)
+ 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;
+ if (fWMMsgInitialized)
+ 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;
+
+ /* Also bail if we're maximizing, we'll do the whole thing in WM_SIZE */
+ {
+ WINDOWPLACEMENT windPlace;
+ windPlace.length = sizeof (WINDOWPLACEMENT);
+
+ /* Get current window placement */
+ GetWindowPlacement (hwnd, &windPlace);
+
+ /* Bail if maximizing */
+ if (windPlace.showCmd == SW_MAXIMIZE
+ || windPlace.showCmd == SW_SHOWMAXIMIZED)
+ 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
+
+ winMoveXWindow (pWin,
+ (LOWORD(lParam) - wBorderWidth (pWin)
+ - GetSystemMetrics (SM_XVIRTUALSCREEN)),
+ (HIWORD(lParam) - wBorderWidth (pWin)
+ - GetSystemMetrics (SM_YVIRTUALSCREEN)));
+ 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);
+
+ /* Position 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 Windows 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 */
+ if (fWMMsgInitialized)
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+
+ if (s_pScreenPriv != NULL)
+ s_pScreenPriv->fWindowOrderChanged = TRUE;
+ return 0;
+
+ case WM_SIZING:
+ /* Need to legalize the size according to WM_NORMAL_HINTS */
+ /* for applications like xterm */
+ return ValidateSizing (hwnd, pWin, wParam, lParam);
+
+ case WM_WINDOWPOSCHANGED:
+ {
+ LPWINDOWPOS pwindPos = (LPWINDOWPOS) lParam;
+
+ /* Bail if window z order was not changed */
+ if (pwindPos->flags & SWP_NOZORDER)
+ break;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - hwndInsertAfter: %p\n",
+ pwindPos->hwndInsertAfter);
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+
+ if (s_pScreenPriv != NULL)
+ s_pScreenPriv->fWindowOrderChanged = TRUE;
+ }
+ return 0;
+
+ case WM_SIZE:
+ /* see dix/window.c */
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_SIZE - %d ms\n", GetTickCount ());
+#endif
+
+ /* Branch on type of resizing occurring */
+ switch (wParam)
+ {
+ case SIZE_MINIMIZED:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tSIZE_MINIMIZED\n");
+#endif
+ if (s_pScreenPriv != NULL)
+ s_pScreenPriv->fWindowOrderChanged = TRUE;
+ break;
+
+ case SIZE_RESTORED:
+ case SIZE_MAXIMIZED:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("SIZE_RESTORED || SIZE_MAXIMIZED\n");
+#endif
+ /* Break out if nothing to do */
+ if (pWinPriv->iWidth == (short) LOWORD(lParam)
+ && pWinPriv->iHeight == (short) HIWORD(lParam))
+ break;
+
+ /* Get the dimensions of the resized 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
+
+ /*
+ * If we're maximizing the window has been moved to upper left
+ * of current screen. Now it is safe for X to know about this.
+ */
+ if (wParam == SIZE_MAXIMIZED)
+ {
+ POINT ptHome;
+
+ /* Flag that we are being maximized and store info for restore */
+ pWinPriv->fNeedRestore = TRUE;
+ pWinPriv->ptRestore.x = pWinPriv->iX;
+ pWinPriv->ptRestore.y = pWinPriv->iY;
+
+ /* Get screen location of window root */
+ ptHome.x = 0;
+ ptHome.y = 0;
+ ClientToScreen (hwnd, &ptHome);
+
+ /* Map from screen (-X,-Y) to (0,0) root coords */
+ winMoveXWindow (pWin,
+ ptHome.x - wBorderWidth (pWin)
+ - GetSystemMetrics (SM_XVIRTUALSCREEN),
+ ptHome.y - wBorderWidth (pWin)
+ - GetSystemMetrics (SM_YVIRTUALSCREEN));
+ }
+ else if (wParam == SIZE_RESTORED && pWinPriv->fNeedRestore)
+ {
+ /* If need restore and !maximized then move to cached position */
+ WINDOWPLACEMENT windPlace;
+
+ windPlace.length = sizeof (WINDOWPLACEMENT);
+
+ GetWindowPlacement (hwnd, &windPlace);
+
+ if (windPlace.showCmd != SW_MAXIMIZE
+ && windPlace.showCmd != SW_SHOWMAXIMIZED)
+ {
+ pWinPriv->fNeedRestore = FALSE;
+ winMoveXWindow (pWin,
+ pWinPriv->ptRestore.x - wBorderWidth (pWin)
+ - GetSystemMetrics (SM_XVIRTUALSCREEN),
+ pWinPriv->ptRestore.y - wBorderWidth (pWin)
+ - GetSystemMetrics (SM_YVIRTUALSCREEN));
+ }
+ }
+
+ /* Perform the resize and notify the X client */
+ winResizeXWindow (pWin,
+ (short) LOWORD(lParam),
+ (short) HIWORD(lParam));
+ break;
+
+ 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;
+
+ default:
+ break;
+ }
+
+ return DefWindowProc (hwnd, message, wParam, lParam);
+}
diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c
index 5fe8b4f38..f7d8a4a1a 100644
--- a/hw/xwin/winnativegdi.c
+++ b/hw/xwin/winnativegdi.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winnativegdi.c,v 1.13 2002/10/17 08:18:22 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winnativegdi.c,v 1.15 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -65,6 +65,17 @@ winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen)
ErrorF ("winCloseScreenNativeGDI - Destroying window\n");
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
/* Kill our window */
if (pScreenPriv->hwndScreen)
{
@@ -207,13 +218,28 @@ winAdjustVideoModeNativeGDI (ScreenPtr pScreen)
/* Query GDI for current display depth */
dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+ pScreenInfo->dwDepth = GetDeviceCaps (hdc, PLANES);
+
+ switch (pScreenInfo->dwDepth) {
+ case 24:
+ case 16:
+ case 15:
+ case 8:
+ break;
+ default:
+ if (dwBPP == 32)
+ pScreenInfo->dwDepth = 24;
+ else
+ pScreenInfo->dwDepth = dwBPP;
+ break;
+ }
/* 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);
+ "depth of %d bits per pixel, %d depth\n", dwBPP, pScreenInfo->dwDepth);
/* Use GDI's depth */
pScreenInfo->dwBPP = dwBPP;
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
index 59d22247e..7cbdb5e53 100644
--- a/hw/xwin/winpfbdd.c
+++ b/hw/xwin/winpfbdd.c
@@ -30,12 +30,19 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpfbdd.c,v 1.18 2003/07/29 21:25:18 dawes Exp $ */
#include "win.h"
/*
+ * External global variables
+ */
+
+extern const GUID _IID_IDirectDraw2;
+
+
+/*
* Create a DirectDraw primary surface
*/
@@ -259,6 +266,17 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
pScreenPriv->pdd = NULL;
}
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
/* Kill our window */
if (pScreenPriv->hwndScreen)
{
diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c
index 519acedf5..43ade059b 100644
--- a/hw/xwin/winpixmap.c
+++ b/hw/xwin/winpixmap.c
@@ -28,7 +28,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpixmap.c,v 1.11 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -50,9 +50,11 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
return NullPixmap;
}
+#if CYGDEBUG
ErrorF ("winCreatePixmap () - w %d h %d d %d bw %d\n",
iWidth, iHeight, iDepth,
PixmapBytePad (iWidth, iDepth));
+#endif
/* Setup pixmap values */
pPixmap->drawable.type = DRAWABLE_PIXMAP;
@@ -112,7 +114,9 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
{
winPrivPixmapPtr pPixmapPriv = NULL;
+#if CYGDEBUG
ErrorF ("winDestroyPixmapNativeGDI ()\n");
+#endif
/* Bail early if there is not a pixmap to destroy */
if (pPixmap == NULL)
@@ -124,8 +128,10 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
/* Get a handle to the pixmap privates */
pPixmapPriv = winGetPixmapPriv (pPixmap);
+#if CYGDEBUG
ErrorF ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n",
pPixmapPriv->hBitmap);
+#endif
/* Decrement reference count, return if nonzero */
--pPixmap->refcnt;
diff --git a/hw/xwin/winpolyline.c b/hw/xwin/winpolyline.c
index 194ecfe46..948c34428 100644
--- a/hw/xwin/winpolyline.c
+++ b/hw/xwin/winpolyline.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winpolyline.c,v 1.3 2001/09/13 08:25:45 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpolyline.c,v 1.4 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -39,5 +39,17 @@ winPolyLineNativeGDI (DrawablePtr pDrawable,
int npt,
DDXPointPtr ppt)
{
- FatalError ("winPolyLine()\n");
+ switch (pGC->lineStyle)
+ {
+ case LineSolid:
+ if (pGC->lineWidth == 0)
+ return miZeroLine (pDrawable, pGC, mode, npt, ppt);
+ else
+ miWideLine (pDrawable, pGC, mode, npt, ppt);
+ break;
+ case LineOnOffDash:
+ case LineDoubleDash:
+ miWideDash (pDrawable, pGC, mode, npt, ppt);
+ break;
+ }
}
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
new file mode 100644
index 000000000..3bea60d3d
--- /dev/null
+++ b/hw/xwin/winprefs.c
@@ -0,0 +1,661 @@
+/*
+ * 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: Earle F. Philhower, III
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winprefs.c,v 1.1 2003/10/02 13:30:11 eich Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/resource.h>
+#include "win.h"
+
+/* Fixups to prevent collisions between Windows and X headers */
+#define ATOM DWORD
+#include <windows.h>
+
+#include "winprefs.h"
+#include "winmultiwindowclass.h"
+
+/* Where will the custom menu commands start counting from? */
+#define STARTMENUID WM_USER
+
+/* From winmultiwindowflex.l, the real parser */
+extern void parse_file (FILE *fp);
+
+/* From winmultiwindowyacc.y, the pref structure loaded by the parser */
+extern WINMULTIWINDOWPREFS pref;
+
+/* The global X default icon */
+extern HICON g_hiconX;
+
+/* Currently in use command ID, incremented each new menu item created */
+static int g_cmdid = STARTMENUID;
+
+
+/* Defined in DIX */
+extern char *display;
+
+/*
+ * Creates or appends a menu from a MENUPARSED structure
+ */
+static HMENU
+MakeMenu (char *name,
+ HMENU editMenu,
+ int editItem)
+{
+ int i;
+ int item;
+ MENUPARSED *m;
+ HMENU hmenu;
+
+ for (i=0; i<pref.menuItems; i++)
+ {
+ if (!strcmp(name, pref.menu[i].menuName))
+ break;
+ }
+
+ /* Didn't find a match, bummer */
+ if (i==pref.menuItems)
+ {
+ ErrorF("MakeMenu: Can't find menu %s\n", name);
+ return NULL;
+ }
+
+ m = &(pref.menu[i]);
+
+ if (editMenu)
+ {
+ hmenu = editMenu;
+ item = editItem;
+ }
+ else
+ {
+ hmenu = CreatePopupMenu();
+ item = 0;
+ }
+
+ /* Add the menu items */
+ for (i=0; i<m->menuItems; i++)
+ {
+ /* Only assign IDs one time... */
+ if ( m->menuItem[i].commandID == 0 )
+ m->menuItem[i].commandID = g_cmdid++;
+
+ switch (m->menuItem[i].cmd)
+ {
+ case CMD_EXEC:
+ case CMD_ALWAYSONTOP:
+ case CMD_RELOAD:
+ InsertMenu (hmenu,
+ item,
+ MF_BYPOSITION|MF_ENABLED|MF_STRING,
+ m->menuItem[i].commandID,
+ m->menuItem[i].text);
+ break;
+
+ case CMD_SEPARATOR:
+ InsertMenu (hmenu,
+ item,
+ MF_BYPOSITION|MF_SEPARATOR,
+ 0,
+ NULL);
+ break;
+
+ case CMD_MENU:
+ /* Recursive! */
+ InsertMenu (hmenu,
+ item,
+ MF_BYPOSITION|MF_POPUP|MF_ENABLED|MF_STRING,
+ (UINT_PTR)MakeMenu (m->menuItem[i].param, 0, 0),
+ m->menuItem[i].text);
+ break;
+ }
+
+ /* If item==-1 (means to add at end of menu) don't increment) */
+ if (item>=0)
+ item++;
+ }
+
+ return hmenu;
+}
+
+
+/*
+ * Callback routine that is executed once per window class.
+ * Removes or creates custom window settings depending on LPARAM
+ */
+static BOOL CALLBACK
+ReloadEnumWindowsProc (HWND hwnd, LPARAM lParam)
+{
+ char szClassName[1024];
+ HICON hicon;
+
+ if (!GetClassName (hwnd, szClassName, 1024))
+ return TRUE;
+
+ if (strncmp (szClassName, WINDOW_CLASS_X, strlen (WINDOW_CLASS_X)))
+ /* Not one of our windows... */
+ return TRUE;
+
+ /* It's our baby, either clean or dirty it */
+ if (lParam==FALSE)
+ {
+ hicon = (HICON)GetClassLong(hwnd, GCL_HICON);
+
+ /* Unselect any icon in the class structure */
+ SetClassLong (hwnd, GCL_HICON, (LONG)LoadIcon (NULL, IDI_APPLICATION));
+
+ /* If it's generated on-the-fly, get rid of it, will regen */
+ if (!winIconIsOverride((unsigned long)hicon) && hicon!=g_hiconX)
+ DestroyIcon (hicon);
+
+ /* Remove any menu additions, use bRevert flag */
+ GetSystemMenu (hwnd, TRUE);
+
+ /* This window is now clean of our taint */
+ }
+ else
+ {
+ /* Make the icon default, dynamic, of from xwinrc */
+ SetClassLong (hwnd, GCL_HICON, (LONG)g_hiconX);
+ winUpdateIcon ((Window)GetProp (hwnd, WIN_WID_PROP));
+ /* Update the system menu for this window */
+ SetupSysMenu ((unsigned long)hwnd);
+
+ /* That was easy... */
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Removes any custom icons in classes, custom menus, etc.
+ * Frees all members in pref structure.
+ * Reloads the preferences file.
+ * Set custom icons and menus again.
+ */
+static void
+ReloadPrefs ()
+{
+ int i;
+
+ /* First, iterate over all windows replacing their icon with system */
+ /* default one and deleting any custom system menus */
+ EnumWindows (ReloadEnumWindowsProc, FALSE);
+
+ /* Now, free/clear all info from our prefs structure */
+ for (i=0; i<pref.menuItems; i++)
+ free (pref.menu[i].menuItem);
+ free (pref.menu);
+ pref.menu = NULL;
+ pref.menuItems = 0;
+
+ pref.rootMenuName[0] = 0;
+
+ free (pref.sysMenu);
+ pref.sysMenuItems = 0;
+
+ pref.defaultSysMenuName[0] = 0;
+ pref.defaultSysMenuPos = 0;
+
+ pref.iconDirectory[0] = 0;
+ pref.defaultIconName[0] = 0;
+
+ for (i=0; i<pref.iconItems; i++)
+ if (pref.icon[i].hicon)
+ DestroyIcon ((HICON)pref.icon[i].hicon);
+ free (pref.icon);
+ pref.icon = NULL;
+ pref.iconItems = 0;
+
+ /* Free global default X icon */
+ DestroyIcon (g_hiconX);
+
+ /* Reset the custom command IDs */
+ g_cmdid = STARTMENUID;
+
+ /* Load the updated resource file */
+ LoadPreferences();
+
+ /* Define global icon, load it */
+ g_hiconX = (HICON)winOverrideDefaultIcon();
+ if (!g_hiconX)
+ g_hiconX = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
+
+ /* Rebuild the icons and menus */
+ EnumWindows (ReloadEnumWindowsProc, TRUE);
+
+ /* Whew, done */
+}
+
+/*
+ * Check/uncheck the ALWAYSONTOP items in this menu
+ */
+void
+HandleCustomWM_INITMENU(unsigned long hwndIn,
+ unsigned long hmenuIn)
+{
+ HWND hwnd;
+ HMENU hmenu;
+ DWORD dwExStyle;
+ int i, j;
+
+ hwnd = (HWND)hwndIn;
+ hmenu = (HMENU)hmenuIn;
+ if (!hwnd || !hmenu)
+ return;
+
+ if (GetWindowLong (hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)
+ dwExStyle = MF_BYCOMMAND | MF_CHECKED;
+ else
+ dwExStyle = MF_BYCOMMAND | MF_UNCHECKED;
+
+ for (i=0; i<pref.menuItems; i++)
+ for (j=0; j<pref.menu[i].menuItems; j++)
+ if (pref.menu[i].menuItem[j].cmd==CMD_ALWAYSONTOP)
+ CheckMenuItem (hmenu, pref.menu[i].menuItem[j].commandID, dwExStyle );
+
+}
+
+/*
+ * Searches for the custom WM_COMMAND command ID and performs action
+ */
+int
+HandleCustomWM_COMMAND (unsigned long hwndIn,
+ int command)
+{
+ HWND hwnd;
+ int i, j;
+ MENUPARSED *m;
+ DWORD dwExStyle;
+
+ hwnd = (HWND)hwndIn;
+
+ if (!command)
+ return 0;
+
+ for (i=0; i<pref.menuItems; i++)
+ {
+ m = &(pref.menu[i]);
+ for (j=0; j<m->menuItems; j++)
+ {
+ if (command==m->menuItem[j].commandID)
+ {
+ /* Match! */
+ switch(m->menuItem[j].cmd)
+ {
+ case CMD_EXEC:
+ if (fork()==0)
+ {
+ struct rlimit rl;
+ unsigned long i;
+
+ /* Close any open descriptors except for STD* */
+ getrlimit (RLIMIT_NOFILE, &rl);
+ for (i = STDERR_FILENO+1; i < rl.rlim_cur; i++)
+ close(i);
+
+ /* Disassociate any TTYs */
+ setsid();
+
+ execl ("/bin/sh",
+ "/bin/sh",
+ "-c",
+ m->menuItem[j].param,
+ NULL);
+ exit (0);
+ }
+ else
+ return 0;
+ break;
+
+ case CMD_ALWAYSONTOP:
+ if (!hwnd)
+ return 0;
+
+ /* Get extended window style */
+ dwExStyle = GetWindowLong (hwnd, GWL_EXSTYLE);
+
+ /* Handle topmost windows */
+ if (dwExStyle & WS_EX_TOPMOST)
+ SetWindowPos (hwnd,
+ HWND_NOTOPMOST,
+ 0, 0,
+ 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE);
+ else
+ SetWindowPos (hwnd,
+ HWND_TOPMOST,
+ 0, 0,
+ 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE);
+ return 0;
+
+ case CMD_RELOAD:
+ ReloadPrefs();
+ return 0;
+
+ default:
+ return 0;
+ }
+ } /* match */
+ } /* for j */
+ } /* for i */
+
+ return 0;
+}
+
+
+/*
+ * Add the default or a custom menu depending on the class match
+ */
+void
+SetupSysMenu (unsigned long hwndIn)
+{
+ HWND hwnd;
+ HMENU sys;
+ int i;
+ WindowPtr pWin;
+ char *res_name, *res_class;
+
+ hwnd = (HWND)hwndIn;
+ if (!hwnd)
+ return;
+
+ pWin = GetProp (hwnd, WIN_WINDOW_PROP);
+
+ sys = GetSystemMenu (hwnd, FALSE);
+ if (!sys)
+ return;
+
+ if (pWin)
+ {
+ /* First see if there's a class match... */
+ if (winMultiWindowGetClassHint (pWin, &res_name, &res_class))
+ {
+ for (i=0; i<pref.sysMenuItems; i++)
+ {
+ if (!strcmp(pref.sysMenu[i].match, res_name) ||
+ !strcmp(pref.sysMenu[i].match, res_class) )
+ {
+ free(res_name);
+ free(res_class);
+
+ MakeMenu (pref.sysMenu[i].menuName, sys,
+ pref.sysMenu[i].menuPos==AT_START?0:-1);
+ return;
+ }
+ }
+
+ /* No match, just free alloc'd strings */
+ free(res_name);
+ free(res_class);
+ } /* Found wm_class */
+ } /* if pwin */
+
+ /* Fallback to system default */
+ if (pref.defaultSysMenuName[0])
+ {
+ if (pref.defaultSysMenuPos==AT_START)
+ MakeMenu (pref.defaultSysMenuName, sys, 0);
+ else
+ MakeMenu (pref.defaultSysMenuName, sys, -1);
+ }
+}
+
+
+/*
+ * Possibly add a menu to the toolbar icon
+ */
+void
+SetupRootMenu (unsigned long hmenuRoot)
+{
+ HMENU root;
+
+ root = (HMENU)hmenuRoot;
+ if (!root)
+ return;
+
+ if (pref.rootMenuName[0])
+ {
+ MakeMenu(pref.rootMenuName, root, 0);
+ }
+}
+
+
+/*
+ * Check for and return an overridden default ICON specified in the prefs
+ */
+unsigned long
+winOverrideDefaultIcon()
+{
+ HICON hicon;
+ char fname[PATH_MAX+NAME_MAX+2];
+
+ if (pref.defaultIconName[0])
+ {
+ /* Make sure we have a dir with trailing backslash */
+ /* Note we are using _Windows_ paths here, not cygwin */
+ strcpy (fname, pref.iconDirectory);
+ if (pref.iconDirectory[0])
+ if (fname[strlen(fname)-1]!='\\')
+ strcat (fname, "\\");
+ strcat (fname, pref.defaultIconName);
+
+ hicon = (HICON)LoadImage(NULL,
+ fname,
+ IMAGE_ICON,
+ 0, 0,
+ LR_DEFAULTSIZE|LR_LOADFROMFILE);
+ if (hicon==NULL)
+ ErrorF ("winOverrideDefaultIcon: LoadIcon(%s) failed\n", fname);
+
+ return (unsigned long)hicon;
+ }
+
+ return 0;
+}
+
+
+/*
+ * Check for a match of the window class to one specified in the
+ * ICONS{} section in the prefs file, and load the icon from a file
+ */
+unsigned long
+winOverrideIcon (unsigned long longWin)
+{
+ WindowPtr pWin = (WindowPtr) longWin;
+ char *res_name, *res_class;
+ int i;
+ HICON hicon;
+ char fname[PATH_MAX+NAME_MAX+2];
+ char *wmName;
+
+ if (pWin==NULL)
+ return 0;
+
+ /* If we can't find the class, we can't override from default! */
+ if (!winMultiWindowGetClassHint (pWin, &res_name, &res_class))
+ return 0;
+
+ winMultiWindowGetWMName (pWin, &wmName);
+
+ for (i=0; i<pref.iconItems; i++) {
+ if (!strcmp(pref.icon[i].match, res_name) ||
+ !strcmp(pref.icon[i].match, res_class) ||
+ (wmName && strstr(wmName, pref.icon[i].match)))
+ {
+ free (res_name);
+ free (res_class);
+ if (wmName)
+ free (wmName);
+
+ if (pref.icon[i].hicon)
+ return pref.icon[i].hicon;
+
+ /* Make sure we have a dir with trailing backslash */
+ /* Note we are using _Windows_ paths here, not cygwin */
+ strcpy (fname, pref.iconDirectory);
+ if (pref.iconDirectory[0])
+ if (fname[strlen(fname)-1]!='\\')
+ strcat (fname, "\\");
+ strcat (fname, pref.icon[i].iconFile);
+
+ hicon = (HICON)LoadImage(NULL,
+ fname,
+ IMAGE_ICON,
+ 0, 0,
+ LR_DEFAULTSIZE|LR_LOADFROMFILE);
+ if (hicon==NULL)
+ ErrorF ("winOverrideIcon: LoadIcon(%s) failed\n", fname);
+
+ pref.icon[i].hicon = (unsigned long)hicon;
+ return (unsigned long)hicon;
+ }
+ }
+
+ /* Didn't find the icon, fail gracefully */
+ free (res_name);
+ free (res_class);
+ if (wmName)
+ free (wmName);
+
+ return 0;
+}
+
+
+/*
+ * Should we free this icon or leave it in memory (is it part of our
+ * ICONS{} overrides)?
+ */
+int
+winIconIsOverride(unsigned hiconIn)
+{
+ HICON hicon;
+ int i;
+
+ hicon = (HICON)hiconIn;
+
+ if (!hicon)
+ return 0;
+
+ for (i=0; i<pref.iconItems; i++)
+ if ((HICON)pref.icon[i].hicon == hicon)
+ return 1;
+
+ return 0;
+}
+
+
+
+/*
+ * Try and open ~/.XWinrc and /usr/X11R6/lib/X11/system.XWinrc
+ * Load it into prefs structure for use by other functions
+ */
+void
+LoadPreferences ()
+{
+ char *home;
+ char fname[PATH_MAX+NAME_MAX+2];
+ FILE *prefFile;
+ char szDisplay[512];
+ char *szEnvDisplay;
+ int i, j;
+ char param[PARAM_MAX+1];
+ char *srcParam, *dstParam;
+
+ /* First, clear all preference settings */
+ memset (&pref, 0, sizeof(pref));
+ prefFile = NULL;
+
+ /* Now try and find a ~/.xwinrc file */
+ home = getenv ("HOME");
+ if (home)
+ {
+ strcpy (fname, home);
+ if (fname[strlen(fname)-1]!='/')
+ strcat (fname, "/");
+ strcat (fname, ".XWinrc");
+
+ prefFile = fopen (fname, "r");
+ }
+
+ /* No home file found, check system default */
+ if (!prefFile)
+ prefFile = fopen (PROJECTROOT"/lib/X11/system.XWinrc", "r");
+
+ /* If we could open it, then read the settings and close it */
+ if (prefFile)
+ {
+ parse_file (prefFile);
+ fclose (prefFile);
+ }
+
+ /* Setup a DISPLAY environment variable, need to allocate on heap */
+ /* because putenv doesn't copy the argument... */
+ snprintf (szDisplay, 512, "DISPLAY=127.0.0.1:%s.0", display);
+ szEnvDisplay = (char *)(malloc (strlen(szDisplay)+1));
+ if (szEnvDisplay)
+ {
+ strcpy (szEnvDisplay, szDisplay);
+ putenv (szEnvDisplay);
+ }
+
+ /* Replace any "%display%" in menu commands with display string */
+ snprintf (szDisplay, 512, "127.0.0.1:%s.0", display);
+ for (i=0; i<pref.menuItems; i++)
+ {
+ for (j=0; j<pref.menu[i].menuItems; j++)
+ {
+ if (pref.menu[i].menuItem[j].cmd==CMD_EXEC)
+ {
+ srcParam = pref.menu[i].menuItem[j].param;
+ dstParam = param;
+ while (*srcParam) {
+ if (!strncmp(srcParam, "%display%", 9))
+ {
+ memcpy (dstParam, szDisplay, strlen(szDisplay));
+ dstParam += strlen(szDisplay);
+ srcParam += 9;
+ }
+ else
+ {
+ *dstParam = *srcParam;
+ dstParam++;
+ srcParam++;
+ }
+ }
+ *dstParam = 0;
+ strcpy (pref.menu[i].menuItem[j].param, param);
+ } /* cmd==cmd_exec */
+ } /* for all menuitems */
+ } /* for all menus */
+
+}
+
diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h
new file mode 100644
index 000000000..ae1cb07d8
--- /dev/null
+++ b/hw/xwin/winprefs.h
@@ -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: Earle F. Philhower, III
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winprefs.h,v 1.1 2003/10/02 13:30:11 eich Exp $ */
+
+/* Need to know how long paths can be... */
+#include <limits.h>
+
+#ifndef NAME_MAX
+#define NAME_MAX PATH_MAX
+#endif
+#define MENU_MAX 128 /* Maximum string length of a menu name or item */
+#define PARAM_MAX (4*PATH_MAX) /* Maximim length of a parameter to a MENU */
+
+
+/* Supported commands in a MENU {} statement */
+typedef enum MENUCOMMANDTYPE
+{
+ CMD_EXEC, /* /bin/sh -c the parameter */
+ CMD_MENU, /* Display a popup menu named param */
+ CMD_SEPARATOR, /* Menu separator */
+ CMD_ALWAYSONTOP, /* Toggle always-on-top mode */
+ CMD_RELOAD /* Reparse the .XWINRC file */
+} MENUCOMMANDTYPE;
+
+/* Where to place a system menu */
+typedef enum MENUPOSITION
+{
+ AT_START, /* Place menu at the top of the system menu */
+ AT_END /* Put it at the bottom of the menu (default) */
+} MENUPOSITION;
+
+/* Menu item definitions */
+typedef struct MENUITEM
+{
+ char text[MENU_MAX+1]; /* To be displayed in menu */
+ MENUCOMMANDTYPE cmd; /* What should it do? */
+ char param[PARAM_MAX+1]; /* Any parameters? */
+ unsigned long commandID; /* Windows WM_COMMAND ID assigned at runtime */
+} MENUITEM;
+
+/* A completely read in menu... */
+typedef struct MENUPARSED
+{
+ char menuName[MENU_MAX+1]; /* What's it called in the text? */
+ MENUITEM *menuItem; /* Array of items */
+ int menuItems; /* How big's the array? */
+} MENUPARSED;
+
+/* To map between a window and a system menu to add for it */
+typedef struct SYSMENUITEM
+{
+ char match[MENU_MAX+1]; /* String to look for to apply this sysmenu */
+ char menuName[MENU_MAX+1]; /* Which menu to show? Used to set *menu */
+ MENUPOSITION menuPos; /* Where to place it (ignored in root) */
+} SYSMENUITEM;
+
+/* To redefine icons for certain window types */
+typedef struct ICONITEM
+{
+ char match[MENU_MAX+1]; /* What string to search for? */
+ char iconFile[PATH_MAX+NAME_MAX+2]; /* Icon location, WIN32 path */
+ unsigned long hicon; /* LoadImage() result */
+} ICONITEM;
+
+typedef struct WINMULTIWINDOWPREFS
+{
+ /* Menu information */
+ MENUPARSED *menu; /* Array of created menus */
+ int menuItems; /* How big? */
+
+ /* Taskbar menu settings */
+ char rootMenuName[MENU_MAX+1]; /* Menu for taskbar icon */
+
+ /* System menu addition menus */
+ SYSMENUITEM *sysMenu;
+ int sysMenuItems;
+
+ /* Which menu to add to unmatched windows? */
+ char defaultSysMenuName[MENU_MAX+1];
+ MENUPOSITION defaultSysMenuPos; /* Where to place it */
+
+ /* Icon information */
+ char iconDirectory[PATH_MAX+1]; /* Where do the .icos lie? (Win32 path) */
+ char defaultIconName[NAME_MAX+1]; /* Replacement for x.ico */
+
+ ICONITEM *icon;
+ int iconItems;
+
+} WINMULTIWINDOWPREFS;
+
+
+
+
+/* Functions */
+void
+LoadPreferences();
+
+void
+SetupRootMenu (unsigned long hmenuRoot);
+
+void
+SetupSysMenu (unsigned long hwndIn);
+
+void
+HandleCustomWM_INITMENU(unsigned long hwndIn,
+ unsigned long hmenuIn);
+
+int
+HandleCustomWM_COMMAND (unsigned long hwndIn,
+ int command);
+
+int
+winIconIsOverride (unsigned hiconIn);
+
+unsigned long
+winOverrideIcon (unsigned long longpWin);
+
+unsigned long
+winOverrideDefaultIcon();
+
diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l
new file mode 100644
index 000000000..8eda8e6c2
--- /dev/null
+++ b/hw/xwin/winprefslex.l
@@ -0,0 +1,113 @@
+%{ # -*- C -*-
+/*
+ * 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: Earle F. Philhower, III
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winprefslex.l,v 1.1 2003/10/02 13:30:11 eich Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "winprefsyacc.h"
+
+extern YYSTYPE yylval;
+extern char *yytext;
+extern int yyparse();
+
+extern void ErrorF (const char* /*f*/, ...);
+
+int yylineno;
+
+/* Copy the parsed string, must be free()d in yacc parser */
+static char *makestr(char *str)
+{
+ char *ptr;
+ ptr = (char*)malloc (strlen(str)+1);
+ if (!ptr)
+ {
+ ErrorF ("winMultiWindowLex:makestr() out of memory\n");
+ exit (-1);
+ }
+ strcpy(ptr, str);
+ return ptr;
+}
+
+%}
+
+%option yylineno
+
+%%
+\#.*[\r\n] { /* comment */ return NEWLINE; }
+\/\/.*[\r\n] { /* comment */ return NEWLINE; }
+[\r\n] { return NEWLINE; }
+[ \t]+ { /* ignore whitespace */ }
+[mM][eE][nN][uU] { return MENU; }
+[iI][cC][oO][nN][dD][iI][rR][eE][cC][tT][oO][rR][yY] { return ICONDIRECTORY; }
+[dD][eE][fF][aA][uU][lL][tT][iI][cC][oO][nN] { return DEFAULTICON; }
+[iI][cC][oO][nN][sS] { return ICONS; }
+[rR][oO][oO][tT][mM][eE][nN][uU] { return ROOTMENU; }
+[dD][eE][fF][aA][uU][lL][tT][sS][yY][sS][mM][eE][nN][uU] { return DEFAULTSYSMENU; }
+[sS][yY][sS][mM][eE][nN][uU] { return SYSMENU; }
+[sS][eE][pP][aA][rR][aA][tT][oO][rR] { return SEPARATOR; }
+[aA][tT][sS][tT][aA][rR][tT] { return ATSTART; }
+[aA][tT][eE][nN][dD] { return ATEND; }
+[eE][xX][eE][cC] { return EXEC; }
+[aA][lL][wW][aA][yY][sS][oO][nN][tT][oO][pP] { return ALWAYSONTOP; }
+[dD][eE][bB][uU][gG] { return DEBUG; }
+[rR][eE][lL][oO][aA][dD] { return RELOAD; }
+"{" { return LB; }
+"}" { return RB; }
+"\""[^\"\r\n]+"\"" { yylval.sVal = makestr(yytext+1); \
+ yylval.sVal[strlen(yylval.sVal)-1] = 0; \
+ return STRING; }
+[^ \t\r\n]+ { yylval.sVal = makestr(yytext); \
+ return STRING; }
+%%
+
+/*
+ * Run-of-the mill requirement for yacc
+ */
+int
+yywrap ()
+{
+ return 1;
+}
+
+/*
+ * Run a file through the yacc parser
+ */
+void
+parse_file (FILE *file)
+{
+ if (!file)
+ return;
+
+ yylineno = 1;
+ yyin = file;
+ yyparse ();
+}
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y
new file mode 100644
index 000000000..a6ffc7207
--- /dev/null
+++ b/hw/xwin/winprefsyacc.y
@@ -0,0 +1,334 @@
+%{
+/*
+ * 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: Earle F. Philhower, III
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winprefsyacc.y,v 1.1 2003/10/02 13:30:11 eich Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "winprefs.h"
+
+/* The following give better error messages in bison at the cost of a few KB */
+#define YYERROR_VERBOSE 1
+
+/* The global pref settings */
+WINMULTIWINDOWPREFS pref;
+
+/* The working menu */
+static MENUPARSED menu;
+
+/* Functions for parsing the tokens into out structure */
+/* Defined at the end section of this file */
+
+static void SetIconDirectory (char *path);
+static void SetDefaultIcon (char *fname);
+static void SetRootMenu (char *menu);
+static void SetDefaultSysMenu (char *menu, int pos);
+
+static void OpenMenu(char *menuname);
+static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param);
+static void CloseMenu();
+
+static void OpenIcons();
+static void AddIconLine(char *matchstr, char *iconfile);
+static void CloseIcons();
+
+static void OpenSysMenu();
+static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
+static void CloseSysMenu();
+
+static int yyerror (char *s);
+
+extern void ErrorF (const char* /*f*/, ...);
+extern char *yytext;
+extern int yylex();
+
+%}
+
+%union {
+ char *sVal;
+ int iVal;
+}
+
+%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS DEFAULTSYSMENU
+%token SYSMENU ROOTMENU SEPARATOR ATSTART ATEND EXEC ALWAYSONTOP DEBUG
+%token RELOAD
+
+%token <sVal> STRING
+%type <iVal> atspot
+
+%%
+
+input: /* empty */
+ | input line
+ ;
+
+line: NEWLINE
+ | command
+ ;
+
+
+newline_or_nada:
+ | NEWLINE newline_or_nada
+ ;
+
+command: defaulticon
+ | icondirectory
+ | menu
+ | icons
+ | sysmenu
+ | rootmenu
+ | defaultsysmenu
+ | debug
+ ;
+
+rootmenu: ROOTMENU STRING NEWLINE { SetRootMenu($2); free($2); }
+ ;
+
+defaultsysmenu: DEFAULTSYSMENU STRING atspot NEWLINE { SetDefaultSysMenu($2, $3); free($2); }
+ ;
+
+defaulticon: DEFAULTICON STRING NEWLINE { SetDefaultIcon($2); free($2); }
+ ;
+
+icondirectory: ICONDIRECTORY STRING NEWLINE { SetIconDirectory($2); free($2); }
+ ;
+
+menuline: SEPARATOR NEWLINE newline_or_nada { AddMenuLine("-", CMD_SEPARATOR, ""); }
+ | STRING ALWAYSONTOP NEWLINE newline_or_nada { AddMenuLine($1, CMD_ALWAYSONTOP, ""); free($1); }
+ | STRING EXEC STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_EXEC, $3); free($1); free($3); }
+ | STRING MENU STRING NEWLINE newline_or_nada { AddMenuLine($1, CMD_MENU, $3); free($1); free($3); }
+ | STRING RELOAD NEWLINE newline_or_nada { AddMenuLine($1, CMD_RELOAD, ""); free($1); }
+ ;
+
+menulist: menuline
+ | menuline menulist
+ ;
+
+menu: MENU STRING LB { OpenMenu($2); free($2); } newline_or_nada menulist RB {CloseMenu();}
+ ;
+
+iconline: STRING STRING NEWLINE newline_or_nada { AddIconLine($1, $2); free($1); free($2); }
+ ;
+
+iconlist: iconline
+ | iconline iconlist
+ ;
+
+icons: ICONS LB {OpenIcons();} newline_or_nada iconlist RB {CloseIcons();}
+ ;
+
+atspot: { $$=AT_END; }
+ | ATSTART { $$=AT_START; }
+ | ATEND { $$=AT_END; }
+ ;
+
+sysmenuline: STRING STRING atspot NEWLINE newline_or_nada { AddSysMenuLine($1, $2, $3); free($1); free($2); }
+ ;
+
+sysmenulist: sysmenuline
+ | sysmenuline sysmenulist
+ ;
+
+sysmenu: SYSMENU LB NEWLINE {OpenSysMenu();} newline_or_nada sysmenulist RB {CloseSysMenu();}
+ ;
+
+debug: DEBUG STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($2); }
+ ;
+
+
+%%
+/*
+ * Errors in parsing abort and print log messages
+ */
+static int
+yyerror (char *s)
+{
+ extern int yylineno; /* Handled by flex internally */
+
+ ErrorF("LoadPreferences: %s line %d\n", s, yylineno);
+ return 1;
+}
+
+/* Miscellaneous functions to store TOKENs into the structure */
+static void
+SetIconDirectory (char *path)
+{
+ strncpy (pref.iconDirectory, path, PATH_MAX);
+ pref.iconDirectory[PATH_MAX] = 0;
+}
+
+static void
+SetDefaultIcon (char *fname)
+{
+ strncpy (pref.defaultIconName, fname, NAME_MAX);
+ pref.defaultIconName[NAME_MAX] = 0;
+}
+
+static void
+SetRootMenu (char *menu)
+{
+ strncpy (pref.rootMenuName, menu, MENU_MAX);
+ pref.rootMenuName[MENU_MAX] = 0;
+}
+
+static void
+SetDefaultSysMenu (char *menu, int pos)
+{
+ strncpy (pref.defaultSysMenuName, menu, MENU_MAX);
+ pref.defaultSysMenuName[MENU_MAX] = 0;
+ pref.defaultSysMenuPos = pos;
+}
+
+static void
+OpenMenu (char *menuname)
+{
+ if (menu.menuItem) free(menu.menuItem);
+ menu.menuItem = NULL;
+ strncpy(menu.menuName, menuname, MENU_MAX);
+ menu.menuName[MENU_MAX] = 0;
+ menu.menuItems = 0;
+}
+
+static void
+AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param)
+{
+ if (menu.menuItem==NULL)
+ menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM));
+ else
+ menu.menuItem = (MENUITEM*)
+ realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
+
+ strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX);
+ menu.menuItem[menu.menuItems].text[MENU_MAX] = 0;
+
+ menu.menuItem[menu.menuItems].cmd = cmd;
+
+ strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX);
+ menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0;
+
+ menu.menuItem[menu.menuItems].commandID = 0;
+
+ menu.menuItems++;
+}
+
+static void
+CloseMenu ()
+{
+ if (menu.menuItem==NULL || menu.menuItems==0)
+ {
+ ErrorF("LoadPreferences: Empty menu detected\n");
+ return;
+ }
+
+ if (pref.menuItems)
+ pref.menu = (MENUPARSED*)
+ realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
+ else
+ pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED));
+
+ memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED));
+ pref.menuItems++;
+
+ memset (&menu, 0, sizeof(MENUPARSED));
+}
+
+static void
+OpenIcons ()
+{
+ if (pref.icon != NULL) {
+ ErrorF("LoadPreferences: Redefining icon mappings\n");
+ free(pref.icon);
+ pref.icon = NULL;
+ }
+ pref.iconItems = 0;
+}
+
+static void
+AddIconLine (char *matchstr, char *iconfile)
+{
+ if (pref.icon==NULL)
+ pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM));
+ else
+ pref.icon = (ICONITEM*)
+ realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
+
+ strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX);
+ pref.icon[pref.iconItems].match[MENU_MAX] = 0;
+
+ strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1);
+ pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0;
+
+ pref.icon[pref.iconItems].hicon = 0;
+
+ pref.iconItems++;
+}
+
+static void
+CloseIcons ()
+{
+}
+
+static void
+OpenSysMenu ()
+{
+ if (pref.sysMenu != NULL) {
+ ErrorF("LoadPreferences: Redefining system menu\n");
+ free(pref.sysMenu);
+ pref.sysMenu = NULL;
+ }
+ pref.sysMenuItems = 0;
+}
+
+static void
+AddSysMenuLine (char *matchstr, char *menuname, int pos)
+{
+ if (pref.sysMenu==NULL)
+ pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM));
+ else
+ pref.sysMenu = (SYSMENUITEM*)
+ realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
+
+ strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX);
+ pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0;
+
+ strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX);
+ pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0;
+
+ pref.sysMenu[pref.sysMenuItems].menuPos = pos;
+
+ pref.sysMenuItems++;
+}
+
+static void
+CloseSysMenu ()
+{
+}
+
diff --git a/hw/xwin/winpushpxl.c b/hw/xwin/winpushpxl.c
new file mode 100644
index 000000000..deb9629d7
--- /dev/null
+++ b/hw/xwin/winpushpxl.c
@@ -0,0 +1,226 @@
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpushpxl.c,v 1.1 2003/08/07 23:47:58 alanh 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.
+
+******************************************************************/
+#include "X.h"
+#include "gcstruct.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "miscstruct.h"
+#include "../mfb/maskbits.h"
+#include "mi.h"
+
+#define NPT 128
+
+/* winPushPixels -- squeegees the fill style of pGC through pBitMap
+ * into pDrawable. pBitMap is a stencil (dx by dy of it is used, it may
+ * be bigger) which is placed on the drawable at xOrg, yOrg. Where a 1 bit
+ * is set in the bitmap, the fill style is put onto the drawable using
+ * the GC's logical function. The drawable is not changed where the bitmap
+ * has a zero bit or outside the area covered by the stencil.
+
+WARNING:
+ this code works if the 1-bit deep pixmap format returned by GetSpans
+is the same as the format defined by the mfb code (i.e. 32-bit padding
+per scanline, scanline unit = 32 bits; later, this might mean
+bitsizeof(int) padding and sacnline unit == bitsizeof(int).)
+
+ */
+
+/*
+ * in order to have both (MSB_FIRST and LSB_FIRST) versions of this
+ * in the server, we need to rename one of them
+ */
+void
+winPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg)
+ GCPtr pGC;
+ PixmapPtr pBitMap;
+ DrawablePtr pDrawable;
+ int dx, dy, xOrg, yOrg;
+{
+ int h, dxDivPPW, ibEnd;
+ MiBits *pwLineStart;
+ register MiBits *pw, *pwEnd;
+ register MiBits msk;
+ register int ib, w;
+ register int ipt; /* index into above arrays */
+ Bool fInBox;
+ DDXPointRec pt[NPT], ptThisLine;
+ int width[NPT];
+ PixelType startmask;
+
+
+ startmask = (MiBits)(-1) ^
+ LONG2CHARSDIFFORDER((MiBits)(-1) >> 1);
+
+ pwLineStart = (MiBits *)xalloc(BitmapBytePad(dx));
+ if (!pwLineStart)
+ return;
+ ipt = 0;
+ dxDivPPW = dx/PPW;
+
+ for(h = 0, ptThisLine.x = 0, ptThisLine.y = 0;
+ h < dy;
+ h++, ptThisLine.y++)
+ {
+
+ (*pBitMap->drawable.pScreen->GetSpans)((DrawablePtr)pBitMap, dx,
+ &ptThisLine, &dx, 1, (char *)pwLineStart);
+
+ pw = pwLineStart;
+ /* Process all words which are fully in the pixmap */
+
+ fInBox = FALSE;
+ pwEnd = pwLineStart + dxDivPPW;
+ while(pw < pwEnd)
+ {
+ w = *pw;
+#ifdef XFree86Server
+ msk = startmask;
+#else
+ msk = (MiBits)(-1) ^ SCRRIGHT((MiBits)(-1), 1);
+#endif
+ for(ib = 0; ib < PPW; ib++)
+ {
+ if(w & msk)
+ {
+ if(!fInBox)
+ {
+ pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
+ pt[ipt].y = h + yOrg;
+ /* start new box */
+ fInBox = TRUE;
+ }
+ }
+ else
+ {
+ if(fInBox)
+ {
+ width[ipt] = ((pw - pwLineStart) << PWSH) +
+ ib + xOrg - pt[ipt].x;
+ if (++ipt >= NPT)
+ {
+ (*pGC->ops->FillSpans)(pDrawable, pGC,
+ NPT, pt, width, TRUE);
+ ipt = 0;
+ }
+ /* end box */
+ fInBox = FALSE;
+ }
+ }
+#ifdef XFree86Server
+ /* This is not quite right, but it'll do for now */
+ msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1);
+#else
+ msk = SCRRIGHT(msk, 1);
+#endif
+ }
+ pw++;
+ }
+ ibEnd = dx & PIM;
+ if(ibEnd)
+ {
+ /* Process final partial word on line */
+ w = *pw;
+#ifdef XFree86Server
+ msk = startmask;
+#else
+ msk = (MiBits)(-1) ^ SCRRIGHT((MiBits)(-1), 1);
+#endif
+ for(ib = 0; ib < ibEnd; ib++)
+ {
+ if(w & msk)
+ {
+ if(!fInBox)
+ {
+ /* start new box */
+ pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg;
+ pt[ipt].y = h + yOrg;
+ fInBox = TRUE;
+ }
+ }
+ else
+ {
+ if(fInBox)
+ {
+ /* end box */
+ width[ipt] = ((pw - pwLineStart) << PWSH) +
+ ib + xOrg - pt[ipt].x;
+ if (++ipt >= NPT)
+ {
+ (*pGC->ops->FillSpans)(pDrawable,
+ pGC, NPT, pt, width, TRUE);
+ ipt = 0;
+ }
+ fInBox = FALSE;
+ }
+ }
+#ifdef XFree86Server
+ /* This is not quite right, but it'll do for now */
+ msk = LONG2CHARSDIFFORDER(LONG2CHARSDIFFORDER(msk) >> 1);
+#else
+ msk = SCRRIGHT(msk, 1);
+#endif
+ }
+ }
+ /* If scanline ended with last bit set, end the box */
+ if(fInBox)
+ {
+ width[ipt] = dx + xOrg - pt[ipt].x;
+ if (++ipt >= NPT)
+ {
+ (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE);
+ ipt = 0;
+ }
+ }
+ }
+ xfree(pwLineStart);
+ /* Flush any remaining spans */
+ if (ipt)
+ {
+ (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE);
+ }
+}
diff --git a/hw/xwin/winrop.c b/hw/xwin/winrop.c
new file mode 100644
index 000000000..c5ec45de5
--- /dev/null
+++ b/hw/xwin/winrop.c
@@ -0,0 +1,139 @@
+/*
+ *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.
+ *
+ * Authors: Alan Hourihane <alanh@fairlite.demon.co.uk>
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winrop.c,v 1.1 2003/08/07 23:47:58 alanh Exp $ */
+
+/*
+ * Raster operations used by Windows translated to X's 16 rop codes...
+ */
+#include "win.h"
+
+int g_copyROP[16] = { 0xFF0062, /* GXclear - 0 */
+ 0x8800C6, /* GXand - S & D */
+ 0x440328, /* GXandReverse - S & !D */
+ 0xCC0020, /* GXcopy - S */
+ 0x220326, /* GXandInverted - !S & D */
+ 0xAA0029, /* GXnoop - D */
+ 0x660046, /* GXxor - S ^ D */
+ 0xEE0086, /* GXor - S | D */
+ 0x1100A6, /* GXnor - !S & !D */
+ 0x990126, /* GXequiv - !S ^ D */
+ 0x550009, /* GXinvert - !D */
+ 0xDD0228, /* GXorReverse - S | !D */
+ 0x330008, /* GXcopyInverted - !S */
+ 0xBB0226, /* GXorInverted - !S | D */
+ 0x7700C6, /* GXnand - !S | !D */
+ 0x000042 /* GXset - 1 */
+};
+
+int g_patternROP[16] = {0xFF0062, /* GXclear - 0 */
+ 0xA000C9, /* GXand - P & D */
+ 0xF50225, /* GXandReverse - P & !D */
+ 0xF00021, /* GXcopy - P */
+ 0x5F00E9, /* GXandInverted - !P & D */
+ 0xAA0029, /* GXnoop - D */
+ 0xA50065, /* GXxor - P ^ D */
+ 0xA000C9, /* GXor - P | D */
+ 0x5F00E9, /* GXnor - !P & !D */
+ 0x5A0049, /* GXequiv - !P ^ D */
+ 0x550009, /* GXinvert - !D */
+ 0x500325, /* GXorReverse - P | !D */
+ 0x0F0001, /* GXcopyInverted - !P */
+ 0x0A0329, /* GXorInverted - !P | D */
+ 0x0500A9, /* GXnand - !P | !D */
+ 0x000042 /* GXset - 1 */
+};
+
+
+void
+ROP16 (HDC hdc, int rop)
+{
+ switch (rop)
+ {
+ case GXclear:
+ SetROP2 (hdc, R2_BLACK);
+ break;
+
+ case GXand:
+ SetROP2 (hdc, R2_MASKPEN);
+ break;
+
+ case GXandReverse:
+ SetROP2 (hdc, R2_MASKPENNOT);
+ break;
+
+ case GXcopy:
+ SetROP2 (hdc, R2_COPYPEN);
+ break;
+
+ case GXnoop:
+ SetROP2 (hdc, R2_NOP);
+ break;
+
+ case GXxor:
+ SetROP2 (hdc, R2_XORPEN);
+ break;
+
+ case GXor:
+ SetROP2 (hdc, R2_MERGEPEN);
+ break;
+
+ case GXnor:
+ SetROP2 (hdc, R2_NOTMERGEPEN);
+ break;
+
+ case GXequiv:
+ SetROP2 (hdc, R2_NOTXORPEN);
+ break;
+
+ case GXinvert:
+ SetROP2 (hdc, R2_NOT);
+ break;
+
+ case GXorReverse:
+ SetROP2 (hdc, R2_MERGEPENNOT);
+ break;
+
+ case GXcopyInverted:
+ SetROP2 (hdc, R2_NOTCOPYPEN);
+ break;
+
+ case GXorInverted:
+ SetROP2 (hdc, R2_MERGENOTPEN);
+ break;
+
+ case GXnand:
+ SetROP2 (hdc, R2_NOTMASKPEN);
+ break;
+
+ case GXset:
+ SetROP2 (hdc, R2_WHITE);
+ break;
+ }
+}
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 41811d253..79e985c6b 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -31,7 +31,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.28 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -510,6 +510,11 @@ winFinishScreenInitFB (int index,
/* Set the ServerStarted flag to false */
pScreenPriv->fServerStarted = FALSE;
+ /* Set the WindowOrderChanged flag to false */
+ pScreenPriv->fWindowOrderChanged = FALSE;
+
+ pScreenPriv->fRestacking = FALSE;
+
#if CYGDEBUG || YES
if (pScreenInfo->fMultiWindow)
ErrorF ("winFinishScreenInitFB - Calling winInitWM.\n");
@@ -519,6 +524,7 @@ winFinishScreenInitFB (int index,
if (pScreenInfo->fMultiWindow
&& !winInitWM (&pScreenPriv->pWMInfo,
&pScreenPriv->ptWMProc,
+ &pScreenPriv->ptXMsgProc,
&pScreenPriv->pmServerStarted,
pScreenInfo->dwScreen))
{
@@ -584,7 +590,7 @@ winFinishScreenInitNativeGDI (int index,
int nVisuals = 0, nDepths = 0, nRootDepth = 0;
/* Ignore user input (mouse, keyboard) */
- pScreenInfo->fIgnoreInput = TRUE;
+ pScreenInfo->fIgnoreInput = FALSE;
/* Get device contexts for the screen and shadow bitmap */
pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
@@ -616,7 +622,7 @@ winFinishScreenInitNativeGDI (int index,
NULL, /* No framebuffer */
pScreenInfo->dwWidth, pScreenInfo->dwHeight,
monitorResolution, monitorResolution,
- pScreenInfo->dwWidth,
+ pScreenInfo->dwStride,
nRootDepth, nDepths, pDepths, rootVisual,
nVisuals, pVisuals))
{
@@ -624,6 +630,8 @@ winFinishScreenInitNativeGDI (int index,
return FALSE;
}
+ pScreen->defColormap = FakeClientID(0);
+
/*
* Register our block and wakeup handlers; these procedures
* process messages in our Windows message queue; specifically,
diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c
index 657a7af50..c0340e47b 100644
--- a/hw/xwin/winsetsp.c
+++ b/hw/xwin/winsetsp.c
@@ -26,8 +26,9 @@
*from the XFree86 Project.
*
* Authors: Harold L Hunt II
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winsetsp.c,v 1.7 2001/11/01 12:19:42 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winsetsp.c,v 1.8 2003/08/07 23:47:58 alanh Exp $ */
#include "win.h"
@@ -44,22 +45,37 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
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;
+ BITMAPINFO bmi;
+ HRGN hrgn = NULL, combined = NULL;
+ int nbox;
+ BoxPtr pbox;
+
+ nbox = REGION_NUM_RECTS (pGC->pCompositeClip);
+ pbox = REGION_RECTS (pGC->pCompositeClip);
+
+ if (!nbox) return;
+
+ combined = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
+ nbox--; pbox++;
+ while (nbox--)
+ {
+ hrgn = CreateRectRgn (pbox->x1, pbox->y1, pbox->x2, pbox->y2);
+ CombineRgn (combined, combined, hrgn, RGN_OR);
+ DeleteObject (hrgn);
+ hrgn = NULL;
+ pbox++;
+ }
/* Branch on the drawable type */
switch (pDrawable->type)
{
case DRAWABLE_PIXMAP:
+
+ SelectClipRgn (pGCPriv->hdcMem, combined);
+ DeleteObject (combined);
+ combined = NULL;
+
pPixmap = (PixmapPtr) pDrawable;
pPixmapPriv = winGetPixmapPriv (pPixmap);
@@ -69,264 +85,87 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
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;
- }
+ while (iSpans--)
+ {
+ ZeroMemory (&bmi, sizeof (BITMAPINFO));
+ bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
+ bmi.bmiHeader.biWidth = *piWidths;
+ bmi.bmiHeader.biHeight = 1;
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biBitCount = pDrawable->depth;
+ bmi.bmiHeader.biCompression = BI_RGB;
+
+ /* Setup color table for mono DIBs */
+ if (pDrawable->depth == 1)
+ {
+ bmi.bmiColors[1].rgbBlue = 255;
+ bmi.bmiColors[1].rgbGreen = 255;
+ bmi.bmiColors[1].rgbRed = 255;
+ }
+
+ StretchDIBits (pGCPriv->hdcMem,
+ pPoints->x, pPoints->y,
+ *piWidths, 1,
+ 0, 0,
+ *piWidths, 1,
+ pSrcs,
+ (BITMAPINFO *) &bmi,
+ DIB_RGB_COLORS,
+ g_copyROP[pGC->alu]);
+
+ pSrcs += PixmapBytePad (*piWidths, pDrawable->depth);
+ pPoints++;
+ piWidths++;
+ }
+
+ /* Reset the clip region */
+ SelectClipRgn (pGCPriv->hdcMem, NULL);
/* 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;
- }
+ SelectClipRgn (pGCPriv->hdc, combined);
+ DeleteObject (combined);
+ combined = NULL;
+
+ while (iSpans--)
+ {
+ ZeroMemory (&bmi, sizeof (BITMAPINFO));
+ bmi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
+ bmi.bmiHeader.biWidth = *piWidths;
+ bmi.bmiHeader.biHeight = 1;
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biBitCount = pDrawable->depth;
+ bmi.bmiHeader.biCompression = BI_RGB;
+
+ /* Setup color table for mono DIBs */
+ if (pDrawable->depth == 1)
+ {
+ bmi.bmiColors[1].rgbBlue = 255;
+ bmi.bmiColors[1].rgbGreen = 255;
+ bmi.bmiColors[1].rgbRed = 255;
+ }
+
+ StretchDIBits (pGCPriv->hdc,
+ pPoints->x, pPoints->y,
+ *piWidths, 1,
+ 0, 0,
+ *piWidths, 1,
+ pSrcs,
+ (BITMAPINFO *) &bmi,
+ DIB_RGB_COLORS,
+ g_copyROP[pGC->alu]);
+
+ pSrcs += PixmapBytePad (*piWidths, pDrawable->depth);
+ pPoints++;
+ piWidths++;
+ }
+
+ /* Reset the clip region */
+ SelectClipRgn (pGCPriv->hdc, NULL);
break;
case UNDRAWABLE_WINDOW:
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 9c14ebf34..a409c27c6 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -30,7 +30,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshaddd.c,v 1.24 2003/07/29 21:25:18 dawes Exp $ */
#include "win.h"
@@ -40,7 +40,7 @@
*/
#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}}
+#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif /* DEFINE_GUID */
@@ -671,6 +671,17 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
pScreenPriv->pdd = NULL;
}
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
/* Kill our window */
if (pScreenPriv->hwndScreen)
{
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 69396a79b..e902f31b0 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -30,7 +30,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshadddnl.c,v 1.26 2003/10/02 13:30:11 eich Exp $ */
#include "win.h"
@@ -40,7 +40,7 @@
*/
#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}}
+#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif /* DEFINE_GUID */
/*
@@ -51,6 +51,8 @@
DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
#endif /* IID_IDirectDraw4 */
+#define FAIL_MSG_MAX_BLT 10
+
/*
* Create the primary surface and attach the clipper.
@@ -514,9 +516,24 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
NULL);
if (FAILED (ddrval))
{
- ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt () "
- "failed: %08x\n",
- ddrval);
+ static int s_iFailCount = 0;
+
+ if (s_iFailCount < FAIL_MSG_MAX_BLT)
+ {
+ ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt () "
+ "failed: %08x\n",
+ ddrval);
+
+ ++s_iFailCount;
+
+ if (s_iFailCount == FAIL_MSG_MAX_BLT)
+ {
+ ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt "
+ "failure message maximum (%d) reached. No "
+ "more failure messages will be printed.",
+ FAIL_MSG_MAX_BLT);
+ }
+ }
}
/* Get a pointer to the next box */
@@ -650,6 +667,17 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
pScreenPriv->pdd = NULL;
}
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
/* Kill our window */
if (pScreenPriv->hwndScreen)
{
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index d2f72f20d..16b1969d7 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.22 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.23 2003/07/29 21:25:18 dawes Exp $ */
#include "win.h"
@@ -216,7 +216,7 @@ winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam)
if (GetClassName (hwnd, strClassName, 100))
{
- if(strcmp (WINDOW_CLASS_X, strClassName) == 0)
+ if (strncmp (WINDOW_CLASS_X, strClassName, strlen (WINDOW_CLASS_X)) == 0)
{
InvalidateRect (hwnd, NULL, FALSE);
UpdateWindow (hwnd);
@@ -323,6 +323,17 @@ winAllocateFBShadowGDI (ScreenPtr pScreen)
return FALSE;
}
+ /* Look for height weirdness */
+ if (dibsection.dsBmih.biHeight < 0)
+ {
+ /* FIXME: Figure out why biHeight is sometimes negative */
+ ErrorF ("winAllocateFBShadowGDI - WEIRDNESS - biHeight "
+ "still negative: %d\n"
+ "winAllocateFBShadowGDI - WEIRDNESS - Flipping biHeight sign\n",
+ dibsection.dsBmih.biHeight);
+ dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight;
+ }
+
/* Set screeninfo stride */
pScreenInfo->dwStride = ((dibsection.dsBmih.biSizeImage
/ dibsection.dsBmih.biHeight)
@@ -515,6 +526,17 @@ winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen)
/* Free the screen DC */
ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
+ /* Delete tray icon, if we have one */
+ if (!pScreenInfo->fNoTrayIcon)
+ winDeleteNotifyIcon (pScreenPriv);
+
+ /* Free the exit confirmation dialog box, if it exists */
+ if (g_hDlgExit != NULL)
+ {
+ DestroyWindow (g_hDlgExit);
+ g_hDlgExit = NULL;
+ }
+
/* Kill our window */
if (pScreenPriv->hwndScreen)
{
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
new file mode 100755
index 000000000..90c77b1c8
--- /dev/null
+++ b/hw/xwin/wintrayicon.c
@@ -0,0 +1,209 @@
+/*
+ *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: Early Ehlinger
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wintrayicon.c,v 1.2 2003/10/02 13:30:11 eich Exp $ */
+
+#include "win.h"
+#include <shellapi.h>
+#include "winprefs.h"
+
+/*
+ * Initialize the tray icon
+ */
+
+void
+winInitNotifyIcon (winPrivScreenPtr pScreenPriv)
+{
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ NOTIFYICONDATA nid = {0};
+
+ nid.cbSize = sizeof (NOTIFYICONDATA);
+ nid.hWnd = pScreenPriv->hwndScreen;
+ nid.uID = pScreenInfo->dwScreen;
+ nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
+ nid.uCallbackMessage = WM_TRAYICON;
+ nid.hIcon = LoadImage (g_hInstance,
+ MAKEINTRESOURCE(IDI_XWIN),
+ IMAGE_ICON,
+ GetSystemMetrics (SM_CXSMICON),
+ GetSystemMetrics (SM_CYSMICON),
+ 0);
+
+ /* Save handle to the icon so it can be freed later */
+ pScreenPriv->hiconNotifyIcon = nid.hIcon;
+
+ /* Set display and screen-specific tooltip text */
+ snprintf (nid.szTip,
+ sizeof (nid.szTip),
+ "Cygwin/XFree86 Server - %s:%d",
+ display,
+ (int) pScreenInfo->dwScreen);
+
+ /* Add the tray icon */
+ if (!Shell_NotifyIcon (NIM_ADD, &nid))
+ ErrorF ("winInitNotifyIcon - Shell_NotifyIcon Failed\n");
+}
+
+
+/*
+ * Delete the tray icon
+ */
+
+void
+winDeleteNotifyIcon (winPrivScreenPtr pScreenPriv)
+{
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ NOTIFYICONDATA nid = {0};
+
+#if 0
+ ErrorF ("winDeleteNotifyIcon\n");
+#endif
+
+ nid.cbSize = sizeof (NOTIFYICONDATA);
+ nid.hWnd = pScreenPriv->hwndScreen;
+ nid.uID = pScreenInfo->dwScreen;
+
+ /* Delete the tray icon */
+ if (!Shell_NotifyIcon (NIM_DELETE, &nid))
+ {
+ ErrorF ("winDeleteNotifyIcon - Shell_NotifyIcon failed\n");
+ return;
+ }
+
+ /* Free the icon that was loaded */
+ if (pScreenPriv->hiconNotifyIcon != NULL
+ && DestroyIcon (pScreenPriv->hiconNotifyIcon) == 0)
+ {
+ ErrorF ("winDeleteNotifyIcon - DestroyIcon failed\n");
+ }
+ pScreenPriv->hiconNotifyIcon = NULL;
+}
+
+
+/*
+ * Process messages intended for the tray icon
+ */
+
+LRESULT
+winHandleIconMessage (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam,
+ winPrivScreenPtr pScreenPriv)
+{
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ switch (lParam)
+ {
+ case WM_LBUTTONDBLCLK:
+ /* Display Exit dialog box */
+ winDisplayExitDialog (pScreenPriv);
+ break;
+
+ case WM_RBUTTONUP:
+ {
+ POINT ptCursor;
+ HMENU hmenuPopup;
+ HMENU hmenuTray;
+
+ /* Get cursor position */
+ GetCursorPos (&ptCursor);
+
+ /* Load tray icon menu resource */
+ hmenuPopup = LoadMenu (g_hInstance,
+ MAKEINTRESOURCE(IDM_TRAYICON_MENU));
+ if (!hmenuPopup)
+ ErrorF ("winHandleIconMessage - LoadMenu failed\n");
+
+ /* Get actual tray icon menu */
+ hmenuTray = GetSubMenu (hmenuPopup, 0);
+
+ /* Check for MultiWindow mode */
+ if (pScreenInfo->fMultiWindow)
+ {
+ /* Check if root window is shown or hidden */
+ if (pScreenPriv->fRootWindowShown)
+ {
+ /* Remove Show Root Window button */
+ RemoveMenu (hmenuTray,
+ ID_APP_SHOW_ROOT,
+ MF_BYCOMMAND);
+ }
+ else
+ {
+ /* Remove Hide Root Window button */
+ RemoveMenu (hmenuTray,
+ ID_APP_HIDE_ROOT,
+ MF_BYCOMMAND);
+ }
+ }
+ else
+ {
+ /* Remove Show Root Window button */
+ RemoveMenu (hmenuTray,
+ ID_APP_SHOW_ROOT,
+ MF_BYCOMMAND);
+
+ /* Remove Hide Root Window button */
+ RemoveMenu (hmenuTray,
+ ID_APP_HIDE_ROOT,
+ MF_BYCOMMAND);
+
+ /* Remove separator */
+ RemoveMenu (hmenuTray,
+ 0,
+ MF_BYPOSITION);
+ }
+
+ SetupRootMenu ((unsigned long)hmenuTray);
+
+ /*
+ * NOTE: This three-step procedure is required for
+ * proper popup menu operation. Without the
+ * call to SetForegroundWindow the
+ * popup menu will often not disappear when you click
+ * outside of it. Without the PostMessage the second
+ * time you display the popup menu it might immediately
+ * disappear.
+ */
+ SetForegroundWindow (hwnd);
+ TrackPopupMenuEx (hmenuTray,
+ TPM_LEFTALIGN | TPM_BOTTOMALIGN | TPM_RIGHTBUTTON,
+ ptCursor.x, ptCursor.y,
+ hwnd,
+ NULL);
+ PostMessage (hwnd, WM_NULL, 0, 0);
+
+ /* Free menu */
+ DestroyMenu (hmenuPopup);
+ }
+ break;
+ }
+
+ return 0;
+}
diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c
new file mode 100755
index 000000000..8bf12cd66
--- /dev/null
+++ b/hw/xwin/winvideo.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: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winvideo.c,v 1.2 2003/11/10 18:22:44 tsi Exp $ */
+
+#include "win.h"
+#include "Xv.h"
+#include "Xvproto.h"
+
+
+/*
+ * winInitVideo - Initialize support for the X Video (Xv) Extension.
+ */
+
+void
+winInitVideo (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ if (pScreenInfo->dwBPP > 8)
+ {
+
+ }
+
+
+}
+
+
+
+
+
+
+
+#if 0
+#include "../xfree86/common/xf86.h"
+#include "../Xext/xvdix.h"
+#include "../xfree86/common/xf86xv.h"
+#include "Xv.h"
+#endif
+
+#include "win.h"
+
+
+
+#if 0
+/* client libraries expect an encoding */
+static XF86VideoEncodingRec DummyEncoding[1] =
+{
+ {
+ 0,
+ "XV_IMAGE",
+ IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT,
+ {1, 1}
+ }
+};
+
+#define NUM_FORMATS 3
+
+static XF86VideoFormatRec Formats[NUM_FORMATS] =
+{
+ {15, TrueColor}, {16, TrueColor}, {24, TrueColor}
+};
+
+#define NUM_ATTRIBUTES 3
+
+static XF86AttributeRec Attributes[NUM_ATTRIBUTES] =
+{
+ {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
+ {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"},
+ {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}
+};
+
+#define NUM_IMAGES 4
+
+static XF86ImageRec Images[NUM_IMAGES] =
+{
+ XVIMAGE_YUY2,
+ XVIMAGE_YV12,
+ XVIMAGE_I420,
+ XVIMAGE_UYVY
+};
+
+
+
+/*
+ * winInitVideo - Initialize support for the X Video (Xv) Extension.
+ */
+
+void
+winInitVideo (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ XF86VideoAdaptorPtr newAdaptor = NULL;
+
+ if (pScreenInfo->dwBPP > 8)
+ {
+ newAdaptor = I810SetupImageVideo (pScreen);
+ I810InitOffscreenImages (pScreen);
+ }
+
+ xf86XVScreenInit (pScreen, adaptors, 1);
+}
+
+
+static XF86VideoAdaptorPtr
+winSetupImageVideo (ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+#if 0
+ I810Ptr pI810 = I810PTR(pScrn);
+#endif
+ XF86VideoAdaptorPtr adapt;
+
+ if (!(adapt = xcalloc (1, sizeof(XF86VideoAdaptorRec))))
+ return NULL;
+
+ adapt->type = XvWindowMask | XvInputMask | XvImageMask;
+ adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
+ adapt->name = "Cygwin/XFree86 Video Overlay";
+ adapt->nEncodings = 1;
+ adapt->pEncodings = DummyEncoding;
+ adapt->nFormats = NUM_FORMATS;
+ adapt->pFormats = Formats;
+ adapt->nPorts = 1;
+ adapt->pPortPrivates = NULL;
+
+ adapt->pPortPrivates[0].ptr = NULL;
+ adapt->pAttributes = Attributes;
+ adapt->nImages = NUM_IMAGES;
+ adapt->nAttributes = NUM_ATTRIBUTES;
+ adapt->pImages = Images;
+ adapt->PutVideo = NULL;
+ adapt->PutStill = NULL;
+ adapt->GetVideo = NULL;
+ adapt->GetStill = NULL;
+#if 0
+ adapt->StopVideo = I810StopVideo;
+ adapt->SetPortAttribute = I810SetPortAttribute;
+ adapt->GetPortAttribute = I810GetPortAttribute;
+ adapt->QueryBestSize = I810QueryBestSize;
+ adapt->PutImage = I810PutImage;
+ adapt->QueryImageAttributes = I810QueryImageAttributes;
+#endif
+
+#if 0
+ pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1);
+#endif
+ pPriv->videoStatus = 0;
+ pPriv->brightness = 0;
+ pPriv->contrast = 64;
+ pPriv->linear = NULL;
+ pPriv->currentBuf = 0;
+
+#if 0
+ /* gotta uninit this someplace */
+ REGION_NULL(pScreen, &pPriv->clip);
+#endif
+
+#if 0
+ pI810->adaptor = adapt;
+
+ pI810->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = I810BlockHandler;
+#endif
+
+#if 0
+ xvBrightness = MAKE_ATOM("XV_BRIGHTNESS");
+ xvContrast = MAKE_ATOM("XV_CONTRAST");
+ xvColorKey = MAKE_ATOM("XV_COLORKEY");
+#endif
+
+#if 0
+ I810ResetVideo(pScrn);
+#endif
+
+ return adapt;
+}
+#endif
diff --git a/hw/xwin/winwakeup.c b/hw/xwin/winwakeup.c
index 37e062fa6..f311d0dc9 100644
--- a/hw/xwin/winwakeup.c
+++ b/hw/xwin/winwakeup.c
@@ -30,7 +30,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwakeup.c,v 1.7 2003/07/29 21:25:18 dawes Exp $ */
#include "win.h"
@@ -41,17 +41,23 @@ winWakeupHandler (int nScreen,
unsigned long ulResult,
pointer pReadmask)
{
+#if 0
winScreenPriv((ScreenPtr)pWakeupData);
+#endif
MSG msg;
/* Process all messages on our queue */
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
- if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ if ((g_hDlgDepthChange == 0
+ || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ && (g_hDlgExit == 0
+ || !IsDialogMessage (g_hDlgExit, &msg)))
{
DispatchMessage (&msg);
}
}
+ winReorderWindowsMultiWindow ((ScreenPtr)pWakeupData);
}
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index b2469c30a..6515c8596 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -28,7 +28,7 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwindow.c,v 1.9 2003/11/10 18:22:44 tsi Exp $ */
#include "win.h"
@@ -41,12 +41,12 @@ winAddRgn (WindowPtr pWindow, pointer data);
static
void
-winUpdateRgn (WindowPtr pWindow);
+winUpdateRgnPRootless (WindowPtr pWindow);
#ifdef SHAPE
static
void
-winReshape (WindowPtr pWin);
+winReshapePRootless (WindowPtr pWin);
#endif
@@ -91,7 +91,84 @@ winCopyWindowNativeGDI (WindowPtr pWin,
DDXPointRec ptOldOrg,
RegionPtr prgnSrc)
{
- ErrorF ("winCopyWindowNativeGDI ()\n");
+ DDXPointPtr pptSrc;
+ DDXPointPtr ppt;
+ RegionPtr prgnDst;
+ BoxPtr pBox;
+ int dx, dy;
+ int i, nbox;
+ WindowPtr pwinRoot;
+ BoxPtr pBoxDst, pBoxSrc;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ winScreenPriv(pScreen);
+
+#if 0
+ ErrorF ("winCopyWindow\n");
+#endif
+
+ /* Get a pointer to the root window */
+ pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
+
+ /* Create a region for the destination */
+ prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
+
+ /* Calculate the shift from the source to the destination */
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+
+ /* Translate the region from the destination to the source? */
+ REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip,
+ prgnSrc);
+
+ /* Get a pointer to the first box in the region to be copied */
+ pBox = REGION_RECTS(prgnDst);
+
+ /* Get the number of boxes in the region */
+ nbox = REGION_NUM_RECTS(prgnDst);
+
+ /* Allocate source points for each box */
+ if(!(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
+ return;
+
+ /* Set an iterator pointer */
+ ppt = pptSrc;
+
+ /* Calculate the source point of each box? */
+ for (i = nbox; --i >= 0; ppt++, pBox++)
+ {
+ ppt->x = pBox->x1 + dx;
+ ppt->y = pBox->y1 + dy;
+ }
+
+ /* Setup loop pointers again */
+ pBoxDst = REGION_RECTS(prgnDst);
+ ppt = pptSrc;
+
+#if 0
+ ErrorF ("winCopyWindow - x1\tx2\ty1\ty2\tx\ty\n");
+#endif
+
+ /* BitBlt each source to the destination point */
+ for (i = nbox; --i >= 0; pBoxDst++, ppt++)
+ {
+#if 0
+ ErrorF ("winCopyWindow - %d\t%d\t%d\t%d\t%d\t%d\n",
+ pBoxDst->x1, pBoxDst->x2, pBoxDst->y1, pBoxDst->y2,
+ ppt->x, ppt->y);
+#endif
+
+ BitBlt (pScreenPriv->hdcScreen,
+ pBoxDst->x1, pBoxDst->y1,
+ pBoxDst->x2 - pBoxDst->x1, pBoxDst->y2 - pBoxDst->y1,
+ pScreenPriv->hdcScreen,
+ ppt->x, ppt->y,
+ SRCCOPY);
+ }
+
+ /* Cleanup the regions, etc. */
+ DEALLOCATE_LOCAL(pptSrc);
+ REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
}
@@ -153,7 +230,6 @@ winCreateWindowPRootless (WindowPtr pWin)
fResult = winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow(pWin);
pWinPriv->hRgn = NULL;
- /*winUpdateRgn (pWin);*/
return fResult;
}
@@ -180,7 +256,7 @@ winDestroyWindowPRootless (WindowPtr pWin)
pWinPriv->hRgn = NULL;
}
- winUpdateRgn (pWin);
+ winUpdateRgnPRootless (pWin);
return fResult;
}
@@ -200,7 +276,7 @@ winPositionWindowPRootless (WindowPtr pWin, int x, int y)
fResult = winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow(pWin, x, y);
- winUpdateRgn (pWin);
+ winUpdateRgnPRootless (pWin);
return fResult;
}
@@ -220,7 +296,7 @@ winChangeWindowAttributesPRootless (WindowPtr pWin, unsigned long mask)
fResult = winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes(pWin, mask);
- winUpdateRgn (pWin);
+ winUpdateRgnPRootless (pWin);
return fResult;
}
@@ -248,7 +324,7 @@ winUnmapWindowPRootless (WindowPtr pWin)
pWinPriv->hRgn = NULL;
}
- winUpdateRgn (pWin);
+ winUpdateRgnPRootless (pWin);
return fResult;
}
@@ -269,9 +345,9 @@ winMapWindowPRootless (WindowPtr pWin)
fResult = winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow(pWin);
- winReshape (pWin);
+ winReshapePRootless (pWin);
- winUpdateRgn (pWin);
+ winUpdateRgnPRootless (pWin);
return fResult;
}
@@ -287,8 +363,8 @@ winSetShapePRootless (WindowPtr pWin)
winGetScreenPriv(pWin->drawable.pScreen)->SetShape(pWin);
- winReshape (pWin);
- winUpdateRgn (pWin);
+ winReshapePRootless (pWin);
+ winUpdateRgnPRootless (pWin);
return;
}
@@ -366,7 +442,7 @@ winAddRgn (WindowPtr pWin, pointer data)
static
void
-winUpdateRgn (WindowPtr pWin)
+winUpdateRgnPRootless (WindowPtr pWin)
{
HRGN hRgn = CreateRectRgn (0, 0, 0, 0);
@@ -378,7 +454,7 @@ winUpdateRgn (WindowPtr pWin)
}
else
{
- ErrorF ("winUpdateRgn - CreateRectRgn failed.\n");
+ ErrorF ("winUpdateRgnPRootless - CreateRectRgn failed.\n");
}
}
@@ -386,17 +462,19 @@ winUpdateRgn (WindowPtr pWin)
#ifdef SHAPE
static
void
-winReshape (WindowPtr pWin)
+winReshapePRootless (WindowPtr pWin)
{
int nRects;
+#if 0
ScreenPtr pScreen = pWin->drawable.pScreen;
+#endif
RegionRec rrNewShape;
BoxPtr pShape, pRects, pEnd;
HRGN hRgn, hRgnRect;
winWindowPriv(pWin);
#if CYGDEBUG
- ErrorF ("winReshape ()\n");
+ ErrorF ("winReshapePRootless ()\n");
#endif
/* Bail if the window is the root window */
@@ -418,7 +496,7 @@ winReshape (WindowPtr pWin)
if (!wBoundingShape (pWin))
return;
- REGION_INIT(pScreen, &rrNewShape, NullBox, 0);
+ REGION_NULL(pScreen, &rrNewShape);
REGION_COPY(pScreen, &rrNewShape, wBoundingShape(pWin));
REGION_TRANSLATE(pScreen, &rrNewShape, pWin->borderWidth,
pWin->borderWidth);
@@ -439,13 +517,13 @@ winReshape (WindowPtr pWin)
pRects->x2, pRects->y2);
if (hRgnRect == NULL)
{
- ErrorF("winReshape - CreateRectRgn() failed\n");
+ ErrorF("winReshapePRootless - CreateRectRgn() failed\n");
}
/* Merge the Windows region with the accumulated region */
if (CombineRgn (hRgn, hRgn, hRgnRect, RGN_OR) == ERROR)
{
- ErrorF("winReshape - CombineRgn() failed\n");
+ ErrorF("winReshapePRootless - CombineRgn() failed\n");
}
/* Delete the temporary Windows region */
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index d828b4c70..8153b5600 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -27,7 +27,7 @@
*
* Authors: Kensuke Matsuzaki
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winwindow.h,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwindow.h,v 1.4 2003/10/08 11:13:03 eich Exp $ */
#ifndef _WINWINDOW_H_
@@ -41,20 +41,23 @@
#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 "cygwin/xfree86"
+#define WINDOW_TITLE "Cygwin/XFree86 - %s:%d"
+#define WINDOW_TITLE_XDMCP "Cygwin/XFree86 - %s"
+#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 WINDOW_TITLE_X "Cygwin/XFree86 X"
#define WIN_WINDOW_PROP "cyg_window_prop_rl"
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
-#define WIN_LOG_FNAME "/tmp/XWinrl.log"
+#define WIN_LOG_FNAME "/tmp/XWin.log"
#define WIN_WID_PROP "cyg_wid_prop_rl"
#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl"
+#define WIN_HWND_CACHE "cyg_privmap_rl"
#define CYGMULTIWINDOW_DEBUG NO
typedef struct _winPrivScreenRec *winPrivScreenPtr;
+
/*
* Window privates
*/
@@ -70,6 +73,8 @@ typedef struct
int iWidth;
int iHeight;
Bool fXKilled;
+ Bool fNeedRestore;
+ POINT ptRestore;
} winPrivWinRec, *winPrivWinPtr;
typedef struct _winWMMessageRec{
@@ -81,19 +86,22 @@ typedef struct _winWMMessageRec{
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
+#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 WM_WM_NAME_EVENT (WM_USER + 9)
+#define WM_WM_HINTS_EVENT (WM_USER + 10)
+#define WM_WM_CHANGE_STATE (WM_USER + 11)
/*
@@ -106,13 +114,22 @@ winSendMessageToWM (void *pWMInfo, winWMMessagePtr msg);
Bool
winInitWM (void **ppWMInfo,
pthread_t *ptWMProc,
-#if 0
- pthread_cond_t *ppcServerStarted,
-#endif
+ pthread_t *ptXMsgProc,
pthread_mutex_t *ppmServerStarted,
-#if 0
- Bool *pfServerStarted,
-#endif
int dwScreen);
+void
+winDeinitMultiWindowWM ();
+
+void
+winMinimizeWindow (Window id);
+
+
+/*
+ * winmultiwindowicons.c
+ */
+
+void
+winUpdateIcon (Window id);
+
#endif
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 6aa29316d..5b47a212a 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -31,14 +31,18 @@
* 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 $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwndproc.c,v 1.26 2003/10/02 13:30:11 eich Exp $ */
#include "win.h"
#include <commctrl.h>
+#include "winprefs.h"
+
+/*
+ * Global variables
+ */
+
+Bool g_fCursor = TRUE;
-BOOL CALLBACK
-winChangeDepthDlgProc (HWND hDialog, UINT message,
- WPARAM wParam, LPARAM lParam);
/*
@@ -55,7 +59,6 @@ winWindowProc (HWND hwnd, UINT message,
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;
@@ -90,6 +93,10 @@ winWindowProc (HWND hwnd, UINT message,
/* Branch on message type */
switch (message)
{
+ case WM_TRAYICON:
+ return winHandleIconMessage (hwnd, message, wParam, lParam,
+ s_pScreenPriv);
+
case WM_CREATE:
#if CYGDEBUG
ErrorF ("winWindowProc - WM_CREATE\n");
@@ -113,6 +120,23 @@ winWindowProc (HWND hwnd, UINT message,
/* Store the mode key states so restore doesn't try to restore them */
winStoreModeKeyStates (s_pScreen);
+
+ /* Setup tray icon */
+ if (!s_pScreenInfo->fNoTrayIcon)
+ {
+ /*
+ * NOTE: The WM_CREATE message is processed before CreateWindowEx
+ * returns, so s_pScreenPriv->hwndScreen is invalid at this point.
+ * We go ahead and copy our hwnd parameter over top of the screen
+ * privates hwndScreen so that we have a valid value for
+ * that member. Otherwise, the tray icon will disappear
+ * the first time you move the mouse over top of it.
+ */
+
+ s_pScreenPriv->hwndScreen = hwnd;
+
+ winInitNotifyIcon (s_pScreenPriv);
+ }
return 0;
case WM_DISPLAYCHANGE:
@@ -161,7 +185,7 @@ winWindowProc (HWND hwnd, UINT message,
* Shadow DirectDraw Non-Locking
* Primary DirectDraw
*
- * TrueColor --> TrueColor depth changs are non-optimal for:
+ * TrueColor --> TrueColor depth changes are non-optimal for:
* Windowed:
* Shadow GDI
*
@@ -189,45 +213,14 @@ winWindowProc (HWND hwnd, UINT message,
/* 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");
+ /* Display Exit dialog */
+ winDisplayDepthChangeDialog (s_pScreenPriv);
- /* 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.
- */
- }
+ /* Flag that we have an invalid screen depth */
+ s_pScreenPriv->fBadDepth = TRUE;
+
+ /* Minimize the display window */
+ ShowWindow (hwnd, SW_MINIMIZE);
}
else
{
@@ -693,17 +686,17 @@ winWindowProc (HWND hwnd, UINT message,
}
/* Hide or show the Windows mouse cursor */
- if (s_fCursor && (s_pScreenPriv->fActive || s_pScreenInfo->fLessPointer))
+ if (g_fCursor && (s_pScreenPriv->fActive || s_pScreenInfo->fLessPointer))
{
/* Hide Windows cursor */
- s_fCursor = FALSE;
+ g_fCursor = FALSE;
ShowCursor (FALSE);
}
- else if (!s_fCursor && !s_pScreenPriv->fActive
+ else if (!g_fCursor && !s_pScreenPriv->fActive
&& !s_pScreenInfo->fLessPointer)
{
/* Show Windows cursor */
- s_fCursor = TRUE;
+ g_fCursor = TRUE;
ShowCursor (TRUE);
}
@@ -728,9 +721,9 @@ winWindowProc (HWND hwnd, UINT message,
break;
/* Non-client mouse movement, show Windows cursor */
- if (!s_fCursor)
+ if (!g_fCursor)
{
- s_fCursor = TRUE;
+ g_fCursor = TRUE;
ShowCursor (TRUE);
}
break;
@@ -742,9 +735,9 @@ winWindowProc (HWND hwnd, UINT message,
s_fTracking = FALSE;
/* Show the mouse cursor, if necessary */
- if (!s_fCursor)
+ if (!g_fCursor)
{
- s_fCursor = TRUE;
+ g_fCursor = TRUE;
ShowCursor (TRUE);
}
return 0;
@@ -806,6 +799,22 @@ winWindowProc (HWND hwnd, UINT message,
/* Clear screen privates flags */
s_pScreenPriv->iE3BCachedPress = 0;
break;
+
+ case WIN_POLLING_MOUSE_TIMER_ID:
+ {
+ POINT point;
+
+ /* Get the current position of the mouse cursor */
+ GetCursorPos (&point);
+
+ /* Map from screen (-X, -Y) to root (0, 0) */
+ point.x -= GetSystemMetrics (SM_XVIRTUALSCREEN);
+ point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ /* Deliver absolute cursor position to X Server */
+ miPointerAbsoluteCursor (point.x, point.y,
+ g_c32LastInputEventTime = GetTickCount());
+ }
}
return 0;
@@ -880,7 +889,7 @@ winWindowProc (HWND hwnd, UINT message,
&& (GetKeyState (VK_MENU) & 0x8000))
|| (s_pScreenInfo->fUseUnixKillKey && wParam == VK_BACK
&& (GetKeyState (VK_MENU) & 0x8000)
- && (GetKeyState (VK_CONTROL) & 0x8000)))
+ && (GetKeyState (VK_CONTROL) & 0x8000)))
{
/*
* Better leave this message here, just in case some unsuspecting
@@ -889,8 +898,8 @@ winWindowProc (HWND hwnd, UINT message,
*/
ErrorF ("winWindowProc - WM_*KEYDOWN - Closekey hit, quitting\n");
- /* Tell our message queue to give up */
- PostMessage (hwnd, WM_CLOSE, 0, 0);
+ /* Display Exit dialog */
+ winDisplayExitDialog (s_pScreenPriv);
return 0;
}
@@ -973,8 +982,6 @@ winWindowProc (HWND hwnd, UINT message,
return 0;
}
-
-
#if CYGDEBUG
ErrorF ("winWindowProc - WM_ACTIVATE\n");
#endif
@@ -990,10 +997,10 @@ winWindowProc (HWND hwnd, UINT message,
/* Reshow the Windows mouse cursor if we are being deactivated */
if (LOWORD(wParam) == WA_INACTIVE
- && !s_fCursor)
+ && !g_fCursor)
{
/* Show Windows cursor */
- s_fCursor = TRUE;
+ g_fCursor = TRUE;
ShowCursor (TRUE);
}
return 0;
@@ -1012,10 +1019,10 @@ winWindowProc (HWND hwnd, UINT message,
/* Reshow the Windows mouse cursor if we are being deactivated */
if (!s_pScreenPriv->fActive
- && !s_fCursor)
+ && !g_fCursor)
{
/* Show Windows cursor */
- s_fCursor = TRUE;
+ g_fCursor = TRUE;
ShowCursor (TRUE);
}
@@ -1023,109 +1030,43 @@ winWindowProc (HWND hwnd, UINT message,
(*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");
+ case ID_APP_EXIT:
+ /* Display Exit dialog */
+ winDisplayExitDialog (s_pScreenPriv);
+ return 0;
- /*
- * User dismissed the dialog, hide it until the
- * display mode is restored.
- */
- ShowWindow (g_hDlgDepthChange, SW_HIDE);
- return TRUE;
+ case ID_APP_HIDE_ROOT:
+ ShowWindow (s_pScreenPriv->hwndScreen, SW_HIDE);
+ s_pScreenPriv->fRootWindowShown = FALSE;
+ return 0;
+
+ case ID_APP_SHOW_ROOT:
+ ShowWindow (s_pScreenPriv->hwndScreen, SW_SHOW);
+ s_pScreenPriv->fRootWindowShown = TRUE;
+ return 0;
+
+ default:
+ /* It's probably one of the custom menus... */
+ return HandleCustomWM_COMMAND (0, LOWORD (wParam));
+
}
break;
- case WM_CLOSE:
- ErrorF ("winChangeDepthDlgProc - WM_CLOSE\n");
+ case WM_GIVEUP:
+ /* Tell X that we are giving up */
+ winDeinitClipboard ();
+ winDeinitMultiWindowWM ();
+ GiveUp (0);
+ return 0;
- /*
- * User dismissed the dialog, hide it until the
- * display mode is restored.
- */
- ShowWindow (g_hDlgDepthChange, SW_HIDE);
- return TRUE;
+ case WM_CLOSE:
+ /* Display Exit dialog */
+ winDisplayExitDialog (s_pScreenPriv);
+ return 0;
}
- return FALSE;
+ return DefWindowProc (hwnd, message, wParam, lParam);
}