stackaddr/size change

This commit is contained in:
NIIBE Yutaka
2016-07-11 17:21:32 +09:00
parent c9d59a3f3f
commit 08cca6b9f8
9 changed files with 70 additions and 64 deletions

View File

@@ -1,3 +1,9 @@
2016-07-11 NIIBE Yutaka <gniibe@fsij.org>
* mcu/stm32f103.h: Add more from Gnuk 1.1.9.
* example-cdc, example-fs-bb48, example-fsm-55, example-led:
Update for stack addr/size.
2016-07-01 NIIBE Yutaka <gniibe@fsij.org> 2016-07-01 NIIBE Yutaka <gniibe@fsij.org>
* VERSION: 1.1. * VERSION: 1.1.

View File

@@ -61,14 +61,14 @@ blk (void *arg)
#define PRIO_PWM 3 #define PRIO_PWM 3
#define PRIO_BLK 2 #define PRIO_BLK 2
extern uint8_t __process1_stack_base__, __process1_stack_size__; extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
extern uint8_t __process2_stack_base__, __process2_stack_size__; extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
const uint32_t __stackaddr_pwm = (uint32_t)&__process1_stack_base__; #define STACK_ADDR_PWM ((uint32_t)__process1_stack_base__)
const size_t __stacksize_pwm = (size_t)&__process1_stack_size__; #define STACK_SIZE_PWM ((uint32_t)__process1_stack_size__)
const uint32_t __stackaddr_blk = (uint32_t)&__process2_stack_base__; #define STACK_ADDR_BLK ((uint32_t)__process2_stack_base__)
const size_t __stacksize_blk = (size_t)&__process2_stack_size__; #define STACK_SIZE_BLK ((uint32_t)__process2_stack_size__)
static char hexchar (uint8_t x) static char hexchar (uint8_t x)
@@ -98,8 +98,8 @@ main (int argc, const char *argv[])
m = 10; m = 10;
chopstx_create (PRIO_PWM, __stackaddr_pwm, __stacksize_pwm, pwm, NULL); chopstx_create (PRIO_PWM, STACK_ADDR_PWM, STACK_SIZE_PWM, pwm, NULL);
chopstx_create (PRIO_BLK, __stackaddr_blk, __stacksize_blk, blk, NULL); chopstx_create (PRIO_BLK, STACK_ADDR_BLK, STACK_SIZE_BLK, blk, NULL);
chopstx_usec_wait (200*1000); chopstx_usec_wait (200*1000);

View File

@@ -642,9 +642,9 @@ static void *tty_main (void *arg);
#define INTR_REQ_USB 20 #define INTR_REQ_USB 20
#define PRIO_TTY 4 #define PRIO_TTY 4
extern uint8_t __process3_stack_base__, __process3_stack_size__; extern uint8_t __process3_stack_base__[], __process3_stack_size__[];
const uint32_t __stackaddr_tty = (uint32_t)&__process3_stack_base__; #define STACK_ADDR_TTY ((uint32_t)__process3_stack_base__)
const size_t __stacksize_tty = (size_t)&__process3_stack_size__; #define STACK_SIZE_TTY ((uint32_t)__process3_stack_size__)
struct tty * struct tty *
tty_open (void) tty_open (void)
@@ -659,7 +659,7 @@ tty_open (void)
tty0.device_state = UNCONNECTED; tty0.device_state = UNCONNECTED;
memcpy (&tty0.line_coding, &line_coding0, sizeof (struct line_coding)); memcpy (&tty0.line_coding, &line_coding0, sizeof (struct line_coding));
chopstx_create (PRIO_TTY, __stackaddr_tty, __stacksize_tty, tty_main, &tty0); chopstx_create (PRIO_TTY, STACK_ADDR_TTY, STACK_SIZE_TTY, tty_main, &tty0);
return &tty0; return &tty0;
} }

View File

