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
10 \ * IBM Corporation - initial implementation
11 \ ****************************************************************************/
13 false VALUE (sms-loaded?)
15 false value (sms-available?)
17 s" sms.fs" romfs-lookup IF true to (sms-available?) drop THEN
21 #include "packages/sms.fs"
23 \ Initialize SMS NVRAM handling.
24 #include "sms-nvram.fs"
26 \ Dynamically load sms code from the romfs file
27 \ Assumption is that skeleton sms package already exists
28 \ but aside of open & close, all other methods are in a romfs file (sms.fs)
29 \ Here we open the package and load the rest of the functionality
31 \ After that, one needs to find-device and execute sms-start method
32 \ The shorthand for that is given as (global) sms-start word
34 : $sms-node s" /packages/sms" ;
36 : (sms-init-package) ( -- true|false )
37 (sms-loaded?) ?dup IF EXIT THEN
38 $sms-node ['] find-device catch IF 2drop false EXIT THEN
39 s" sms.fs" [COMPILE] included
41 true dup to (sms-loaded?)
44 \ External wrapper for sms package method
45 : (sms-evaluate) ( addr len -- )
46 (sms-init-package) not IF
47 cr ." SMS is not available." cr 2drop exit
50 s" Entering SMS ..." type
54 \ if we only had execute-device-method...
55 2>r $sms-node find-device
61 : sms-start ( -- ) s" sms-start" (sms-evaluate) ;
62 : sms-fru-replacement ( -- ) s" sms-fru-replacement" (sms-evaluate) ;
66 : sms-start ( -- ) cr ." SMS is not available." cr ;
67 : sms-fru-replacement ( -- ) cr ." SMS FRU replacement is not available." cr ;