summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2022-06-16 09:28:21 -0500
committerKinsey Moore <kinsey.moore@oarcorp.com>2022-06-16 13:33:29 -0500
commitb9f8a984bef5861b79dbfaddc68dfc1ab1ec32e9 (patch)
tree9013c20fc4cdbbb825ecfdcc7866d5e9236e801a
parent0b367b535083535896607710bbe8a46f8f6e0c74 (diff)
uLan: Update sys_arch and fix additions
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.
-rw-r--r--uLan/ports/os/rtems/arch/sys_arch.c7
-rw-r--r--uLan/ports/os/rtems/arch/sys_arch.h25
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__ */