@@ -75,14 +75,14 @@ blk (void *arg)
#define PRIO_PWM 3 #define PRIO_PWM 3
#define PRIO_BLK 2 #define PRIO_BLK 2
extern uint8_t __process1_stack_base__, __process1_stack_size__; extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
extern uint8_t __process2_stack_base__, __process2_stack_size__; extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
const uint32_t __stackaddr_pwm = (uint32_t)&__process1_stack_base__; #define STACK_ADDR_PWM ((uint32_t)__process1_stack_base__)
const size_t __stacksize_pwm = (size_t)&__process1_stack_size__; #define STACK_SIZE_PWM ((uint32_t)__process1_stack_size__)
const uint32_t __stackaddr_blk = (uint32_t)&__process2_stack_base__; #define STACK_ADDR_BLK ((uint32_t)__process2_stack_base__)
const size_t __stacksize_blk = (size_t)&__process2_stack_size__; #define STACK_SIZE_BLK ((uint32_t)__process2_stack_size__)
static char hexchar (uint8_t x) static char hexchar (uint8_t x)
@@ -114,8 +114,8 @@ main (int argc, const char *argv[])
m = 10; m = 10;
chopstx_create (PRIO_PWM, __stackaddr_pwm, __stacksize_pwm, pwm, NULL); chopstx_create (PRIO_PWM, STACK_ADDR_PWM, STACK_SIZE_PWM, pwm, NULL);
chopstx_create (PRIO_BLK, __stackaddr_blk, __stacksize_blk, blk, NULL); chopstx_create (PRIO_BLK, STACK_ADDR_BLK, STACK_SIZE_BLK, blk, NULL);
chopstx_usec_wait (200*1000); chopstx_usec_wait (200*1000);

View File

@@ -629,9 +629,9 @@ static void *tty_main (void *arg);
#define INTR_REQ_USB 24 #define INTR_REQ_USB 24
#define PRIO_TTY 4 #define PRIO_TTY 4
extern uint8_t __process3_stack_base__, __process3_stack_size__; extern uint8_t __process3_stack_base__[], __process3_stack_size__[];
const uint32_t __stackaddr_tty = (uint32_t)&__process3_stack_base__; #define STACK_ADDR_TTY ((uint32_t)__process3_stack_base__)
const size_t __stacksize_tty = (size_t)&__process3_stack_size__; #define STACK_SIZE_TTY ((uint32_t)__process3_stack_size__)
struct tty * struct tty *
tty_open (void) tty_open (void)
@@ -646,7 +646,7 @@ tty_open (void)
tty0.device_state = UNCONNECTED; tty0.device_state = UNCONNECTED;
memcpy (&tty0.line_coding, &line_coding0, sizeof (struct line_coding)); memcpy (&tty0.line_coding, &line_coding0, sizeof (struct line_coding));
chopstx_create (PRIO_TTY, __stackaddr_tty, __stacksize_tty, tty_main, &tty0); chopstx_create (PRIO_TTY, STACK_ADDR_TTY, STACK_SIZE_TTY, tty_main, &tty0);
return &tty0; return &tty0;
} }

View File

@@ -166,14 +166,14 @@ button (void *arg)
#define PRIO_LED 3 #define PRIO_LED 3
#define PRIO_BUTTON 2 #define PRIO_BUTTON 2
extern uint8_t __process1_stack_base__, __process1_stack_size__; extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
extern uint8_t __process2_stack_base__, __process2_stack_size__; extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
const uint32_t __stackaddr_led = (uint32_t)&__process1_stack_base__; #define STACK_ADDR_LED ((uint32_t)__process1_stack_base__)
const size_t __stacksize_led = (size_t)&__process1_stack_size__; #define STACK_SIZE_LED ((uint32_t)__process1_stack_size__)
const uint32_t __stackaddr_button = (uint32_t)&__process2_stack_base__; #define STACK_ADDR_BUTTON ((uint32_t)__process2_stack_base__)
const size_t __stacksize_button = (size_t)&__process2_stack_size__; #define STACK_SIZE_BUTTON ((uint32_t)__process2_stack_size__)
#define DATA55(x0,x1,x2,x3,x4) (x0<<20)|(x1<<15)|(x2<<10)|(x3<< 5)|(x4<< 0) #define DATA55(x0,x1,x2,x3,x4) (x0<<20)|(x1<<15)|(x2<<10)|(x3<< 5)|(x4<< 0)
#define SIZE55(img) (sizeof (img) / sizeof (uint32_t)) #define SIZE55(img) (sizeof (img) / sizeof (uint32_t))
@@ -382,10 +382,10 @@ main (int argc, const char *argv[])
chopstx_cond_init (&cnd0); chopstx_cond_init (&cnd0);
chopstx_cond_init (&cnd1); chopstx_cond_init (&cnd1);
led_thd = chopstx_create (PRIO_LED, __stackaddr_led, led_thd = chopstx_create (PRIO_LED, STACK_ADDR_LED,
__stacksize_led, led, NULL); STACK_SIZE_LED, led, NULL);
button_thd = chopstx_create (PRIO_BUTTON, __stackaddr_button, button_thd = chopstx_create (PRIO_BUTTON, STACK_ADDR_BUTTON,
__stacksize_button, button, NULL); STACK_SIZE_BUTTON, button, NULL);
chopstx_usec_wait (200*1000); chopstx_usec_wait (200*1000);

