From ee92bb15b361b3daee816a4e930be0032be2d9e7 Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Mon, 23 May 2016 13:00:33 +0900
Subject: Remove deprecated API

---
 ChangeLog                |  5 +++++
 chopstx.c                | 47 ++++-------------------------------------------
 chopstx.h                |  4 ----
 example-fs-bb48/stream.h | 26 --------------------------
 example-fs-bb48/tty.h    | 26 ++++++++++++++++++++++++++
 5 files changed, 35 insertions(+), 73 deletions(-)
 delete mode 100644 example-fs-bb48/stream.h
 create mode 100644 example-fs-bb48/tty.h

diff --git a/ChangeLog b/ChangeLog
index 4194e28..eca1bf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-20  NIIBE Yutaka  <gniibe@fsij.org>
+
+	* chopstx.c (chopstx_usec_wait_var): internal function.
+	(chopstx_wakeup_usec_wait): Remove.
+
 2016-05-19  NIIBE Yutaka  <gniibe@fsij.org>
 
 	* VERSION: 0.11.
diff --git a/chopstx.c b/chopstx.c
index baa0edd..a407086 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -1115,16 +1115,8 @@ chx_snooze (uint32_t state, uint32_t *usec_p)
   return r;
 }
 
-/**
- * chopstx_usec_wait_var - Sleep for micro seconds (specified by variable)
- * @var: Pointer to usec
- *
- * Sleep for micro seconds, specified by @var.
- * Another thread can clear @var to stop the caller going into sleep.
- *
- * This function is DEPRECATED.  Please use chopstx_poll.
- */
-void
+
+static void
 chopstx_usec_wait_var (uint32_t *var)
 {
   int r = 0;
@@ -1422,11 +1414,11 @@ chx_cond_hook (struct chx_px *px, struct chx_poll_head *pd)
 
 
 /**
- * chopstx_claim_irq - Claim interrupt request to handle by this thread
+ * chopstx_claim_irq - Claim interrupt request to handle
  * @intr: Pointer to INTR structure
  * @irq_num: IRQ Number (hardware specific)
  *
- * Claim interrupt @intr with @irq_num for this thread.
+ * Claim interrupt @intr with @irq_num
  */
 void
 chopstx_claim_irq (chopstx_intr_t *intr, uint8_t irq_num)
@@ -1647,37 +1639,6 @@ chx_join_hook (struct chx_px *px, struct chx_poll_head *pd)
 }
 
 
-/**
- * chopstx_wakeup_usec_wait - wakeup the sleeping thread for timer
- * @thd: Thread to be awakened
- *
- * Canceling the timer, wake up the sleeping thread.
- * No return value.
- *
- * This function is DEPRECATED.  Please use chopstx_cond_signal,
- * where sleeping process calls chopstx_poll.
- */
-void
-chopstx_wakeup_usec_wait (chopstx_t thd)
-{
-  struct chx_thread *tp = (struct chx_thread *)thd;
-  int yield = 0;
-
-  chx_cpu_sched_lock ();
-  if (tp->state == THREAD_WAIT_TIME)
-    {
-      ((struct chx_stack_regs *)tp->tc.reg[REG_SP])->reg[REG_R0] = 1;
-      chx_timer_dequeue (tp);
-      chx_ready_enqueue (tp);
-      if (tp->prio > running->prio)
-	yield = 1;
-    }
-  if (yield)
-    chx_sched (CHX_YIELD);
-  else
-    chx_cpu_sched_unlock ();
-}
-
 /**
  * chopstx_cancel - request a cancellation to a thread
  * @thd: Thread to be canceled
diff --git a/chopstx.h b/chopstx.h
index e39c36b..94eb5b0 100644
--- a/chopstx.h
+++ b/chopstx.h
@@ -113,12 +113,8 @@ typedef struct chx_cleanup {
 void chopstx_cleanup_push (chopstx_cleanup_t *clp);
 void chopstx_cleanup_pop (int execute);
 
-
 void chopstx_setpriority (chopstx_prio_t);
 
-void chopstx_usec_wait_var (uint32_t *arg); /* DEPRECATED */
-void chopstx_wakeup_usec_wait (chopstx_t thd); /* DEPRECATED */
-
 enum {
   CHOPSTX_POLL_COND = 0,
   CHOPSTX_POLL_INTR,
diff --git a/example-fs-bb48/stream.h b/example-fs-bb48/stream.h
deleted file mode 100644
index 77b7014..0000000
--- a/example-fs-bb48/stream.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#define BUFSIZE 128
-#define FLAG_CONNECTED   (1 << 0)
-#define FLAG_SEND_AVAIL  (1 << 1)
-#define FLAG_RECV_AVAIL  (1 << 2)
-
-/*
- * Current implementation is synchronous and buffers are not yet used.
- */
-struct stream {
-  chopstx_mutex_t mtx;
-  chopstx_cond_t cnd;
-  int sending;
-  unsigned int recv_len;
-  uint8_t recv_buf[BUFSIZE];
-  uint8_t buf_send[BUFSIZE];	/* Not yet used. */
-  uint8_t cnt_send_head;	/* Not yet used. */
-  uint8_t cnt_send_tail;	/* Not yet used. */
-  uint8_t cnt_recv_head;	/* Not yet used. */
-  uint8_t cnt_recv_tail;	/* Not yet used. */
-  uint32_t flags;
-};
-
-struct stream *stream_open (void);
-int stream_wait_connection (struct stream *st);
-int stream_send (struct stream *st, uint8_t *buf, uint8_t count);
-int stream_recv (struct stream *st, uint8_t *buf);
diff --git a/example-fs-bb48/tty.h b/example-fs-bb48/tty.h
new file mode 100644
index 0000000..77b7014
--- /dev/null
+++ b/example-fs-bb48/tty.h
@@ -0,0 +1,26 @@
+#define BUFSIZE 128
+#define FLAG_CONNECTED   (1 << 0)
+#define FLAG_SEND_AVAIL  (1 << 1)
+#define FLAG_RECV_AVAIL  (1 << 2)
+
+/*
+ * Current implementation is synchronous and buffers are not yet used.
+ */
+struct stream {
+  chopstx_mutex_t mtx;
+  chopstx_cond_t cnd;
+  int sending;
+  unsigned int recv_len;
+  uint8_t recv_buf[BUFSIZE];
+  uint8_t buf_send[BUFSIZE];	/* Not yet used. */
+  uint8_t cnt_send_head;	/* Not yet used. */
+  uint8_t cnt_send_tail;	/* Not yet used. */
+  uint8_t cnt_recv_head;	/* Not yet used. */
+  uint8_t cnt_recv_tail;	/* Not yet used. */
+  uint32_t flags;
+};
+
+struct stream *stream_open (void);
+int stream_wait_connection (struct stream *st);
+int stream_send (struct stream *st, uint8_t *buf, uint8_t count);
+int stream_recv (struct stream *st, uint8_t *buf);
-- 
cgit v1.2.3