X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=kern%2Fswitch_avr.S;h=84fa14d3287af07337649412ce29d9a2e8bd3233;hb=753d17c6975a0edd44fd771f1af01d95a61d292a;hp=08dfbe8d5384b6395a5a0fe081ceb0bcd4753c68;hpb=6549ec6177532bab4b61549cb74ff07651a358e7;p=bertos.git diff --git a/kern/switch_avr.S b/kern/switch_avr.S old mode 100755 new mode 100644 index 08dfbe8d..84fa14d3 --- a/kern/switch_avr.S +++ b/kern/switch_avr.S @@ -16,10 +16,18 @@ #include +/* + * NOTE: At each change of this function affecting proc.c + * (i.e. arguments, data stored in the stack) bump up version + * number in asm_switch_version(). + */ + /* void asm_switch_context(void **new_sp, void **save_sp) */ .globl asm_switch_context asm_switch_context: + in r0,SREG-__SFR_OFFSET + push r0 ; push r0 caller-save ; push r1 caller-save push r2 @@ -98,5 +106,16 @@ asm_switch_context: pop r2 ; pop r1 caller-save ; pop r0 caller-save + pop r0 + out SREG-__SFR_OFFSET,r0 + + ret + +/* int asm_switch_version(void) */ +.globl asm_switch_version +asm_switch_version: + ldi r24,lo8(1) + ldi r25,hi8(1) ret +