Author: mcayland Date: Fri Nov 30 00:02:25 2012 New Revision: 1075 URL: http://tracker.coreboot.org/trac/openbios/changeset/1075
Log: PPC: Rework assignment of keyboard devalias.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/ppc/qemu/qemu.fs
Modified: trunk/openbios-devel/arch/ppc/qemu/qemu.fs ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/qemu.fs Fri Nov 30 00:02:22 2012 (r1074) +++ trunk/openbios-devel/arch/ppc/qemu/qemu.fs Fri Nov 30 00:02:25 2012 (r1075) @@ -46,12 +46,37 @@ then ;
-\ set the keyboard alias to stdin +variable keyboard-phandle 0 keyboard-phandle ! + +: (find-keyboard-device) ( phandle -- ) + recursive + keyboard-phandle @ 0= if \ Return first match + >dn.child @ + begin ?dup while + dup dup " device_type" rot get-package-property 0= if + drop dup cstrlen + " keyboard" strcmp 0= if + dup to keyboard-phandle + then + then + (find-keyboard-device) + >dn.peer @ + repeat + else + drop + then +; + +\ create the keyboard devalias :noname - active-package - " /aliases" find-device - input-device encode-string " keyboard" property - active-package! + device-tree @ (find-keyboard-device) + keyboard-phandle @ if + active-package + " /aliases" find-device + keyboard-phandle @ get-package-path + encode-string " keyboard" property + active-package! + then ; SYSTEM-initializer
\ -------------------------------------------------------------------------