This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Re: Problems with redboot_linux_exec.c...



On 17-May-2001 Jonathan Larmour wrote:
> [ Please send this to ecos-discuss next time, and not to individuals in Red
> Hat. I've answered this anyway just the once. ]
> 
> David Connelly wrote:
>> 
>> I am trying to build the latest redboot sources from the public cvs
>> repository and cannot get redboot_linux_exec.c to compile (the
>> file is in packages/hal/arm/sa11x0/var/current/src). Apparently,
>> there is a variable named 'script' which is referenced but never
>> declared. Is there a cvs tag which I could use to checkout the
>> last stable release of redboot? I am building for the Intel Assabet.
> 
> The latest one?
> 
> Seriously what's meant to happen is that redboot's main.c defines a macro
> called DEFINE_VARS. Then when redboot.h is included script gets defined
> there.
> 
> What I guess is actually happening though is that you're not importing the
> .ecm file from the assabet/current/misc dir. Without that, there's be no
> flash support, and no possibility of having a script.

Indeed, this is probably the problem.

However, the code should be protected against this.  I'll be checking in
this patch to fix it:

Index: hal/arm/sa11x0/var/current/src/redboot_linux_exec.c
===================================================================
RCS file: /home/cvs/ecc/ecc/hal/arm/sa11x0/var/current/src/redboot_linux_exec.c,v
retrieving revision 1.4
diff -u -5 -p -r1.4 redboot_linux_exec.c
--- hal/arm/sa11x0/var/current/src/redboot_linux_exec.c 2001/03/23 16:15:45     1.4
+++ hal/arm/sa11x0/var/current/src/redboot_linux_exec.c 2001/05/17 16:36:07
@@ -261,18 +261,22 @@ do_exec(int argc, char *argv[])
     params->hdr.size = 0;
     params->hdr.tag = ATAG_NONE;
 
     if (wait_time_set) {
         int script_timeout_ms = wait_time * 1000;
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
         unsigned char *hold_script = script;
+        script = (unsigned char *)0;
+#endif
         printf("About to start execution at %p - abort with ^C within %d seconds\n",
                (void *)entry, wait_time);
-        script = (unsigned char *)0;
         while (script_timeout_ms >= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT) {
             res = gets(line, sizeof(line), CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT);
             if (res == _GETS_CTRLC) {
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
                 script = hold_script;  // Re-enable script
+#endif
                 return;
             }
             script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
         }
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]