~ubuntu-branches/ubuntu/wily/slof/wily

« back to all changes in this revision

Viewing changes to slof/fs/devices/pci-device_10de_0141.fs

  • Committer: Package Import Robot
  • Author(s): Aurelien Jarno
  • Date: 2012-09-16 23:05:23 UTC
  • Revision ID: package-import@ubuntu.com-20120916230523-r2ynulqmp2tyu2e5
Tags: upstream-20120217+dfsg
ImportĀ upstreamĀ versionĀ 20120217+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\ *****************************************************************************
 
2
\ * Copyright (c) 2004, 2008 IBM Corporation
 
3
\ * All rights reserved.
 
4
\ * This program and the accompanying materials
 
5
\ * are made available under the terms of the BSD License
 
6
\ * which accompanies this distribution, and is available at
 
7
\ * http://www.opensource.org/licenses/bsd-license.php
 
8
\ *
 
9
\ * Contributors:
 
10
\ *     IBM Corporation - initial implementation
 
11
\ ****************************************************************************/
 
12
 
 
13
my-space pci-class-name type
 
14
 
 
15
my-space pci-device-generic-setup
 
16
 
 
17
pci-io-enable
 
18
pci-mem-enable
 
19
 
 
20
30 config-l@  pci-find-fcode execute-rom-fcode
 
21
 
 
22
: check-display ( nodepath len -- true|false ) \ true if display found and "screen" alias set
 
23
\ check if display availabe, set screen alias
 
24
2dup find-node \ ( path len phandle|0 ) find node
 
25
?dup IF
 
26
   \ node found, get "display-type" property
 
27
   s" display-type" rot get-property ( path len true|propaddr proplen 0 )
 
28
   0= IF
 
29
      ( path len propaddr proplen ) \ property found, check if the value is not "NONE"
 
30
      s" NONE" 0 char-cat ( path len propaddr proplen str strlen ) \ null-terminated NONE string
 
31
      str= 0= IF
 
32
         ( path len ) \ "display-type" property is not "NONE" so we can set "screen" alias
 
33
         s" screen" 2swap set-alias 
 
34
         true ( true ) \  return true
 
35
      ELSE
 
36
         2drop false ( false ) \ return false
 
37
      THEN
 
38
   THEN
 
39
THEN
 
40
;
 
41
 
 
42
get-node node>path s" /NVDA,DISPLAY-A" $cat check-display
 
43
0= IF
 
44
   \ no display found on DISPLAY-A ... check DISPLAY-B
 
45
   get-node node>path s" /NVDA,DISPLAY-B" $cat check-display
 
46
   drop \ drop result 
 
47
THEN
 
48
 
 
49
s" name" get-my-property drop s"  ( " type type s"  ) " type cr