[Bug 1824] Keep rtems_shutdown_executive() parameter

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Mon Jul 11 13:57:51 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1824

--- Comment #4 from Joel Sherrill <joel.sherrill at oarcorp.com> 2011-07-11 08:57:50 CDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > What about changing the signature to return an int or uint32_t and returning
> > > the value to bootcard.c?
> > 
> > How? rtems_shutdown_executive() is called by the application, not by
> > bootcard.c.
> > 
> > > What do you want to do with this?
> > 
> > Tell the BSP whether it should turn off or reboot the system.
> 
> The problem is that we go back to the BSP (boot_card()) with a context switch. 
> A context switch has no return value.  You can use exit() and atexit() to alter
> the shutdown behavior.

I have been thinking of how to do this and I think I have a fairly
straight-forward solution:

+ rtems_shutdown_executive places result in _Thread_Idle's return status area.
We use the status return area when a thread blocks so this is in inline with
current usage.
+ rtems_initialize_start_multitasking just returns this value
+ bootcard can return this value to the start code.
+ The start code can test this.

This doesn't really impact much to this point.

I don't want to add a global variable.  One option is to have the value
returned by rtems_initialize_start_multitasking() to get passed into
bsp_cleanup() from bootcard.c.  This will require a global sweep of the BSPs. 
But not particularly hard in this case, since I only see 13 .c files with
bsp_cleanup().

This is a general improvement because in some cases a BSP could return a status
to the invoking environment.  I know of at least two use cases where this would
be useful.

> An alternative would be to add the least significant 8 bits of the exit status
> to the system state.

No tricks. :)

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list