This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Old patch not in CVS...
- To: "Ecos-List (E-mail)" <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] Old patch not in CVS...
- From: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>
- Date: Tue, 18 Sep 2001 17:02:54 -0700
Hi,
Any idea why some part of this old patch
(http://sources.redhat.com/ml/ecos-discuss/2000-10/msg00337.html)
never made it into the CVS ? (or did I missed it ?)
The part i'm talking about is this one:
2/ kernel
Some additions to the C API.
* include/kapi.h src/kapi.cxx
added a C API for the clock conversation:
a new type:
cyg_clock_converter
3 new functions:
cyg_clock_get_other_to_clock_converter
cyg_clock_get_clock_to_other_converter
cyg_clock_convert
added a C API for getting thread state:
cyg_thread_get_state function and associated constants
Index: current/include/kapi.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/include/kapi.h,v
retrieving revision 1.9
diff -u -r1.9 kapi.h
--- kapi.h 2000/08/25 17:33:31 1.9
+++ kapi.h 2000/10/27 00:43:27
@@ -186,7 +186,16 @@
cyg_uint32 cyg_thread_get_stack_size(cyg_handle_t thread);
+/* Thread State Information */
+#define CYG_THREAD_RUNNING 0 // Thread is runnable or running
+#define CYG_THREAD_SLEEPING 1 // Thread is waiting for something
to happen
+#define CYG_THREAD_COUNTSLEEP 2 // Sleep in counted manner
+#define CYG_THREAD_SUSPENDED 4 // Suspend count is non-zero
+#define CYG_THREAD_CREATING 8 // Thread is being created
+#define CYG_THREAD_EXITED 16 // Thread has exited
+cyg_uint32 cyg_thread_get_state(cyg_handle_t thread);
+
/*--------------------------------------------------------------------------
-*/
/* Per-thread Data
*/
@@ -321,6 +330,11 @@
cyg_uint32 divisor;
} cyg_resolution_t;
+typedef struct
+{
+ cyg_uint64 mul1, div1, mul2, div2;
+} cyg_clock_converter;
+
/* Create a clock object */
void cyg_clock_create(
cyg_resolution_t resolution, /* Initial resolution
*/
@@ -343,6 +357,24 @@
);
cyg_resolution_t cyg_clock_get_resolution(cyg_handle_t clock);
+
+void cyg_clock_get_other_to_clock_converter(
+ cyg_handle_t clock,
+ cyg_uint64 ns_per_other_tick,
+ cyg_clock_converter *pcc
+);
+
+void cyg_clock_get_clock_to_other_converter(
+ cyg_handle_t clock,
+ cyg_uint64 ns_per_other_tick,
+ cyg_clock_converter *pcc
+);
+
+cyg_tick_count_t cyg_clock_convert(
+ cyg_handle_t clock,
+ cyg_tick_count_t value,
+ cyg_clock_converter *pcc
+);
/* handle of real time clock
*/
cyg_handle_t cyg_real_time_clock(void);
Index: current/src/common/kapi.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/src/common/kapi.cxx,v
retrieving revision 1.12
diff -u -r1.12 kapi.cxx
--- kapi.cxx 2000/08/25 17:33:31 1.12
+++ kapi.cxx 2000/10/27 00:43:32
@@ -277,6 +277,10 @@
return ((Cyg_Thread *)thread)->get_stack_size();
}
+externC cyg_uint32 cyg_thread_get_state(cyg_handle_t thread)
+{
+ return ((Cyg_Thread *)thread)->get_state();
+}
/*--------------------------------------------------------------------------
-*/
/* Per-thread data
*/
@@ -555,6 +559,38 @@
resolution.divisor = res.divisor;
return resolution;
+}
+
+externC void cyg_clock_get_other_to_clock_converter(
+ cyg_handle_t clock,
+ cyg_uint64 ns_per_other_tick,
+ cyg_clock_converter *pcc
+)
+{
+ ((Cyg_Clock *)clock)->get_other_to_clock_converter(
+ ns_per_other_tick,
+ (Cyg_Clock::converter *)pcc);
+}
+
+externC void cyg_clock_get_clock_to_other_converter(
+ cyg_handle_t clock,
+ cyg_uint64 ns_per_other_tick,
+ cyg_clock_converter *pcc
+)
+{
+ ((Cyg_Clock *)clock)->get_clock_to_other_converter(
+ ns_per_other_tick,
+ (Cyg_Clock::converter *)pcc);
+}
+
+
+externC cyg_tick_count_t cyg_clock_convert(
+ cyg_handle_t clock,
+ cyg_tick_count_t value,
+ cyg_clock_converter *pcc
+)
+{
+ return ((Cyg_Clock *)clock)->convert(value,(Cyg_Clock::converter
*)pcc);
}
#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK
--
Fabrice Gautier,
Fabrice_Gautier@sdesigns.com