tweak thread size
authorNiibe Yutaka <gniibe@fsij.org>
Wed, 15 Jun 2016 06:14:03 +0000 (15:14 +0900)
committerNiibe Yutaka <gniibe@fsij.org>
Wed, 15 Jun 2016 06:14:03 +0000 (15:14 +0900)
ChangeLog
chopstx
src/gnuk.ld.in
src/usb-ccid.c

index 86ed5fb..13eb7d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-06-15  NIIBE Yutaka  <gniibe@fsij.org>
+
+       * src/gnuk.ld.in (__process2_stack_size__): Update
+       thread size for rng by examining NeuG.
+
+       * src/usb-ccid.c (poll_event_intr): New.
+
 2016-06-14  Niibe Yutaka  <gniibe@fsij.org>
 
        * regnual/regnual.c (usb_device_reset): Rename from
diff --git a/chopstx b/chopstx
index 440188c..52626a3 160000 (submodule)
--- a/chopstx
+++ b/chopstx
@@ -1 +1 @@
-Subproject commit 440188c3738562391ad77fcb4c93d941e0d39456
+Subproject commit 52626a33684f4124c468d946deba82e44afab1bd
index 63a5b55..b0044d0 100644 (file)
@@ -4,7 +4,7 @@
 __main_stack_size__      = 0x0080;      /* Exception handlers     */
 __process0_stack_size__  = 0x0100;      /* main */
 __process1_stack_size__  = 0x0180;      /* ccid */
-__process2_stack_size__  = 0x0160;      /* rng */
+__process2_stack_size__  = 0x0180;      /* rng */
 __process3_stack_size__  = 0x1640;      /* gpg */
 __process4_stack_size__  = 0;           /* --- */
 __process5_stack_size__  = @MSC_SIZE@;  /* msc */
index fcd3753..8fa04dc 100644 (file)
@@ -1478,13 +1478,21 @@ usb_event_handle (struct usb_dev *dev)
       }
 }
 
+static void
+poll_event_intr (uint32_t *timeout, struct eventflag *ev, chopstx_intr_t *intr)
+{
+  chopstx_poll_cond_t poll_desc;
+
+  eventflag_prepare_poll (ev, &poll_desc);
+  chopstx_poll (timeout, 2, intr, &poll_desc);
+}
+
 void *
 ccid_thread (void *arg)
 {
   chopstx_intr_t interrupt;
   uint32_t timeout;
   eventmask_t m;
-  chopstx_poll_cond_t poll_desc;
   struct usb_dev dev;
 
   struct ep_in *epi = &endpoint_in;
@@ -1509,8 +1517,7 @@ ccid_thread (void *arg)
 
   while (bDeviceState != CONFIGURED)
     {
-      eventflag_prepare_poll (&c->ccid_comm, &poll_desc);
-      chopstx_poll (NULL, 2, &interrupt, &poll_desc);
+      poll_event_intr (NULL, &c->ccid_comm, &interrupt);
       if (interrupt.ready)
        usb_event_handle (&dev);
 
@@ -1524,8 +1531,7 @@ ccid_thread (void *arg)
   ccid_notify_slot_change (c);
   while (1)
     {
-      eventflag_prepare_poll (&c->ccid_comm, &poll_desc);
-      chopstx_poll (&timeout, 2, &interrupt, &poll_desc);
+      poll_event_intr (&timeout, &c->ccid_comm, &interrupt);
       if (interrupt.ready)
        {
          usb_event_handle (&dev);