From: Antti Kantee Date: Mon, 20 Apr 2015 20:33:45 +0000 (+0000) Subject: rename to avoid collision with cpu_sched.c X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=036d6bd82cba54fdae4a73f5f8ff8213aee81bd5;p=people%2Fliuw%2Frumprun.git rename to avoid collision with cpu_sched.c --- diff --git a/lib/librumprun_core/arch/i386/Makefile.inc b/lib/librumprun_core/arch/i386/Makefile.inc index d2ee7d0..7bc1713 100644 --- a/lib/librumprun_core/arch/i386/Makefile.inc +++ b/lib/librumprun_core/arch/i386/Makefile.inc @@ -1,4 +1,4 @@ MYDIR:= ${.PARSEDIR} .PATH: ${MYDIR} -SRCS+= cpu_sched.S +SRCS+= cpu_sched_switch.S diff --git a/lib/librumprun_core/arch/i386/cpu_sched.S b/lib/librumprun_core/arch/i386/cpu_sched.S deleted file mode 100644 index cc9ec7d..0000000 --- a/lib/librumprun_core/arch/i386/cpu_sched.S +++ /dev/null @@ -1,73 +0,0 @@ -/*- - **************************************************************************** - * (C) 2005 - Grzegorz Milos - Intel Research Cambridge - **************************************************************************** - * - * File: sched.c - * Author: Grzegorz Milos - * Changes: Robert Kaiser - * - * Date: Aug 2005 - * - * Environment: Xen Minimal OS - * Description: simple scheduler for Mini-Os - * - * The scheduler is non-preemptive (cooperative), and schedules according - * to Round Robin algorithm. - * - **************************************************************************** - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include - -ENTRY(bmk_cpu_sched_bouncer) - popl %eax - popl %ebx - pushl $0 - xorl %ebp,%ebp - pushl %eax - call *%ebx - call bmk_sched_exit -END(bmk_cpu_sched_bouncer) - -ENTRY(bmk__cpu_switch) - movl 4(%esp), %ecx /* prev */ - movl 8(%esp), %edx /* next */ - - /* reload tls for new thread */ - movl $0x18, %eax - movl %eax, %gs - - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - movl %esp, (%ecx) /* save ESP */ - movl (%edx), %esp /* restore ESP */ - movl $1f, 4(%ecx) /* save EIP */ - pushl 4(%edx) /* restore EIP */ - ret -1: - popl %edi - popl %esi - popl %ebx - popl %ebp - ret -END(bmk__cpu_switch) diff --git a/lib/librumprun_core/arch/i386/cpu_sched_switch.S b/lib/librumprun_core/arch/i386/cpu_sched_switch.S new file mode 100644 index 0000000..cc9ec7d --- /dev/null +++ b/lib/librumprun_core/arch/i386/cpu_sched_switch.S @@ -0,0 +1,73 @@ +/*- + **************************************************************************** + * (C) 2005 - Grzegorz Milos - Intel Research Cambridge + **************************************************************************** + * + * File: sched.c + * Author: Grzegorz Milos + * Changes: Robert Kaiser + * + * Date: Aug 2005 + * + * Environment: Xen Minimal OS + * Description: simple scheduler for Mini-Os + * + * The scheduler is non-preemptive (cooperative), and schedules according + * to Round Robin algorithm. + * + **************************************************************************** + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include + +ENTRY(bmk_cpu_sched_bouncer) + popl %eax + popl %ebx + pushl $0 + xorl %ebp,%ebp + pushl %eax + call *%ebx + call bmk_sched_exit +END(bmk_cpu_sched_bouncer) + +ENTRY(bmk__cpu_switch) + movl 4(%esp), %ecx /* prev */ + movl 8(%esp), %edx /* next */ + + /* reload tls for new thread */ + movl $0x18, %eax + movl %eax, %gs + + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl %esp, (%ecx) /* save ESP */ + movl (%edx), %esp /* restore ESP */ + movl $1f, 4(%ecx) /* save EIP */ + pushl 4(%edx) /* restore EIP */ + ret +1: + popl %edi + popl %esi + popl %ebx + popl %ebp + ret +END(bmk__cpu_switch)