From e62ca0b357f09804d7d894949df44224c9d74bb7 Mon Sep 17 00:00:00 2001 From: bernie Date: Fri, 29 Aug 2008 20:37:03 +0000 Subject: [PATCH] rename cpuXXX_t to cpu_XXX_t git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1761 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/os.h | 4 +-- bertos/cpu/arm/drv/ser_at91.c | 4 +-- bertos/cpu/arm/drv/stepper_at91.c | 2 +- bertos/cpu/arm/drv/stepper_at91_hw_test.c | 2 +- bertos/cpu/arm/drv/sysirq_at91.c | 2 +- bertos/cpu/arm/drv/timer_at91.c | 2 +- bertos/cpu/avr/drv/kdebug_avr.c | 2 +- bertos/cpu/avr/drv/lcd_32122a_avr.c | 2 +- bertos/cpu/avr/drv/ser_avr.c | 2 +- bertos/cpu/avr/drv/timer_avr.c | 8 ++--- bertos/cpu/frame.h | 6 ++-- bertos/cpu/irq.h | 8 ++--- bertos/cpu/types.h | 44 +++++++++++------------ bertos/drv/buzzer.c | 4 +-- bertos/drv/dc_motor.c | 2 +- bertos/drv/kbd.c | 2 +- bertos/drv/phase.c | 4 +-- bertos/drv/pwm.c | 2 +- bertos/drv/timer.c | 2 +- bertos/hw/hw_lcd.h | 2 +- bertos/kern/coop.c | 6 ++-- bertos/kern/idle.c | 2 +- bertos/kern/monitor.c | 14 ++++---- bertos/kern/monitor.h | 4 +-- bertos/kern/preempt.c | 2 +- bertos/kern/proc.c | 12 +++---- bertos/kern/proc.h | 22 ++++++------ bertos/kern/proc_p.h | 4 +-- bertos/kern/proc_test.c | 4 +-- bertos/kern/signal.c | 8 ++--- bertos/mware/observer.c | 2 +- 31 files changed, 93 insertions(+), 93 deletions(-) diff --git a/bertos/cfg/os.h b/bertos/cfg/os.h index 7fe97129..92f20d91 100644 --- a/bertos/cfg/os.h +++ b/bertos/cfg/os.h @@ -47,7 +47,7 @@ #define OS_ID win32 // FIXME: Maybe disable Win32 exceptions? - typedef int cpuflags_t; + typedef int cpu_flags_t; #define IRQ_DISABLE FIXME #define IRQ_ENABLE FIXME #define IRQ_SAVE_DISABLE(old_sigs) FIXME @@ -66,7 +66,7 @@ * The POSIX moral equivalent of disabling IRQs is disabling signals. */ #include - typedef sigset_t cpuflags_t; + typedef sigset_t cpu_flags_t; #define SET_ALL_SIGNALS(sigs) \ do { \ diff --git a/bertos/cpu/arm/drv/ser_at91.c b/bertos/cpu/arm/drv/ser_at91.c index 902ccc2f..01a7ac27 100644 --- a/bertos/cpu/arm/drv/ser_at91.c +++ b/bertos/cpu/arm/drv/ser_at91.c @@ -523,7 +523,7 @@ static void spi0_starttx(struct SerialHardware *_hw) { struct ArmSerial *hw = (struct ArmSerial *)_hw; - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Send data only if the SPI is not already transmitting */ @@ -607,7 +607,7 @@ static void spi1_starttx(struct SerialHardware *_hw) { struct ArmSerial *hw = (struct ArmSerial *)_hw; - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Send data only if the SPI is not already transmitting */ diff --git a/bertos/cpu/arm/drv/stepper_at91.c b/bertos/cpu/arm/drv/stepper_at91.c index d6fc286d..fa1b6470 100644 --- a/bertos/cpu/arm/drv/stepper_at91.c +++ b/bertos/cpu/arm/drv/stepper_at91.c @@ -362,7 +362,7 @@ void stepper_tc_setup(int index, stepper_isr_t callback, struct Stepper *motor) *motor->timer->comp_c_reg = 0; //Register interrupt vector - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* diff --git a/bertos/cpu/arm/drv/stepper_at91_hw_test.c b/bertos/cpu/arm/drv/stepper_at91_hw_test.c index d40da084..8fb1820c 100644 --- a/bertos/cpu/arm/drv/stepper_at91_hw_test.c +++ b/bertos/cpu/arm/drv/stepper_at91_hw_test.c @@ -150,7 +150,7 @@ void stepper_timer_test_brute(void) TC2_RA = 0; TC2_RB = 0; - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Set the vector. */ diff --git a/bertos/cpu/arm/drv/sysirq_at91.c b/bertos/cpu/arm/drv/sysirq_at91.c index 281c7963..410e53f0 100644 --- a/bertos/cpu/arm/drv/sysirq_at91.c +++ b/bertos/cpu/arm/drv/sysirq_at91.c @@ -119,7 +119,7 @@ MOD_DEFINE(sysirq); */ void sysirq_init(void) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Disable all system interrupts */ diff --git a/bertos/cpu/arm/drv/timer_at91.c b/bertos/cpu/arm/drv/timer_at91.c index a4375335..b3db6a0f 100644 --- a/bertos/cpu/arm/drv/timer_at91.c +++ b/bertos/cpu/arm/drv/timer_at91.c @@ -65,7 +65,7 @@ { sysirq_init(); - cpuflags_t flags; + cpu_flags_t flags; MOD_CHECK(sysirq); diff --git a/bertos/cpu/avr/drv/kdebug_avr.c b/bertos/cpu/avr/drv/kdebug_avr.c index c730836d..886b7d6d 100644 --- a/bertos/cpu/avr/drv/kdebug_avr.c +++ b/bertos/cpu/avr/drv/kdebug_avr.c @@ -164,7 +164,7 @@ #define KDBG_WRITE_CHAR(c) _kdebug_bitbang_putchar((c)) #define KDBG_MASK_IRQ(old) do { IRQ_SAVE_DISABLE((old)); } while(0) #define KDBG_RESTORE_IRQ(old) do { IRQ_RESTORE((old)); } while(0) - typedef cpuflags_t kdbg_irqsave_t; + typedef cpu_flags_t kdbg_irqsave_t; #define KDBG_DELAY (((CLOCK_FREQ + CONFIG_KDEBUG_BAUDRATE / 2) / CONFIG_KDEBUG_BAUDRATE) + 7) / 14 diff --git a/bertos/cpu/avr/drv/lcd_32122a_avr.c b/bertos/cpu/avr/drv/lcd_32122a_avr.c index 7b18741a..2f27d454 100644 --- a/bertos/cpu/avr/drv/lcd_32122a_avr.c +++ b/bertos/cpu/avr/drv/lcd_32122a_avr.c @@ -465,7 +465,7 @@ void lcd_32122_init(void) MOD_CHECK(timer); // FIXME: interrupts are already disabled when we get here?!? - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); PORTB |= BV(LCD_PB_A0); diff --git a/bertos/cpu/avr/drv/ser_avr.c b/bertos/cpu/avr/drv/ser_avr.c index 955ab8eb..21da6b8e 100644 --- a/bertos/cpu/avr/drv/ser_avr.c +++ b/bertos/cpu/avr/drv/ser_avr.c @@ -533,7 +533,7 @@ static void spi_starttx(struct SerialHardware *_hw) { struct AvrSerial *hw = (struct AvrSerial *)_hw; - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Send data only if the SPI is not already transmitting */ diff --git a/bertos/cpu/avr/drv/timer_avr.c b/bertos/cpu/avr/drv/timer_avr.c index b6771a92..a0083bcb 100644 --- a/bertos/cpu/avr/drv/timer_avr.c +++ b/bertos/cpu/avr/drv/timer_avr.c @@ -93,7 +93,7 @@ static void timer_hw_init(void) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Reset Timer flags */ @@ -127,7 +127,7 @@ static void timer_hw_init(void) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Reset Timer overflow flag */ @@ -165,7 +165,7 @@ #elif (CONFIG_TIMER == TIMER_ON_OUTPUT_COMPARE2) static void timer_hw_init(void) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Reset Timer flags */ @@ -207,7 +207,7 @@ static void timer_hw_init(void) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Reset Timer overflow flag */ diff --git a/bertos/cpu/frame.h b/bertos/cpu/frame.h index fe22f8e3..2a9680a2 100644 --- a/bertos/cpu/frame.h +++ b/bertos/cpu/frame.h @@ -145,7 +145,7 @@ #if !CPU_SP_ON_EMPTY_SLOT /* DSP56K and other weirdos */ #define CPU_PUSH_WORD(sp, data) \ - do { *++(sp) = (cpustack_t)(data); } while (0) + do { *++(sp) = (cpu_stack_t)(data); } while (0) #define CPU_POP_WORD(sp) \ (*(sp)--) #else @@ -207,13 +207,13 @@ #define CPU_PUSH_CALL_FRAME(sp, func) \ do { \ - CPU_PUSH_WORD((sp), (cpustack_t)(func)); /* LR -> 8(SP) */ \ + CPU_PUSH_WORD((sp), (cpu_stack_t)(func)); /* LR -> 8(SP) */ \ CPU_PUSH_WORD((sp), 0); /* CR -> 4(SP) */ \ } while (0) #else #define CPU_PUSH_CALL_FRAME(sp, func) \ - CPU_PUSH_WORD((sp), (cpustack_t)(func)) + CPU_PUSH_WORD((sp), (cpu_stack_t)(func)) #endif /** diff --git a/bertos/cpu/irq.h b/bertos/cpu/irq.h index 0d0d4686..011524b8 100644 --- a/bertos/cpu/irq.h +++ b/bertos/cpu/irq.h @@ -69,8 +69,8 @@ #if __CPU_MODE__ == 1 /* Thumb */ /* Use stubs */ - extern cpuflags_t get_CPSR(void); - extern void set_CPSR(cpuflags_t flags); + extern cpu_flags_t get_CPSR(void); + extern void set_CPSR(cpu_flags_t flags); #else #define get_CPSR __get_CPSR #define set_CPSR __set_CPSR @@ -138,7 +138,7 @@ #define CPU_READ_FLAGS() \ ({ \ - cpuflags_t sreg; \ + cpu_flags_t sreg; \ asm volatile ( \ "mrs %0, cpsr\n\t" \ : "=r" (sreg) \ @@ -259,7 +259,7 @@ */ #define ATOMIC(CODE) \ do { \ - cpuflags_t __flags; \ + cpu_flags_t __flags; \ IRQ_SAVE_DISABLE(__flags); \ CODE; \ IRQ_RESTORE(__flags); \ diff --git a/bertos/cpu/types.h b/bertos/cpu/types.h index 03bbdbf3..8b817938 100644 --- a/bertos/cpu/types.h +++ b/bertos/cpu/types.h @@ -47,62 +47,62 @@ #if CPU_I196 - typedef uint16_t cpuflags_t; // FIXME - typedef unsigned int cpustack_t; - typedef unsigned int cpuatomic_t; + typedef uint16_t cpu_flags_t; // FIXME + typedef unsigned int cpu_stack_t; + typedef unsigned int cpu_atomic_t; #warning Verify following constant #define SIZEOF_CPUSTACK_T 2 #elif CPU_X86 - /* Get cpuflags_t definition from the hosting environment. */ + /* Get cpu_flags_t definition from the hosting environment. */ #include #if OS_EMBEDDED - typedef uint32_t cpuflags_t; // FIXME + typedef uint32_t cpu_flags_t; // FIXME #endif /* OS_EMBEDDED */ - typedef uint32_t cpuatomic_t; + typedef uint32_t cpu_atomic_t; #if CPU_X86_64 - typedef uint64_t cpustack_t; + typedef uint64_t cpu_stack_t; #define SIZEOF_CPUSTACK_T 8 #else - typedef uint32_t cpustack_t; + typedef uint32_t cpu_stack_t; #define SIZEOF_CPUSTACK_T 4 #endif #elif CPU_ARM - typedef uint32_t cpuflags_t; - typedef uint32_t cpuatomic_t; - typedef uint32_t cpustack_t; + typedef uint32_t cpu_flags_t; + typedef uint32_t cpu_atomic_t; + typedef uint32_t cpu_stack_t; #define SIZEOF_CPUSTACK_T 4 #elif CPU_PPC - /* Get cpuflags_t definition from the hosting environment. */ + /* Get cpu_flags_t definition from the hosting environment. */ #include #if OS_EMBEDDED - typedef uint32_t cpuflags_t; + typedef uint32_t cpu_flags_t; #endif - typedef uint32_t cpuatomic_t; - typedef uint32_t cpustack_t; + typedef uint32_t cpu_atomic_t; + typedef uint32_t cpu_stack_t; #define SIZEOF_CPUSTACK_T 4 #elif CPU_DSP56K - typedef uint16_t cpuflags_t; - typedef uint16_t cpuatomic_t; - typedef unsigned int cpustack_t; + typedef uint16_t cpu_flags_t; + typedef uint16_t cpu_atomic_t; + typedef unsigned int cpu_stack_t; #warning Verify following costant #define SIZEOF_CPUSTACK_T 2 #elif CPU_AVR - typedef uint8_t cpuflags_t; - typedef uint8_t cpuatomic_t; - typedef uint8_t cpustack_t; + typedef uint8_t cpu_flags_t; + typedef uint8_t cpu_atomic_t; + typedef uint8_t cpu_stack_t; #define SIZEOF_CPUSTACK_T 1 #else @@ -199,7 +199,7 @@ STATIC_ASSERT(sizeof(uint32_t) * CPU_BITS_PER_CHAR == 32); STATIC_ASSERT(sizeof(int64_t) * CPU_BITS_PER_CHAR == 64); STATIC_ASSERT(sizeof(uint64_t) * CPU_BITS_PER_CHAR == 64); #endif -STATIC_ASSERT(sizeof(cpustack_t) == SIZEOF_CPUSTACK_T); +STATIC_ASSERT(sizeof(cpu_stack_t) == SIZEOF_CPUSTACK_T); #endif /* CPU_TYPES_H */ diff --git a/bertos/drv/buzzer.c b/bertos/drv/buzzer.c index 8cac8123..6d74fcc4 100644 --- a/bertos/drv/buzzer.c +++ b/bertos/drv/buzzer.c @@ -92,7 +92,7 @@ static void buz_softint(void) */ void buz_beep(mtime_t time) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Remove the software interrupt if it was already queued */ @@ -127,7 +127,7 @@ void buz_repeat_start(mtime_t duration, mtime_t interval) */ void buz_repeat_stop(void) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Remove the software interrupt if it was already queued */ diff --git a/bertos/drv/dc_motor.c b/bertos/drv/dc_motor.c index 13efee97..98cb7380 100644 --- a/bertos/drv/dc_motor.c +++ b/bertos/drv/dc_motor.c @@ -65,7 +65,7 @@ static DCMotor dcm_all[CONFIG_NUM_DC_MOTOR]; /// Stack process for DC motor poll. -static cpustack_t dc_motor_poll_stack[200]; +static cpu_stack_t dc_motor_poll_stack[200]; ///< Sample period for all DC motor. static mtime_t sample_period; diff --git a/bertos/drv/kbd.c b/bertos/drv/kbd.c index fa03d841..5028d316 100644 --- a/bertos/drv/kbd.c +++ b/bertos/drv/kbd.c @@ -236,7 +236,7 @@ void kbd_addHandler(struct KbdHandler *handler) KbdHandler *node; List *list; - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* Choose between raw and coocked handlers list */ diff --git a/bertos/drv/phase.c b/bertos/drv/phase.c index 27ae92fe..d6c0c73e 100644 --- a/bertos/drv/phase.c +++ b/bertos/drv/phase.c @@ -103,7 +103,7 @@ DEFINE_ZEROCROSS_ISR() */ void phase_setDuty(TriacDev dev, triac_duty_t duty) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); phase_setDutyUnlock(dev,duty); @@ -173,7 +173,7 @@ static void phase_softint(void *_dev) */ void phase_init(void) { - cpuflags_t flags; + cpu_flags_t flags; TriacDev dev; /* Init timers and ensure that all triac are off */ diff --git a/bertos/drv/pwm.c b/bertos/drv/pwm.c index 021d2437..11c4e04b 100644 --- a/bertos/drv/pwm.c +++ b/bertos/drv/pwm.c @@ -91,7 +91,7 @@ void pwm_enable(PwmDev dev, bool state) */ void pwm_init(void) { - cpuflags_t flags; + cpu_flags_t flags; PwmDev dev; IRQ_SAVE_DISABLE(flags); diff --git a/bertos/drv/timer.c b/bertos/drv/timer.c index 285d67c5..bd0ff9da 100644 --- a/bertos/drv/timer.c +++ b/bertos/drv/timer.c @@ -120,7 +120,7 @@ REGISTER static List timers_queue; void timer_add(Timer *timer) { Timer *node; - cpuflags_t flags; + cpu_flags_t flags; /* Inserting timers twice causes mayhem. */ diff --git a/bertos/hw/hw_lcd.h b/bertos/hw/hw_lcd.h index 65b50873..3a206a0f 100644 --- a/bertos/hw/hw_lcd.h +++ b/bertos/hw/hw_lcd.h @@ -134,7 +134,7 @@ INLINE void lcd_bus_init(void) { - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); /* diff --git a/bertos/kern/coop.c b/bertos/kern/coop.c index 16cb5811..aa370ae5 100644 --- a/bertos/kern/coop.c +++ b/bertos/kern/coop.c @@ -56,7 +56,7 @@ * Saving and restoring the context on the stack is done by a CPU-dependent * support routine which usually needs to be written in assembly. */ -EXTERN_C void asm_switch_context(cpustack_t **new_sp, cpustack_t **save_sp); +EXTERN_C void asm_switch_context(cpu_stack_t **new_sp, cpu_stack_t **save_sp); /** @@ -65,7 +65,7 @@ EXTERN_C void asm_switch_context(cpustack_t **new_sp, cpustack_t **save_sp); */ static void proc_schedule(void) { - cpuflags_t flags; + cpu_flags_t flags; ATOMIC(LIST_ASSERT_VALID(&ProcReadyList)); ASSERT_USER_CONTEXT(); @@ -111,7 +111,7 @@ void proc_switch(void) */ if (CurrentProcess != old_process) { - cpustack_t *dummy; + cpu_stack_t *dummy; #if CONFIG_KERN_MONITOR LOG_INFO("Switch from %p(%s) to %p(%s)\n", diff --git a/bertos/kern/idle.c b/bertos/kern/idle.c index 229058bd..3aa4bb04 100644 --- a/bertos/kern/idle.c +++ b/bertos/kern/idle.c @@ -41,7 +41,7 @@ #include -static cpustack_t idle_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpustack_t)]; +static cpu_stack_t idle_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpu_stack_t)]; /** * The idle process diff --git a/bertos/kern/monitor.c b/bertos/kern/monitor.c index c055e2ce..5759c533 100644 --- a/bertos/kern/monitor.c +++ b/bertos/kern/monitor.c @@ -78,17 +78,17 @@ void monitor_rename(Process *proc, const char *name) proc->monitor.name = name; } -size_t monitor_checkStack(cpustack_t *stack_base, size_t stack_size) +size_t monitor_checkStack(cpu_stack_t *stack_base, size_t stack_size) { - cpustack_t *beg; - cpustack_t *cur; - cpustack_t *end; + cpu_stack_t *beg; + cpu_stack_t *cur; + cpu_stack_t *end; int inc; size_t sp_free; beg = stack_base; - end = stack_base + stack_size / sizeof(cpustack_t); + end = stack_base + stack_size / sizeof(cpu_stack_t); inc = +1; if (CPU_STACK_GROWS_UPWARD) @@ -106,7 +106,7 @@ size_t monitor_checkStack(cpustack_t *stack_base, size_t stack_size) cur += inc; } - sp_free = ABS(cur - beg) * sizeof(cpustack_t); + sp_free = ABS(cur - beg) * sizeof(cpu_stack_t); return sp_free; } @@ -157,7 +157,7 @@ static void NORETURN monitor(void) } -void monitor_start(size_t stacksize, cpustack_t *stack) +void monitor_start(size_t stacksize, cpu_stack_t *stack) { proc_new(monitor, NULL, stacksize, stack); } diff --git a/bertos/kern/monitor.h b/bertos/kern/monitor.h index 0c705a4a..fd458669 100644 --- a/bertos/kern/monitor.h +++ b/bertos/kern/monitor.h @@ -56,7 +56,7 @@ * \note The stack is provided by the caller so that there is no wasted space if the monitor * is not used. */ -void monitor_start(size_t stacksize, cpustack_t *stack); +void monitor_start(size_t stacksize, cpu_stack_t *stack); /** @@ -67,7 +67,7 @@ void monitor_start(size_t stacksize, cpustack_t *stack); * \note For this function to work, the stack must have been filled at startup with * CONFIG_KERN_STACKFILLCODE. */ -size_t monitor_checkStack(cpustack_t *stack_base, size_t stack_size); +size_t monitor_checkStack(cpu_stack_t *stack_base, size_t stack_size); /** Print a report of the stack status through kdebug */ diff --git a/bertos/kern/preempt.c b/bertos/kern/preempt.c index 69b555a9..4b1ad9ee 100644 --- a/bertos/kern/preempt.c +++ b/bertos/kern/preempt.c @@ -66,7 +66,7 @@ CONFIG_DEPEND(CONFIG_KERN_PREEMPT, CONFIG_KERN_SCHED && CONFIG_TIMER_EVENTS & MOD_DEFINE(preempt) /// Global preemption disabling nesting counter -cpuatomic_t _preempt_forbid_cnt; +cpu_atomic_t _preempt_forbid_cnt; static Timer preempt_timer; diff --git a/bertos/kern/proc.c b/bertos/kern/proc.c index b8431b50..2cb6e2a0 100644 --- a/bertos/kern/proc.c +++ b/bertos/kern/proc.c @@ -89,7 +89,7 @@ REGISTER Process *CurrentProcess; List StackFreeList; #define NPROC 8 -cpustack_t proc_stacks[NPROC][(64 * 1024) / sizeof(cpustack_t)]; +cpu_stack_t proc_stacks[NPROC][(64 * 1024) / sizeof(cpu_stack_t)]; #endif /** The main process (the one that executes main()). */ @@ -152,10 +152,10 @@ void proc_init(void) * \return Process structure of new created process * if successful, NULL otherwise. */ -struct Process *proc_new_with_name(UNUSED_ARG(const char *, name), void (*entry)(void), iptr_t data, size_t stack_size, cpustack_t *stack_base) +struct Process *proc_new_with_name(UNUSED_ARG(const char *, name), void (*entry)(void), iptr_t data, size_t stack_size, cpu_stack_t *stack_base) { Process *proc; - const size_t PROC_SIZE_WORDS = ROUND_UP2(sizeof(Process), sizeof(cpustack_t)) / sizeof(cpustack_t); + const size_t PROC_SIZE_WORDS = ROUND_UP2(sizeof(Process), sizeof(cpu_stack_t)) / sizeof(cpu_stack_t); #if CONFIG_KERN_HEAP bool free_stack = false; #endif @@ -163,7 +163,7 @@ struct Process *proc_new_with_name(UNUSED_ARG(const char *, name), void (*entry) #if (ARCH & ARCH_EMUL) /* Ignore stack provided by caller and use the large enough default instead. */ - PROC_ATOMIC(stack_base = (cpustack_t *)list_remHead(&StackFreeList)); + PROC_ATOMIC(stack_base = (cpu_stack_t *)list_remHead(&StackFreeList)); stack_size = CONFIG_KERN_MINSTACKSIZE; #elif CONFIG_KERN_HEAP @@ -209,8 +209,8 @@ struct Process *proc_new_with_name(UNUSED_ARG(const char *, name), void (*entry) } else { - proc = (Process *)(stack_base + stack_size / sizeof(cpustack_t) - PROC_SIZE_WORDS); - proc->stack = (cpustack_t *)proc; + proc = (Process *)(stack_base + stack_size / sizeof(cpu_stack_t) - PROC_SIZE_WORDS); + proc->stack = (cpu_stack_t *)proc; if (CPU_SP_ON_EMPTY_SLOT) proc->stack--; } diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index 4efdf9df..e9a910d4 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -45,7 +45,7 @@ #include // ASSERT() #endif -#include // cpustack_t +#include // cpu_stack_t #include // CPU_SAVED_REGS_CNT /* @@ -56,7 +56,7 @@ struct Process; /* Task scheduling services */ void proc_init(void); -struct Process *proc_new_with_name(const char* name, void (*entry)(void), iptr_t data, size_t stacksize, cpustack_t *stack); +struct Process *proc_new_with_name(const char* name, void (*entry)(void), iptr_t data, size_t stacksize, cpu_stack_t *stack); #if !CONFIG_KERN_MONITOR #define proc_new(entry,data,size,stack) proc_new_with_name(NULL,(entry),(data),(size),(stack)) @@ -108,7 +108,7 @@ const char *proc_currentName(void); INLINE void proc_forbid(void) { #if CONFIG_KERN_PREEMPT - extern cpuatomic_t _preempt_forbid_cnt; + extern cpu_atomic_t _preempt_forbid_cnt; /* * We don't need to protect the counter against other processes. * The reason why is a bit subtle. @@ -156,7 +156,7 @@ INLINE void proc_permit(void) * flushed to memory before task switching is re-enabled. */ MEMORY_BARRIER; - extern cpuatomic_t _preempt_forbid_cnt; + extern cpu_atomic_t _preempt_forbid_cnt; /* No need to protect against interrupts here. */ ASSERT(_preempt_forbid_cnt != 0); --_preempt_forbid_cnt; @@ -178,7 +178,7 @@ INLINE void proc_permit(void) INLINE bool proc_allowed(void) { #if CONFIG_KERN_PREEMPT - extern cpuatomic_t _preempt_forbid_cnt; + extern cpu_atomic_t _preempt_forbid_cnt; return (_preempt_forbid_cnt == 0); #else return true; @@ -221,7 +221,7 @@ INLINE bool proc_allowed(void) * usage. */ #define CONFIG_KERN_MINSTACKSIZE \ - (CPU_SAVED_REGS_CNT * 2 * sizeof(cpustack_t) \ + (CPU_SAVED_REGS_CNT * 2 * sizeof(cpu_stack_t) \ + 32 * sizeof(int)) #endif #endif @@ -230,23 +230,23 @@ INLINE bool proc_allowed(void) #if CONFIG_KERN_MONITOR #include #if (SIZEOF_CPUSTACK_T == 1) - /* 8bit cpustack_t */ + /* 8bit cpu_stack_t */ #define CONFIG_KERN_STACKFILLCODE 0xA5 #define CONFIG_KERN_MEMFILLCODE 0xDB #elif (SIZEOF_CPUSTACK_T == 2) - /* 16bit cpustack_t */ + /* 16bit cpu_stack_t */ #define CONFIG_KERN_STACKFILLCODE 0xA5A5 #define CONFIG_KERN_MEMFILLCODE 0xDBDB #elif (SIZEOF_CPUSTACK_T == 4) - /* 32bit cpustack_t */ + /* 32bit cpu_stack_t */ #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5UL #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBUL #elif (SIZEOF_CPUSTACK_T == 8) - /* 64bit cpustack_t */ + /* 64bit cpu_stack_t */ #define CONFIG_KERN_STACKFILLCODE 0xA5A5A5A5A5A5A5A5ULL #define CONFIG_KERN_MEMFILLCODE 0xDBDBDBDBDBDBDBDBULL #else - #error No cpustack_t size supported! + #error No cpu_stack_t size supported! #endif #endif diff --git a/bertos/kern/proc_p.h b/bertos/kern/proc_p.h index a0e87be2..9d61b531 100644 --- a/bertos/kern/proc_p.h +++ b/bertos/kern/proc_p.h @@ -58,7 +58,7 @@ typedef struct Process #else Node link; /**< Link Process into scheduler lists */ #endif - cpustack_t *stack; /**< Per-process SP */ + cpu_stack_t *stack; /**< Per-process SP */ iptr_t user_data; /**< Custom data passed to the process */ #if CONFIG_KERN_SIGNALS @@ -71,7 +71,7 @@ typedef struct Process #endif #if CONFIG_KERN_HEAP | CONFIG_KERN_MONITOR | (ARCH & ARCH_EMUL) - cpustack_t *stack_base; /**< Base of process stack */ + cpu_stack_t *stack_base; /**< Base of process stack */ size_t stack_size; /**< Size of process stack */ #endif diff --git a/bertos/kern/proc_test.c b/bertos/kern/proc_test.c index 52a7fe85..ea071a47 100644 --- a/bertos/kern/proc_test.c +++ b/bertos/kern/proc_test.c @@ -66,8 +66,8 @@ static void proc_test2(void) } } -static cpustack_t proc_test1_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpustack_t)]; -static cpustack_t proc_test2_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpustack_t)]; +static cpu_stack_t proc_test1_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpu_stack_t)]; +static cpu_stack_t proc_test2_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpu_stack_t)]; /** diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index 9785958d..58863ffa 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -117,7 +117,7 @@ sigmask_t sig_check(sigmask_t sigs) { sigmask_t result; - cpuflags_t flags; + cpu_flags_t flags; IRQ_SAVE_DISABLE(flags); result = CurrentProcess->sig_recv & sigs; @@ -135,7 +135,7 @@ sigmask_t sig_check(sigmask_t sigs) sigmask_t sig_wait(sigmask_t sigs) { sigmask_t result; - cpuflags_t flags; + cpu_flags_t flags; /* Sleeping with IRQs disabled or preemption forbidden is illegal */ IRQ_ASSERT_ENABLED(); @@ -202,7 +202,7 @@ sigmask_t sig_waitTimeout(sigmask_t sigs, ticks_t timeout) { Timer t; sigmask_t res; - cpuflags_t flags; + cpu_flags_t flags; ASSERT(!sig_check(SIG_TIMEOUT)); ASSERT(!(sigs & SIG_TIMEOUT)); @@ -233,7 +233,7 @@ sigmask_t sig_waitTimeout(sigmask_t sigs, ticks_t timeout) */ void sig_signal(Process *proc, sigmask_t sigs) { - cpuflags_t flags; + cpu_flags_t flags; /* See comment in sig_wait() for why this protection is necessary */ IRQ_SAVE_DISABLE(flags); diff --git a/bertos/mware/observer.c b/bertos/mware/observer.c index c5566086..2a9358a5 100644 --- a/bertos/mware/observer.c +++ b/bertos/mware/observer.c @@ -63,7 +63,7 @@ void observer_Unsubscribe(UNUSED_ARG(Subject *,subject), Observer *observer) void observer_notify(Subject *subject, int event_id, void *param) { Observer *observer; - cpuflags_t irqstate; + cpu_flags_t irqstate; IRQ_SAVE_DISABLE(irqstate); /* -- 2.25.1