[PATCH 29/30] leon, greth: SMP support by using spin-lock protection

Sebastian Huber sebastian.huber at embedded-brains.de
Tue May 2 05:48:47 UTC 2017



On 13/04/17 21:31, Daniel Hellstrom wrote:
> ---
>   c/src/lib/libbsp/sparc/shared/net/greth.c | 134 ++++++++++++++++--------------
>   1 file changed, 71 insertions(+), 63 deletions(-)
>
> diff --git a/c/src/lib/libbsp/sparc/shared/net/greth.c b/c/src/lib/libbsp/sparc/shared/net/greth.c
> index 7726799..9af2de2 100644
> --- a/c/src/lib/libbsp/sparc/shared/net/greth.c
> +++ b/c/src/lib/libbsp/sparc/shared/net/greth.c
> @@ -41,6 +41,18 @@
>   #include <netinet/in.h>
>   #include <netinet/if_ether.h>
>   
> +#include <rtems/score/isrlock.h> /* spin-lock */
> +
> +/* map via ISR lock: */
> +#define SPIN_DECLARE(lock) ISR_LOCK_MEMBER(lock)
> +#define SPIN_INIT(lock, name) _ISR_lock_Initialize(lock, name)
> +#define SPIN_LOCK(lock, level) _ISR_lock_Acquire_inline(lock, &level)
> +#define SPIN_LOCK_IRQ(lock, level) _ISR_lock_ISR_disable_and_acquire(lock, &level)
> +#define SPIN_UNLOCK(lock, level) _ISR_lock_Release_inline(lock, &level)
> +#define SPIN_UNLOCK_IRQ(lock, level) _ISR_lock_Release_and_ISR_enable(lock, &level)
> +#define SPIN_IRQFLAGS(k) ISR_lock_Context k
> +#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k)

Could you please use the rtems_interrupt_lock_*() API and not the 
internal _ISR_lock_*() stuff.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list