Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / SLOF / board-qemu / slof / rtas-nvram.fs
1 \ *****************************************************************************
2 \ * Copyright (c) 2012 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 ." Populating " pwd cr
14
15 0 VALUE my-nvram-fetch
16 0 VALUE my-nvram-store
17 0 VALUE my-nvram-size
18 0 VALUE nvram-addr
19
20 : open true ;
21 : close ;
22
23 : write ( adr len -- actual )
24   nip
25 ;
26
27 : read  ( adr len -- actual )
28   nip
29 ;
30
31 : setup-alias
32     " nvram" find-alias 0= IF
33         " nvram" get-node node>path set-alias
34     ELSE
35         drop
36     THEN
37 ;
38
39 " #bytes" get-node get-package-property 0= IF
40     decode-int to my-nvram-size 2drop
41     " nvram-fetch" rtas-get-token to my-nvram-fetch
42     " nvram-store" rtas-get-token to my-nvram-store
43     my-nvram-size to nvram-size
44     nvram-size alloc-mem to nvram-addr
45     my-nvram-fetch my-nvram-store nvram-size nvram-addr internal-nvram-init
46 THEN
47
48 setup-alias