View File

@@ -166,14 +166,14 @@ button (void *arg)
#define PRIO_LED 3 #define PRIO_LED 3
#define PRIO_BUTTON 2 #define PRIO_BUTTON 2
extern uint8_t __process1_stack_base__, __process1_stack_size__; extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
extern uint8_t __process2_stack_base__, __process2_stack_size__; extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
const uint32_t __stackaddr_led = (uint32_t)&__process1_stack_base__; #define STACK_ADDR_LED ((uint32_t)__process1_stack_base__)
const size_t __stacksize_led = (size_t)&__process1_stack_size__; #define STACK_SIZE_LED ((uint32_t)__process1_stack_size__)
const uint32_t __stackaddr_button = (uint32_t)&__process2_stack_base__; #define STACK_ADDR_BUTTON ((uint32_t)__process2_stack_base__)
const size_t __stacksize_button = (size_t)&__process2_stack_size__; #define STACK_SIZE_BUTTON ((uint32_t)__process2_stack_size__)
#define DATA55(x0,x1,x2,x3,x4) (x0<<20)|(x1<<15)|(x2<<10)|(x3<< 5)|(x4<< 0) #define DATA55(x0,x1,x2,x3,x4) (x0<<20)|(x1<<15)|(x2<<10)|(x3<< 5)|(x4<< 0)
#define SIZE55(img) (sizeof (img) / sizeof (uint32_t)) #define SIZE55(img) (sizeof (img) / sizeof (uint32_t))
@@ -370,10 +370,10 @@ main (int argc, const char *argv[])
chopstx_cond_init (&cnd0); chopstx_cond_init (&cnd0);
chopstx_cond_init (&cnd1); chopstx_cond_init (&cnd1);
led_thd = chopstx_create (PRIO_LED, __stackaddr_led, led_thd = chopstx_create (PRIO_LED, STACK_ADDR_LED,
__stacksize_led, led, NULL); STACK_SIZE_LED, led, NULL);
button_thd = chopstx_create (PRIO_BUTTON, __stackaddr_button, button_thd = chopstx_create (PRIO_BUTTON, STACK_ADDR_BUTTON,
__stacksize_button, button, NULL); STACK_SIZE_BUTTON, button, NULL);
chopstx_usec_wait (200*1000); chopstx_usec_wait (200*1000);

View File

