Blame | Last modification | View Log | RSS feed
@@@ Copyright 2010 TheSeven@@@ This file is part of emBIOS.@@ emBIOS is free software: you can redistribute it and/or@ modify it under the terms of the GNU General Public License as@ published by the Free Software Foundation, either version 2 of the@ License, or (at your option) any later version.@@ emBIOS is distributed in the hope that it will be useful,@ but WITHOUT ANY WARRANTY; without even the implied warranty of@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.@ See the GNU General Public License for more details.@@ You should have received a copy of the GNU General Public License@ along with emBIOS. If not, see <http://www.gnu.org/licenses/>.@@.section .icode.contextswitch, "ax", %progbits.align 2.global context_switch.type context_switch, %functioncontext_switch:ldr r0, =current_threadldr r0, [r0]stmia r0!, {r0-r14}str lr, [r0], #4mrs r1, cpsrstr r1, [r0]adr lr, resume_threadb scheduler_switch.size context_switch, .-context_switch.global irq_handler.type irq_handler, %functionirq_handler:str r12, [sp,#-4]ldr r12, =current_threadldr r12, [r12]stmia r12!, {r0-r11}ldr r0, [sp,#-4]mrs r5, cpsrmrs r4, spsrorr r6, r4, #0xc0msr cpsr_c, r6mov r1, spmov r2, lrmsr cpsr_c, r5sub r3, lr, #4stmia r12, {r0-r4}bl irqhandler@ fallthrough.global resume_thread.type resume_thread, %functionresume_thread:ldr r0, =current_threadldr r0, [r0]ldr r1, [r0,#0x40]orr r2, r1, #0xc0msr cpsr_c, r2ldr sp, [r0,#0x34]ldr lr, [r0,#0x38]msr cpsr_c, #0xd2msr spsr_all, r1ldr lr, [r0,#0x3c]ldmia r0, {r0-r12}movs pc, lr.size irq_handler, .-irq_handler.size resume_thread, .-resume_thread.global enter_critical_section.type enter_critical_section, %functionenter_critical_section:mrs r0, cpsrmsr cpsr_c, #0xd3mov pc, lr.size enter_critical_section, .-enter_critical_section.global leave_critical_section.type leave_critical_section, %functionleave_critical_section:msr cpsr_c, r0mov pc, lr.size leave_critical_section, .-leave_critical_section