aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Lohoff <flo@rfc822.org>2008-10-04 16:31:56 +0000
committerGuido G√ľnther <agx@sigxcpu.org>2009-04-26 15:26:26 +0200
commit9a9e8c11088f1772eb7070e4e1ab1c8d5b4bc528 (patch)
tree9b0c01df2766be5c4bab905b61c8aa63e028f169
parent88aacc5ec96304a23c4d33ac3cdc71985f099c72 (diff)
Abstract cache flush, reset and interactive
-rw-r--r--arclib/prom.c13
-rw-r--r--common/prom.h4
-rw-r--r--ext2load/loader.c6
-rw-r--r--tip22/tftpload.c4
4 files changed, 22 insertions, 5 deletions
diff --git a/arclib/prom.c b/arclib/prom.c
index 27a8e69..87a2bf3 100644
--- a/arclib/prom.c
+++ b/arclib/prom.c
@@ -7,6 +7,19 @@
#include <stdlib.h>
#include <subarch.h>
+void prom_flush_cache_all(void ) {
+ ArcFlushAllCaches();
+}
+
+void prom_restart(void ) {
+ ArcRestart();
+}
+
+void prom_return_interactive(void ) {
+ ArcEnterInteractiveMode();
+}
+
+
void prom_wait(const char *prompt)
{
int ch;
diff --git a/common/prom.h b/common/prom.h
index 053652c..cfd255b 100644
--- a/common/prom.h
+++ b/common/prom.h
@@ -1,4 +1,8 @@
+void prom_restart(void );
+void prom_return_interactive(void );
+void prom_flush_cache_all(void );
+
void prom_fatal(const char *message, ...);
void prom_wait(const char *prompt);
diff --git a/ext2load/loader.c b/ext2load/loader.c
index f4c06c6..1995b44 100644
--- a/ext2load/loader.c
+++ b/ext2load/loader.c
@@ -538,12 +538,12 @@ void _start(LONG argc, CHAR *argv[], CHAR *envp[])
if( kernel_entry64 ) {
if(is64==0){
printf("Starting ELF32 kernel\n\r");
- ArcFlushAllCaches();
+ prom_flush_cache_all();
((void (*)(int argc, CHAR * argv[], CHAR * envp[]))
kernel_entry32)(nargc ,nargv, envp);
} else {
printf("Starting ELF64 kernel\n\r");
- ArcFlushAllCaches();
+ prom_flush_cache_all();
_start64(nargc, nargv, envp, &kernel_entry64);
}
} else {
@@ -552,5 +552,5 @@ void _start(LONG argc, CHAR *argv[], CHAR *envp[])
/* Not likely to get back here in a functional state, but what the heck */
prom_wait("\n\r--- Press <spacebar> to restart ---");
- ArcRestart();
+ prom_restart();
}
diff --git a/tip22/tftpload.c b/tip22/tftpload.c
index c438401..2d649a0 100644
--- a/tip22/tftpload.c
+++ b/tip22/tftpload.c
@@ -266,7 +266,7 @@ void _start(LONG argc, CHAR * argv[], CHAR * envp[])
#endif
/* Finally jump into the kernel */
printf("Starting kernel...\n\r");
- ArcFlushAllCaches();
+ prom_flush_cache_all();
if( kernel_entry )
(*kernel_entry)(nargc ,nargv, envp);
else
@@ -275,5 +275,5 @@ void _start(LONG argc, CHAR * argv[], CHAR * envp[])
/* Not likely to get back here in a functional state,
* but what the heck */
prom_wait("\n\r--- Press <spacebar> to restart ---");
- ArcRestart();
+ prom_restart();
}