[PATCH rtems-lwip v1 1/9] uLan: Update sys_arch and fix additions
Kinsey Moore
kinsey.moore at oarcorp.com
Fri Jul 1 22:31:04 UTC 2022
This updates sys_arch.c and sys_arch.h to the latest versions from the
upstream repository at hash 9e6ce84f2071bf0fbe3922db1cacf00823b2bdc1 and
updates the modifications to be compliant with how this project handles
modifications to upstream sources.
---
uLan/ports/os/rtems/arch/sys_arch.c | 7 ++++++-
uLan/ports/os/rtems/arch/sys_arch.h | 25 +++++++++++++++++++++++--
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/uLan/ports/os/rtems/arch/sys_arch.c b/uLan/ports/os/rtems/arch/sys_arch.c
index ca7f8be..fa344a1 100644
--- a/uLan/ports/os/rtems/arch/sys_arch.c
+++ b/uLan/ports/os/rtems/arch/sys_arch.c
@@ -269,7 +269,11 @@ sys_thread_new(const char *name, lwip_thread_fn function, void *arg, int stack_s
rtems_status_code res;
res = rtems_task_create(
+#ifdef __rtems__
+ rtems_build_name(name[0], name[1], name[2], name[3]),
+#else
rtems_build_name('L', 'W', 'I', 'P'),
+#endif
prio,
stack_size,
RTEMS_PREEMPT,
@@ -356,6 +360,7 @@ sys_request_irq(unsigned int irqnum, sys_irq_handler_t handler,
return (res != RTEMS_SUCCESSFUL) ? -1 : 0;
}
+#ifdef __rtems__
sys_prot_t
sys_arch_protect()
{
@@ -375,4 +380,4 @@ sys_mbox_trypost_fromisr(sys_mbox_t *q, void *msg)
{
return sys_mbox_trypost(q, msg);
}
-
+#endif
diff --git a/uLan/ports/os/rtems/arch/sys_arch.h b/uLan/ports/os/rtems/arch/sys_arch.h
index c89abd4..a80244d 100644
--- a/uLan/ports/os/rtems/arch/sys_arch.h
+++ b/uLan/ports/os/rtems/arch/sys_arch.h
@@ -41,9 +41,8 @@
#include <rtems/rtems/sem.h>
#include <rtems/rtems/intr.h>
-#include <rtems/score/cpu.h>
#include <bsp/irq-generic.h>
-//#include "eth_lwip_default.h"
+#include "arch/eth_lwip_default.h"
/* Typedefs for the various port-specific types. */
#if defined(NO_SYS) && NO_SYS
@@ -101,8 +100,30 @@ sys_arch_unmask_interrupt_source(unsigned int x)
bsp_interrupt_vector_enable(x);
}
+#ifndef __rtems__
+static inline sys_prot_t
+sys_arch_protect(void)
+{
+ sys_prot_t pval;
+
+ rtems_interrupt_disable(pval);
+ return pval;
+}
+
+static inline void
+sys_arch_unprotect(sys_prot_t pval)
+{
+ rtems_interrupt_enable(pval);
+}
+
+static inline void
+sys_arch_data_sync_barier(void){
+ _ARM_Data_synchronization_barrier();
+}
+#else
sys_prot_t sys_arch_protect();
void sys_arch_unprotect(sys_prot_t pval);
+#endif
#endif /* __ARCH_SYS_ARCH_H__ */
--
2.30.2
More information about the devel
mailing list