|
[ source navigation ] [ diff markup ] [ identifier search ] [ general search ] |
|||
|
001 /* Copyright (C) 2005 David Decotigny 001 /* Copyright (C) 2005 David Decotigny 002 002 003 This program is free software; you can redi 003 This program is free software; you can redistribute it and/or 004 modify it under the terms of the GNU Genera 004 modify it under the terms of the GNU General Public License 005 as published by the Free Software Foundatio 005 as published by the Free Software Foundation; either version 2 006 of the License, or (at your option) any lat 006 of the License, or (at your option) any later version. 007 007 008 This program is distributed in the hope tha 008 This program is distributed in the hope that it will be useful, 009 but WITHOUT ANY WARRANTY; without even the 009 but WITHOUT ANY WARRANTY; without even the implied warranty of 010 MERCHANTABILITY or FITNESS FOR A PARTICULAR 010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 011 GNU General Public License for more details 011 GNU General Public License for more details. 012 012 013 You should have received a copy of the GNU 013 You should have received a copy of the GNU General Public License 014 along with this program; if not, write to t 014 along with this program; if not, write to the Free Software 015 Foundation, Inc., 59 Temple Place - Suite 3 015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 016 USA. 016 USA. 017 */ 017 */ 018 #include <sos/uaccess.h> 018 #include <sos/uaccess.h> 019 019 020 #include "idt.h" 020 #include "idt.h" 021 #include "irq.h" 021 #include "irq.h" 022 022 023 #include "swintr.h" 023 #include "swintr.h" 024 024 025 /** 025 /** 026 * The Assembler low-level wrapper for the SOS 026 * The Assembler low-level wrapper for the SOS syscalls 027 * 027 * 028 * This wrapper takes care of saving the state 028 * This wrapper takes care of saving the state of the calling user 029 * thread before calling the "C" function sos_ 029 * thread before calling the "C" function sos_do_syscall(), passing it 030 * the correct arguments. 030 * the correct arguments. 031 */ 031 */ 032 extern void sos_syscall_wrapper(); 032 extern void sos_syscall_wrapper(); 033 033 034 034 035 sos_ret_t sos_swintr_subsystem_setup(void) 035 sos_ret_t sos_swintr_subsystem_setup(void) 036 { 036 { 037 sos_ui32_t flags; 037 sos_ui32_t flags; 038 sos_ret_t retval; 038 sos_ret_t retval; 039 039 040 sos_disable_IRQs(flags); 040 sos_disable_IRQs(flags); 041 041 042 retval 042 retval 043 = sos_idt_set_handler(SOS_SWINTR_SOS_SYSCA 043 = sos_idt_set_handler(SOS_SWINTR_SOS_SYSCALL, 044 (sos_vaddr_t) sos_sy 044 (sos_vaddr_t) sos_syscall_wrapper, 045 3 /* CPL3 routine */ 045 3 /* CPL3 routine */); 046 046 047 sos_restore_IRQs(flags); 047 sos_restore_IRQs(flags); 048 048 049 return retval; 049 return retval; 050 } 050 }
[ source navigation ] | [ diff markup ] | [ identifier search ] | [ general search ] |