Changes:

- declare tap_set_state_impl, tap_get_state, tap_set_end_state, 
tap_get_end_state as static inline,
this will decrease the calling overhead for this status getter and setter 
functions
diff --git a/src/jtag/interface.c b/src/jtag/interface.c
index 1ed4512..8d5d514 100644
--- a/src/jtag/interface.c
+++ b/src/jtag/interface.c
@@ -38,38 +38,13 @@
  * @see tap_set_state() and tap_get_state() accessors.
  * Actual name is not important since accessors hide it.
  */
-static tap_state_t state_follower = TAP_RESET;
-
-void tap_set_state_impl(tap_state_t new_state)
-{
-       /* this is the state we think the TAPs are in now, was cur_state */
-       state_follower = new_state;
-}
-
-tap_state_t tap_get_state()
-{
-       return state_follower;
-}
+tap_state_t state_follower = TAP_RESET;
 
 /**
  * @see tap_set_end_state() and tap_get_end_state() accessors.
  * Actual name is not important because accessors hide it.
  */
-static tap_state_t end_state_follower = TAP_RESET;
-
-void tap_set_end_state(tap_state_t new_end_state)
-{
-       /* this is the state we think the TAPs will be in at completion of the
-          current TAP operation, was end_state
-       */
-       end_state_follower = new_end_state;
-}
-
-tap_state_t tap_get_end_state()
-{
-       return end_state_follower;
-}
-
+tap_state_t end_state_follower = TAP_RESET;
 
 int tap_move_ndx(tap_state_t astate)
 {
diff --git a/src/jtag/interface.h b/src/jtag/interface.h
index 958af8f..623b106 100644
--- a/src/jtag/interface.h
+++ b/src/jtag/interface.h
@@ -36,9 +36,15 @@
  * cable.
  */
 
+/** */
+extern tap_state_t state_follower;
 
 /** implementation of wrapper function tap_set_state() */
-void tap_set_state_impl(tap_state_t new_state);
+static inline void tap_set_state_impl(tap_state_t new_state)
+{
+       /* this is the state we think the TAPs are in now, was cur_state */
+       state_follower = new_state;
+}
 
 /**
  * This function sets the state of a "state follower" which tracks the
@@ -74,7 +80,13 @@ static inline void tap_set_state(tap_state_t new_state)
  * state of the TAPs connected to the cable. @see tap_set_state @return
  * tap_state_t The state the TAPs are in now.
  */
-tap_state_t tap_get_state(void);
+static inline tap_state_t tap_get_state(void)
+{
+       return state_follower;
+}
+
+/** */
+extern tap_state_t end_state_follower;
 
 /**
  * This function sets the state of an "end state follower" which tracks
@@ -87,13 +99,23 @@ tap_state_t tap_get_state(void);
  * @param new_end_state The state the TAPs should enter at completion of
  *     a pending TAP operation.
  */
-void tap_set_end_state(tap_state_t new_end_state);
+static inline void tap_set_end_state(tap_state_t new_end_state)
+{
+       /* this is the state we think the TAPs will be in at completion of the
+          current TAP operation, was end_state
+       */
+       end_state_follower = new_end_state;
+}
 
 /**
  * For more information, @see tap_set_end_state
  * @return tap_state_t - The state the TAPs should be in at completion of the 
current TAP operation.
  */
-tap_state_t tap_get_end_state(void);
+static inline tap_state_t tap_get_end_state(void)
+{
+       return end_state_follower;
+}
+
 
 /**
  * This function provides a "bit sequence" indicating what has to be
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to