nios2: implement fiberRtnValueSet()
The return value of _Swap() is often treated as a "don't care" value and thus often ignored. However, there are cases when it is desirable to have a meaningful return value. This meaningful value can be assigned via fiberRtnValueSet(). To that end, a new field has been added to the coop register struct to store this value for when _Swap() needs to return that meaningful value. Change-Id: Ic4967fa7d602850c09ebde18e8bfd4c97cda9ec8 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
885e9084a8
commit
8a8a2928e5
3 changed files with 15 additions and 6 deletions
|
@ -91,6 +91,7 @@ struct s_coop {
|
|||
uint32_t ra; /* Return address */
|
||||
uint32_t sp; /* Stack pointer */
|
||||
uint32_t key; /* IRQ status before irq_lock() and call to _Swap() */
|
||||
uint32_t retval; /* Return value of _Swap() */
|
||||
};
|
||||
typedef struct s_coop t_coop;
|
||||
|
||||
|
@ -170,9 +171,7 @@ static ALWAYS_INLINE void nanoArchInit(void)
|
|||
static ALWAYS_INLINE void fiberRtnValueSet(struct tcs *fiber,
|
||||
unsigned int value)
|
||||
{
|
||||
ARG_UNUSED(fiber);
|
||||
ARG_UNUSED(value);
|
||||
/* STUB */
|
||||
fiber->coopReg.retval = value;
|
||||
}
|
||||
|
||||
static inline void _IntLibInit(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue