[OpenBIOS] [commit] r1210 - in trunk/openbios-devel: arch/ppc/qemu arch/sparc32 arch/sparc64 drivers forth/admin forth/device
repository service
svn at openbios.org
Mon Aug 19 09:40:16 CEST 2013
Author: mcayland
Date: Mon Aug 19 09:40:16 2013
New Revision: 1210
URL: http://tracker.coreboot.org/trac/openbios/changeset/1210
Log:
display: move creation of "display" and "screen" properties to Forth
This means we can remove this code from vga_vbe_init() and move it
in to the generic display system. As part of this, we alter the
"input" and "output" words so that they update the stdin/stdout
handles under /chosen.
While we are here, fix up the various architectures so that they
don't call "input" and "output" themselves - this is now handled
by the Forth console.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
Modified:
trunk/openbios-devel/arch/ppc/qemu/init.c
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/arch/sparc64/openbios.c
trunk/openbios-devel/drivers/vga_vbe.c
trunk/openbios-devel/forth/admin/iocontrol.fs
trunk/openbios-devel/forth/device/display.fs
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/init.c Mon Aug 19 09:40:12 2013 (r1209)
+++ trunk/openbios-devel/arch/ppc/qemu/init.c Mon Aug 19 09:40:16 2013 (r1210)
@@ -870,18 +870,6 @@
fword("find-device");
push_str(stdin_path);
- fword("open-dev");
- fword("encode-int");
- push_str("stdin");
- fword("property");
-
- push_str(stdout_path);
- fword("open-dev");
- fword("encode-int");
- push_str("stdout");
- fword("property");
-
- push_str(stdin_path);
fword("pathres-resolve-aliases");
push_str("input-device");
fword("$setenv");
@@ -891,12 +879,6 @@
push_str("output-device");
fword("$setenv");
- push_str(stdin_path);
- fword("input");
-
- push_str(stdout_path);
- fword("output");
-
#if 0
if(getbool("tty-interface?") == 1)
#endif
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Mon Aug 19 09:40:12 2013 (r1209)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Mon Aug 19 09:40:16 2013 (r1210)
@@ -748,7 +748,6 @@
{
char nographic;
const char *stdin, *stdout;
- phandle_t chosen;
fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1);
if (nographic) {
@@ -763,31 +762,6 @@
stdout = "screen";
}
- push_str("/");
- fword("find-device");
-
- push_str(stdin);
- fword("pathres-resolve-aliases");
- fword("encode-string");
- push_str("stdin-path");
- fword("property");
-
- push_str(stdout);
- fword("pathres-resolve-aliases");
- fword("encode-string");
- push_str("stdout-path");
- fword("property");
-
- chosen = find_dev("/chosen");
- push_str(stdin);
- fword("open-dev");
- set_int_property(chosen, "stdin", POP());
-
- chosen = find_dev("/chosen");
- push_str(stdout);
- fword("open-dev");
- set_int_property(chosen, "stdout", POP());
-
push_str(stdin);
push_str("input-device");
fword("$setenv");
@@ -796,9 +770,6 @@
push_str("output-device");
fword("$setenv");
- push_str(stdin);
- fword("input");
-
obp_stdin_path = stdin;
obp_stdout_path = stdout;
}
Modified: trunk/openbios-devel/arch/sparc64/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc64/openbios.c Mon Aug 19 09:40:12 2013 (r1209)
+++ trunk/openbios-devel/arch/sparc64/openbios.c Mon Aug 19 09:40:16 2013 (r1210)
@@ -505,30 +505,12 @@
}
push_str(stdin_path);
- fword("open-dev");
- fword("encode-int");
- push_str("stdin");
- fword("property");
-
- push_str(stdout_path);
- fword("open-dev");
- fword("encode-int");
- push_str("stdout");
- fword("property");
-
- push_str(stdin_path);
push_str("input-device");
fword("$setenv");
push_str(stdout_path);
push_str("output-device");
fword("$setenv");
-
- push_str(stdin_path);
- fword("input");
-
- push_str(stdout_path);
- fword("output");
}
void arch_nvram_put(char *data)
Modified: trunk/openbios-devel/drivers/vga_vbe.c
==============================================================================
--- trunk/openbios-devel/drivers/vga_vbe.c Mon Aug 19 09:40:12 2013 (r1209)
+++ trunk/openbios-devel/drivers/vga_vbe.c Mon Aug 19 09:40:16 2013 (r1210)
@@ -55,7 +55,7 @@
unsigned long rom, uint32_t rom_size)
{
phys_addr_t phys;
- phandle_t ph, chosen, aliases;
+ phandle_t ph;
int size;
phys = fb;
@@ -73,14 +73,6 @@
ph = get_cur_dev();
#endif
- chosen = find_dev("/chosen");
- push_str(path);
- fword("open-dev");
- set_int_property(chosen, "display", POP());
-
- aliases = find_dev("/aliases");
- set_property(aliases, "screen", path, strlen(path) + 1);
-
if (rom_size >= 8) {
const char *p;
Modified: trunk/openbios-devel/forth/admin/iocontrol.fs
==============================================================================
--- trunk/openbios-devel/forth/admin/iocontrol.fs Mon Aug 19 09:40:12 2013 (r1209)
+++ trunk/openbios-devel/forth/admin/iocontrol.fs Mon Aug 19 09:40:16 2013 (r1210)
@@ -36,6 +36,19 @@
close-dev
then
stdin !
+
+ \ update /chosen
+ " /chosen" find-package if
+ >r stdin @ encode-int " stdin" r> (property)
+ then
+
+[IFDEF] CONFIG_SPARC32
+ \ update stdin-path properties
+ \ (this isn't part of the IEEE1275 spec but needed by older Solaris)
+ " /" find-package if
+ >r stdin @ get-instance-path encode-string " stdin-path" r> (property)
+ then
+[THEN]
;
: output ( dev-str dev-len -- )
@@ -57,6 +70,19 @@
\ close old stdout
stdout @ ?dup if close-dev then
stdout !
+
+ \ update /chosen
+ " /chosen" find-package if
+ >r stdout @ encode-int " stdout" r> (property)
+ then
+
+[IFDEF] CONFIG_SPARC32
+ \ update stdout-path properties
+ \ (this isn't part of the IEEE1275 spec but needed by older Solaris)
+ " /" find-package if
+ >r stdout @ get-instance-path encode-string " stdout-path" r> (property)
+ then
+[THEN]
;
: io ( dev-str dev-len -- )
Modified: trunk/openbios-devel/forth/device/display.fs
==============================================================================
--- trunk/openbios-devel/forth/device/display.fs Mon Aug 19 09:40:12 2013 (r1209)
+++ trunk/openbios-devel/forth/device/display.fs Mon Aug 19 09:40:16 2013 (r1210)
@@ -356,6 +356,14 @@
my-self to display-ih
+ \ set /chosen display property
+ my-self active-package 0 to my-self
+ " /chosen" (find-dev) 0<> if
+ active-package!
+ display-ih encode-int " display" property
+ then
+ active-package! to my-self
+
\ set defer functions to 8bit versions
['] fb8-draw-character to draw-character
More information about the OpenBIOS
mailing list