Follow Chopstx change
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2016-05-18 Niibe Yutaka <gniibe@fsij.org>
|
||||
|
||||
* src/gnuk.ld.in: Tweak thread size.
|
||||
* src/main.c (main): Use chopstx_setpriority.
|
||||
* src/usb-icc.c (ccid_init): Use new eventflag API.
|
||||
|
||||
* regnual/regnual.c (nvic_enable_intr): New.
|
||||
(main): Call nvic_enable_intr.
|
||||
|
||||
|
||||
2
chopstx
2
chopstx
Submodule chopstx updated: cea3200e48...5e33e7f468
@@ -2,11 +2,11 @@
|
||||
* ST32F103 memory setup.
|
||||
*/
|
||||
__main_stack_size__ = 0x0080; /* Exception handlers */
|
||||
__process0_stack_size__ = 0x0100; /* main */
|
||||
__process1_stack_size__ = 0x0120; /* ccid */
|
||||
__process2_stack_size__ = 0x01a0; /* rng */
|
||||
__process0_stack_size__ = 0x0180; /* main */
|
||||
__process1_stack_size__ = 0x0160; /* ccid */
|
||||
__process2_stack_size__ = 0x0140; /* rng */
|
||||
__process3_stack_size__ = 0x1640; /* gpg */
|
||||
__process4_stack_size__ = 0x0120; /* intr: usb */
|
||||
__process4_stack_size__ = 0x0100; /* intr: usb */
|
||||
__process5_stack_size__ = @MSC_SIZE@; /* msc */
|
||||
__process6_stack_size__ = @TIM_SIZE@; /* intr: timer */
|
||||
__process7_stack_size__ = @EXT_SIZE@; /* intr: ext */
|
||||
|
||||
@@ -94,7 +94,7 @@ _write (const char *s, int size)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void *USBthread (void *arg);
|
||||
extern void *ccid_thread (void *arg);
|
||||
|
||||
|
||||
/*
|
||||
@@ -304,7 +304,7 @@ main (int argc, char *argv[])
|
||||
|
||||
adc_init ();
|
||||
|
||||
eventflag_init (&led_event, chopstx_main);
|
||||
eventflag_init (&led_event);
|
||||
|
||||
random_init ();
|
||||
|
||||
@@ -313,7 +313,7 @@ main (int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
ccid_thd = chopstx_create (PRIO_CCID, __stackaddr_ccid, __stacksize_ccid,
|
||||
USBthread, NULL);
|
||||
ccid_thread, NULL);
|
||||
|
||||
#ifdef PINPAD_CIR_SUPPORT
|
||||
cir_init ();
|
||||
@@ -325,7 +325,7 @@ main (int argc, char *argv[])
|
||||
usb_thd = chopstx_create (PRIO_USB, __stackaddr_usb, __stacksize_usb,
|
||||
usb_intr, NULL);
|
||||
|
||||
chopstx_main_init (PRIO_MAIN);
|
||||
chopstx_setpriority (PRIO_MAIN);
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* usb-icc.c -- USB CCID protocol handling
|
||||
*
|
||||
* Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015
|
||||
* Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016
|
||||
* Free Software Initiative of Japan
|
||||
* Author: NIIBE Yutaka <gniibe@fsij.org>
|
||||
*
|
||||
@@ -248,7 +248,7 @@ static void ccid_reset (struct ccid *c)
|
||||
}
|
||||
|
||||
static void ccid_init (struct ccid *c, struct ep_in *epi, struct ep_out *epo,
|
||||
struct apdu *a, chopstx_t thd)
|
||||
struct apdu *a)
|
||||
{
|
||||
icc_state_p = &c->icc_state;
|
||||
|
||||
@@ -260,9 +260,9 @@ static void ccid_init (struct ccid *c, struct ep_in *epi, struct ep_out *epo,
|
||||
memset (&c->icc_header, 0, sizeof (struct icc_header));
|
||||
c->sw1sw2[0] = 0x90;
|
||||
c->sw1sw2[1] = 0x00;
|
||||
eventflag_init (&c->ccid_comm, thd);
|
||||
eventflag_init (&c->ccid_comm);
|
||||
c->application = 0;
|
||||
eventflag_init (&c->openpgp_comm, 0);
|
||||
eventflag_init (&c->openpgp_comm);
|
||||
c->epi = epi;
|
||||
c->epo = epo;
|
||||
c->a = a;
|
||||
@@ -1329,33 +1329,23 @@ ccid_usb_reset (void)
|
||||
|
||||
#define GPG_THREAD_TERMINATED 0xffff
|
||||
|
||||
static void *ccid_thread (chopstx_t) __attribute__ ((noinline));
|
||||
|
||||
void * __attribute__ ((naked))
|
||||
USBthread (void *arg)
|
||||
{
|
||||
chopstx_t thd;
|
||||
(void)arg;
|
||||
|
||||
asm ("mov %0, sp" : "=r" (thd));
|
||||
return ccid_thread (thd);
|
||||
}
|
||||
|
||||
#define NOTIFY_SLOT_CHANGE 0x50
|
||||
|
||||
static void * __attribute__ ((noinline))
|
||||
ccid_thread (chopstx_t thd)
|
||||
void *
|
||||
ccid_thread (void *arg)
|
||||
{
|
||||
struct ep_in *epi = &endpoint_in;
|
||||
struct ep_out *epo = &endpoint_out;
|
||||
struct ccid *c = &ccid;
|
||||
struct apdu *a = &apdu;
|
||||
|
||||
(void)arg;
|
||||
|
||||
reset:
|
||||
epi_init (epi, ENDP1, notify_tx, c);
|
||||
epo_init (epo, ENDP1, notify_icc, c);
|
||||
apdu_init (a);
|
||||
ccid_init (c, epi, epo, a, thd);
|
||||
ccid_init (c, epi, epo, a);
|
||||
|
||||
icc_prepare_receive (c);
|
||||
while (1)
|
||||
|
||||
Reference in New Issue
Block a user