This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: hal_idle_thread_action on ARM
- From: daniel dot neri at sigicom dot se (Daniel Néri)
- To: ecos-patches at sources dot redhat dot com
- Date: Fri, 16 May 2003 17:41:35 +0000
- Subject: Re: hal_idle_thread_action on ARM
- Cancel-lock: sha1:1C/C/mH2rujm6tSeWIIAbWUL+FU=
- Organization: Sigicom AB, Stockholm, Sweden
- References: <87r89nxbho.fsf@fnord.local.sigicom.com> <3E655589.1070401@eCosCentric.com>
Jonathan Larmour <jifl@eCosCentric.com> wrote:
> Daniel Néri wrote:
>> Greetings,
>> The ARM architecture HAL defines a dummy hal_idle_thread_action.
>> Which is the best way to override this in a variant or platform HAL?
>
> Since it's empty, but included all the time from the arch/hal_misc.c,
> it's probably better just to remove it from hal_arch.h and hal/misc.c.
>
> For overriding it, I'd probably recommend adding:
>
> #ifdef CYGINT_HAL_ARM_PLF_ARCH_H
> # include <cyg/hal/plf_arch.h>
> #endif
>
> and then adding CDL in the arch HAL to add a cdl_interface
> CYGINT_HAL_ARM_PLF_ARCH_H which platform CDL that supplies that header
> could then implement.
>
> Just my opinion though.
As I didn't quite share Jonathan's opinion, I finally came up with my
own solution (attached below). I'll make a separate post with a
HAL_IDLE_THREAD_ACTION implementation for the new AT91 variant HAL.
Regards,
--Daniel
cvs diff: Diffing hal/arm/arch
cvs diff: Diffing hal/arm/arch/current
Index: hal/arm/arch/current/ChangeLog
===================================================================
RCS file: /home/dne/cvsroot/redhat/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.1.1.6
retrieving revision 1.4
diff -u -5 -p -r1.1.1.6 -r1.4
--- hal/arm/arch/current/ChangeLog 2003/05/14 08:47:12 1.1.1.6
+++ hal/arm/arch/current/ChangeLog 2003/05/16 17:14:05 1.4
@@ -1,5 +1,14 @@
+2003-05-16 Daniel Néri <daniel.neri@sigicom.se>
+
+ * src/hal_misc.c (hal_idle_thread_action): Removed dummy.
+
+ * include/hal_arch.h: Let variant HALs define their own "idle
+ thread action".
+
+ * cdl/hal_arm.cdl: Add CDL interface for the above.
+
2003-05-06 Pierre Habraken <Pierre.Habraken@imag.fr>
* src/arm_stub.c (target_ins, target_thumb_ins): Added code to
enable stepping into swi instructions.
@@ -21,11 +30,11 @@
* src/vectors.S (handle_IRQ_or_FIQ): Tweak below to be conditional on
__thumb__.
2003-04-26 Daniel Néri <daniel.neri@sigicom.se>
- * vectors.S (handle_IRQ_or_FIQ):
+ * src/vectors.S (handle_IRQ_or_FIQ):
Use thumb-aware call to hal_spurious_IRQ.
2003-04-13 Bart Veer <bartv@ecoscentric.com>
* src/vectors.S (start): fix build problem with -mthumb
cvs diff: Diffing hal/arm/arch/current/cdl
Index: hal/arm/arch/current/cdl/hal_arm.cdl
===================================================================
RCS file: /home/dne/cvsroot/redhat/ecos/packages/hal/arm/arch/current/cdl/hal_arm.cdl,v
retrieving revision 1.1.1.2
retrieving revision 1.4
diff -u -5 -p -r1.1.1.2 -r1.4
--- hal/arm/arch/current/cdl/hal_arm.cdl 2003/05/14 08:47:12 1.1.1.2
+++ hal/arm/arch/current/cdl/hal_arm.cdl 2003/05/16 17:05:34 1.4
@@ -290,8 +290,12 @@ cdl_package CYGPKG_HAL_ARM {
}
cdl_interface CYGINT_HAL_ARM_MEM_REAL_REGION_TOP {
display "Implementations of hal_arm_mem_real_region_top()"
}
+
+ cdl_interface CYGINT_HAL_ARM_VAR_IDLE_THREAD_ACTION {
+ display "Implementations of hal_arm_var_idle_thread_action()"
+ }
}
# EOF hal_arm.cdl
cvs diff: Diffing hal/arm/arch/current/include
Index: hal/arm/arch/current/include/hal_arch.h
===================================================================
RCS file: /home/dne/cvsroot/redhat/ecos/packages/hal/arm/arch/current/include/hal_arch.h,v
retrieving revision 1.1.1.2
retrieving revision 1.5
diff -u -5 -p -r1.1.1.2 -r1.5
--- hal/arm/arch/current/include/hal_arch.h 2003/05/14 08:47:13 1.1.1.2
+++ hal/arm/arch/current/include/hal_arch.h 2003/05/16 17:05:40 1.5
@@ -330,13 +330,17 @@ externC void hal_longjmp(hal_jmp_buf env
// Idle thread code.
// This macro is called in the idle thread loop, and gives the HAL the
// chance to insert code. Typical idle thread behaviour might be to halt the
// processor.
-externC void hal_idle_thread_action(cyg_uint32 loop_count);
+#ifdef CYGINT_HAL_ARM_VAR_IDLE_THREAD_ACTION
+externC void hal_arm_var_idle_thread_action(cyg_uint32);
-#define HAL_IDLE_THREAD_ACTION(_count_) hal_idle_thread_action(_count_)
+#define HAL_IDLE_THREAD_ACTION(_count_) hal_arm_var_idle_thread_action(_count_)
+#else
+#define HAL_IDLE_THREAD_ACTION(_count_)
+#endif
//---------------------------------------------------------------------------
// Minimal and sensible stack sizes: the intention is that applications
// will use these to provide a stack size in the first instance prior to
cvs diff: Diffing hal/arm/arch/current/src
Index: hal/arm/arch/current/src/hal_misc.c
===================================================================
RCS file: /home/dne/cvsroot/redhat/ecos/packages/hal/arm/arch/current/src/hal_misc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -5 -p -r1.1.1.1 -r1.3
--- hal/arm/arch/current/src/hal_misc.c 2003/01/27 11:15:30 1.1.1.1
+++ hal/arm/arch/current/src/hal_misc.c 2003/03/18 14:54:15 1.3
@@ -212,18 +212,10 @@ hal_arch_default_isr(CYG_ADDRWORD vector
CYG_FAIL("Spurious Interrupt!!!");
return 0;
}
-/*------------------------------------------------------------------------*/
-/* Idle thread action */
-
-void
-hal_idle_thread_action( cyg_uint32 count )
-{
-}
-
/*-------------------------------------------------------------------------*/
/* Misc functions */
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
/* This function will generate a breakpoint exception. It is used at the