Skip to content

Commit

Permalink
interrupt handling rewrite
Browse files Browse the repository at this point in the history
(including uart0 integration, rt-extension removal)
  • Loading branch information
LudwigKnuepfer committed May 14, 2013
1 parent 2d29a26 commit c6553f6
Show file tree
Hide file tree
Showing 9 changed files with 231 additions and 129 deletions.
12 changes: 9 additions & 3 deletions Makefile.base
@@ -1,14 +1,17 @@
ASMSRC = $(wildcard *.s)
ASSMSRC = $(wildcard *.S)
ASMOBJ = $(ASMSRC:%.s=$(BINDIR)%.o)
ASMOBJ += $(ASSMSRC:%.S=$(BINDIR)%.o)

SRC = $(wildcard *.c)
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)

include $(RIOTCPU)/Makefile.base
include $(RIOTBOARD)/Makefile.base

$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ)
$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ)
$(BINDIR)$(MODULE).a: $(OBJ) $(ASMOBJ) $(ASSMOBJ)
$(AR) -rc $(BINDIR)$(MODULE).a $(OBJ) $(ASMOBJ) $(ASSMOBJ)

# pull in dependency info for *existing* .o files
-include $(OBJ:.o=.d)
Expand All @@ -22,7 +25,10 @@ $(BINDIR)%.o: %.c
$(BINDIR)%.o: %.s
@$(AS) $(ASFLAGS) $*.s -o $(BINDIR)$*.o

$(BINDIR)%.o: %.S
@gcc -c -m32 $*.S -o $(BINDIR)$*.o

# remove compilation products
clean::
rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ)
rm -f $(BINDIR)$(MODULE).a $(OBJ) $(DEP) $(ASMOBJ) $(ASSMOBJ)

2 changes: 2 additions & 0 deletions core/include/thread.h
Expand Up @@ -17,7 +17,9 @@
#include <tcb.h>

/** Minimum stack size */
#ifndef MINIMUM_STACK_SIZE
#define MINIMUM_STACK_SIZE (sizeof(tcb_t))
#endif

/**
* @brief Creates a new thread.
Expand Down
6 changes: 6 additions & 0 deletions cpu/native/hwtimer_cpu.c
Expand Up @@ -34,6 +34,8 @@

#include "debug.h"

#define HWTIMERMINOFFSET 1000

static unsigned long native_hwtimer_now;

static int native_hwtimer_irq[ARCH_MAXTIMERS];
Expand Down Expand Up @@ -172,6 +174,10 @@ void hwtimer_arch_unset(short timer)
void hwtimer_arch_set(unsigned long offset, short timer)
{
DEBUG("hwtimer_arch_set(%li, %i)\n", offset, timer);
if (offset < HWTIMERMINOFFSET) {
offset = HWTIMERMINOFFSET;
DEBUG("hwtimer_arch_set: offset < MIN, set to: %i\n", offset);
}
native_hwtimer_irq[timer] = 1;
native_hwtimer_isset[timer] = 1;

Expand Down
3 changes: 2 additions & 1 deletion cpu/native/include/cpu-conf.h
Expand Up @@ -18,9 +18,10 @@

/* TODO: choose more sensibly? */
#define KERNEL_CONF_STACKSIZE_DEFAULT (16384)
#define KERNEL_CONF_STACKSIZE_IDLE (4096)
#define KERNEL_CONF_STACKSIZE_IDLE (16384)
#define NATIVE_ISR_STACKSIZE (16384)
#define TRANSCEIVER_STACK_SIZE (16384)
#define MINIMUM_STACK_SIZE (1024)

/* for cc110x_ng */
#define RX_BUF_SIZE (10)
Expand Down
7 changes: 6 additions & 1 deletion cpu/native/include/cpu.h
Expand Up @@ -46,6 +46,11 @@ int unregister_interrupt(int sig);
/* this should be defined elsewhere */
void thread_yield(void);

extern volatile ucontext_t *interrupted_contexts[MAXTHREADS];
extern void _native_sig_leave_tramp(void);
extern ucontext_t *_native_cur_ctx, *_native_isr_ctx;
extern unsigned int _native_saved_eip;
extern int _native_in_isr;
extern int _native_in_syscall;
extern int _native_sigpend;
/** @} */
#endif //_CPU_H

0 comments on commit c6553f6

Please sign in to comment.