X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=common%2Fconsole.c;h=e9f23bec1820f178e3f4a67e3241182a0c65dc9d;hp=3c535d23d6d5ea592d982e57b41303c019a470f2;hb=d87080b721e4f8dca977af7571c5338ae7bb8db7;hpb=f6dbbe986481cff01334c64cacb971a5f237a9a9 diff --git a/common/console.c b/common/console.c index 3c535d23d6..e9f23bec18 100644 --- a/common/console.c +++ b/common/console.c @@ -27,6 +27,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + #ifdef CONFIG_AMIGAONEG3SE int console_changed = 0; #endif @@ -48,7 +50,6 @@ extern int overwrite_console (void); static int console_setfile (int file, device_t * dev) { - DECLARE_GLOBAL_DATA_PTR; int error = 0; if (dev == NULL) @@ -161,8 +162,6 @@ void fprintf (int file, const char *fmt, ...) int getc (void) { - DECLARE_GLOBAL_DATA_PTR; - if (gd->flags & GD_FLG_DEVINIT) { /* Get from the standard input */ return fgetc (stdin); @@ -174,8 +173,6 @@ int getc (void) int tstc (void) { - DECLARE_GLOBAL_DATA_PTR; - if (gd->flags & GD_FLG_DEVINIT) { /* Test the standard input */ return ftstc (stdin); @@ -187,8 +184,6 @@ int tstc (void) void putc (const char c) { - DECLARE_GLOBAL_DATA_PTR; - #ifdef CONFIG_SILENT_CONSOLE if (gd->flags & GD_FLG_SILENT) return; @@ -205,8 +200,6 @@ void putc (const char c) void puts (const char *s) { - DECLARE_GLOBAL_DATA_PTR; - #ifdef CONFIG_SILENT_CONSOLE if (gd->flags & GD_FLG_SILENT) return; @@ -258,8 +251,6 @@ static int ctrlc_disabled = 0; /* see disable_ctrl() */ static int ctrlc_was_pressed = 0; int ctrlc (void) { - DECLARE_GLOBAL_DATA_PTR; - if (!ctrlc_disabled && gd->have_console) { if (tstc ()) { switch (getc ()) { @@ -370,8 +361,6 @@ int console_assign (int file, char *devname) /* Called before relocation - use serial functions */ int console_init_f (void) { - DECLARE_GLOBAL_DATA_PTR; - gd->have_console = 1; #ifdef CONFIG_SILENT_CONSOLE @@ -407,7 +396,6 @@ device_t *search_device (int flags, char *name) /* Called after the relocation - use desired console functions */ int console_init_r (void) { - DECLARE_GLOBAL_DATA_PTR; char *stdinname, *stdoutname, *stderrname; device_t *inputdev = NULL, *outputdev = NULL, *errdev = NULL; #ifdef CFG_CONSOLE_ENV_OVERWRITE @@ -499,8 +487,6 @@ int console_init_r (void) /* Called after the relocation - use desired console functions */ int console_init_r (void) { - DECLARE_GLOBAL_DATA_PTR; - device_t *inputdev = NULL, *outputdev = NULL; int i, items = ListNumItems (devlist);