@@ -88,10 +88,10 @@ led_enable_column (uint8_t col)
#define PRIO_LED 3 #define PRIO_LED 3
extern uint8_t __process1_stack_base__, __process1_stack_size__; extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
const uint32_t stackaddr_led = (uint32_t)&__process1_stack_base__; #define STACK_ADDR_LED ((uint32_t)__process1_stack_base__)
const size_t stacksize_led = (size_t)&__process1_stack_size__; #define STACK_SIZE_LED ((uint32_t)__process1_stack_size__)
static void * static void *
led (void *arg) led (void *arg)
@@ -119,10 +119,10 @@ led (void *arg)
#define PRIO_SPK 4 #define PRIO_SPK 4
extern uint8_t __process2_stack_base__, __process2_stack_size__; extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
const uint32_t stackaddr_spk = (uint32_t)&__process2_stack_base__; #define STACK_ADDR_SPK ((uint32_t)__process2_stack_base__)
const size_t stacksize_spk = (size_t)&__process2_stack_size__; #define STACK_SIZE_SPK ((uint32_t)__process2_stack_size__)
static chopstx_mutex_t spk_mtx; static chopstx_mutex_t spk_mtx;
static chopstx_cond_t spk_cnd; static chopstx_cond_t spk_cnd;
@@ -193,10 +193,10 @@ spk (void *arg)
#define PRIO_MUSIC 2 #define PRIO_MUSIC 2
extern uint8_t __process3_stack_base__, __process3_stack_size__; extern uint8_t __process3_stack_base__[], __process3_stack_size__[];
const uint32_t stackaddr_music = (uint32_t)&__process3_stack_base__; #define STACK_ADDR_MUSIC ((uint32_t)__process3_stack_base__)
const size_t stacksize_music = (size_t)&__process3_stack_size__; #define STACK_SIZE_MUSIC ((uint32_t)__process3_stack_size__)
#define C 0 #define C 0
#define D 1 #define D 1
@@ -254,7 +254,7 @@ music (void *arg)
chopstx_cond_init (&spk_cnd); chopstx_cond_init (&spk_cnd);
chopstx_cond_init (&spk_cnd_no_tone); chopstx_cond_init (&spk_cnd_no_tone);
chopstx_create (PRIO_SPK, stackaddr_spk, stacksize_spk, spk, NULL); chopstx_create (PRIO_SPK, STACK_ADDR_SPK, STACK_SIZE_SPK, spk, NULL);
while (1) while (1)
{ {
@@ -350,8 +350,8 @@ main (int argc, const char *argv[])
chopstx_mutex_init (&mtx); chopstx_mutex_init (&mtx);
chopstx_cond_init (&cnd); chopstx_cond_init (&cnd);
chopstx_create (PRIO_LED, stackaddr_led, stacksize_led, led, NULL); chopstx_create (PRIO_LED, STACK_ADDR_LED, STACK_SIZE_LED, led, NULL);
chopstx_create (PRIO_MUSIC, stackaddr_music, stacksize_music, music, NULL); chopstx_create (PRIO_MUSIC, STACK_ADDR_MUSIC, STACK_SIZE_MUSIC, music, NULL);
chopstx_usec_wait (200*1000); chopstx_usec_wait (200*1000);

View File

@@ -72,14 +72,14 @@ blk (void *arg)
#define PRIO_BLK 2 #define PRIO_BLK 2
#endif #endif
extern uint8_t __process1_stack_base__, __process1_stack_size__; extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
extern uint8_t __process2_stack_base__, __process2_stack_size__; extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
const uint32_t __stackaddr_pwm = (uint32_t)&__process1_stack_base__; #define STACK_ADDR_PWM ((uint32_t)__process1_stack_base__)
const size_t __stacksize_pwm = (size_t)&__process1_stack_size__; #define STACK_SIZE_PWM ((uint32_t)__process1_stack_size__)
const uint32_t __stackaddr_blk = (uint32_t)&__process2_stack_base__; #define STACK_ADDR_BLK ((uint32_t)__process2_stack_base__)
const size_t __stacksize_blk = (size_t)&__process2_stack_size__; #define STACK_SIZE_BLK ((uint32_t)__process2_stack_size__)
int int
@@ -94,8 +94,8 @@ main (int argc, const char *argv[])
m = 10; m = 10;
chopstx_create (PRIO_PWM, __stackaddr_pwm, __stacksize_pwm, pwm, NULL); chopstx_create (PRIO_PWM, STACK_ADDR_PWM, STACK_SIZE_PWM, pwm, NULL);
chopstx_create (PRIO_BLK, __stackaddr_blk, __stacksize_blk, blk, NULL); chopstx_create (PRIO_BLK, STACK_ADDR_BLK, STACK_SIZE_BLK, blk, NULL);
chopstx_usec_wait (200*1000); chopstx_usec_wait (200*1000);