Subversion Repositories HelenOS

Compare Revisions

Problem with comparison.

Ignore whitespace Rev HEAD → Rev 74

/SPARTAN/trunk/arch/ia64/src/start.S
0,0 → 1,86
#
# Copyright (C) 2005 Jakub Jermar
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
#include <arch/ski/ski.h>
 
.section K_TEXT_START
.global k_text_start
k_text_start:
 
.global kernel_image_start
 
stack0:
kernel_image_start:
# initialize register stack
alloc r1 = ar.pfs, 0, 0, 0, 0 ;;
 
# initialize memory stack to some sane value
movl r12=stack0
 
# initialize gp (Global Pointer) register
movl r1=k_text_start
 
#
# Initialize hardcoded_* variables.
# (IA-64 port doesn't get these values from linker.)
#
movl r8 = k_text_start ;;
movl r9 = k_text_end ;;
sub r8 = r9, r8 ;;
addl r10 = @gprel(hardcoded_ktext_size), gp;;
st4 [r10] = r8 ;;
 
movl r8 = k_data_start ;;
movl r9 = k_data_end ;;
sub r8 = r9, r8 ;;
addl r10 = @gprel(hardcoded_kdata_size), gp;;
st4 [r10] = r8 ;;
addl r10 = @gprel(hardcoded_load_address), gp;;
st8 [r10] = r1
# initialize Ski console using SSC (Simulator System Call)
mov r15=SKI_CONSOLE_INIT
break 0x80000
 
br.call.sptk.many b0=main_bsp
 
0:
br 0b
 
.section K_TEXT_END
.global k_text_end
k_text_end:
 
.section K_DATA_START
.global k_data_start
k_data_start:
 
.section K_DATA_END
.global k_data_end
k_data_end:
/SPARTAN/trunk/arch/ia64/src/fake.s
0,0 → 1,73
#
# Copyright (C) 2005 Jakub Jermar
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
.text
 
.global calibrate_delay_loop
.global asm_delay_loop
.global userspace
.global before_thread_runs_arch
.global arch_late_init
.global arch_post_mm_init
.global arch_pre_mm_init
.global cpu_arch_init
.global cpu_halt
.global cpu_identify
.global cpu_print_report
.global cpu_priority_high
.global cpu_priority_low
.global cpu_priority_read
.global cpu_priority_restore
.global cpu_sleep
.global frame_arch_init
.global map_page_to_frame
.global memsetb
.global panic_printf
 
before_thread_runs_arch:
userspace:
calibrate_delay_loop:
asm_delay_loop:
arch_late_init:
arch_post_mm_init:
arch_pre_mm_init:
cpu_arch_init:
cpu_halt:
cpu_identify:
cpu_print_report:
cpu_priority_high:
cpu_priority_low:
cpu_priority_read:
cpu_priority_restore:
cpu_sleep:
frame_arch_init:
map_page_to_frame:
memsetb:
panic_printf:
br.ret.sptk.many b0
 
/SPARTAN/trunk/arch/ia64/src/putchar.c
0,0 → 1,45
/*
* Copyright (C) 2005 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#include <putchar.h>
#include <arch/types.h>
#include <arch/ski/ski.h>
 
void putchar(const char ch)
{
__asm__ (
"mov r15=%0\n"
"mov r32=%1\n" /* r32 is in0 */
"break 0x80000\n" /* modifies r8 */
:
: "i" (SKI_CONSOLE_PUTC), "r" (ch)
: "r15", "in0", "r8"
);
if (ch == '\n') putchar('\r');
}
/SPARTAN/trunk/arch/ia64/src/asm.S
0,0 → 1,40
#
# Copyright (C) 2005 Jakub Jermar
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
.text
 
.global memcpy
memcpy:
/*
* Switch the role of first two arguments
*/
sub r33 = r33, r32 ;;
add r32 = r32, r33 ;;
sub r33 = r32, r33
br _memcopy
/SPARTAN/trunk/arch/ia64/src/context.S
0,0 → 1,128
#
# Copyright (C) 2005 Jakub Jermar
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
.text
 
.global context_save
.global context_restore
 
context_save:
alloc loc0 = ar.pfs, 1, 2, 0, 0
/*
* TODO: save the rest of the context registers.
*/
 
st8 [in0] = r1, 8 ;;
st8 [in0] = r2, 8 ;;
st8 [in0] = r3, 8 ;;
st8 [in0] = r4, 8 ;;
st8 [in0] = r5, 8 ;;
st8 [in0] = r6, 8 ;;
st8 [in0] = r7, 8 ;;
st8 [in0] = r8, 8 ;;
st8 [in0] = r9, 8 ;;
st8 [in0] = r10, 8 ;;
st8 [in0] = r11, 8 ;;
st8 [in0] = r12, 8 ;; /* save sp */
st8 [in0] = r13, 8 ;;
st8 [in0] = r14, 8 ;;
st8 [in0] = r15, 8 ;;
st8 [in0] = r16, 8 ;;
st8 [in0] = r17, 8 ;;
st8 [in0] = r18, 8 ;;
st8 [in0] = r19, 8 ;;
st8 [in0] = r20, 8 ;;
st8 [in0] = r21, 8 ;;
st8 [in0] = r22, 8 ;;
st8 [in0] = r23, 8 ;;
st8 [in0] = r24, 8 ;;
st8 [in0] = r25, 8 ;;
st8 [in0] = r26, 8 ;;
st8 [in0] = r27, 8 ;;
st8 [in0] = r28, 8 ;;
st8 [in0] = r29, 8 ;;
st8 [in0] = r30, 8 ;;
st8 [in0] = r31, 8 ;;
 
/* save pc */
mov loc1 = b0 ;;
st8 [in0] = loc1, 8
mov ar.pfs = loc0
add r8 = r0, r0, 1 /* context_save returns 1 */
br.ret.sptk.many b0
 
context_restore:
alloc loc0 = ar.pfs, 1, 2, 0, 0
 
/*
* TODO: restore the rest of the context registers.
*/
ld8 r1 = [in0], 8 ;;
ld8 r2 = [in0], 8 ;;
ld8 r3 = [in0], 8 ;;
ld8 r4 = [in0], 8 ;;
ld8 r5 = [in0], 8 ;;
ld8 r6 = [in0], 8 ;;
ld8 r7 = [in0], 8 ;;
ld8 r8 = [in0], 8 ;;
ld8 r9 = [in0], 8 ;;
ld8 r10 = [in0], 8 ;;
ld8 r11 = [in0], 8 ;;
ld8 r12 = [in0], 8 ;; /* restore sp */
ld8 r13 = [in0], 8 ;;
ld8 r14 = [in0], 8 ;;
ld8 r15 = [in0], 8 ;;
ld8 r16 = [in0], 8 ;;
ld8 r17 = [in0], 8 ;;
ld8 r18 = [in0], 8 ;;
ld8 r19 = [in0], 8 ;;
ld8 r20 = [in0], 8 ;;
ld8 r21 = [in0], 8 ;;
ld8 r22 = [in0], 8 ;;
ld8 r23 = [in0], 8 ;;
ld8 r24 = [in0], 8 ;;
ld8 r25 = [in0], 8 ;;
ld8 r26 = [in0], 8 ;;
ld8 r27 = [in0], 8 ;;
ld8 r28 = [in0], 8 ;;
ld8 r29 = [in0], 8 ;;
ld8 r30 = [in0], 8 ;;
ld8 r31 = [in0], 8 ;;
 
/* restore pc */
ld8 loc1 = [in0], 8 ;;
mov b0 = loc1
mov ar.pfs = loc0
mov r8 = r0 /* context_restore returns 0 */
br.ret.sptk.many b0
/SPARTAN/trunk/arch/ia64/src/fpu_context.c
0,0 → 1,49
/*
#
# Copyright (C) 2005 Jakub Vana
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
*/
 
#include <fpu_context.h>
 
void fpu_context_save(fpu_context_t *fctx)
{
}
 
 
void fpu_context_restore(fpu_context_t *fctx)
{
}
 
 
void fpu_lazy_context_save(fpu_context_t *fctx)
{
}
 
void fpu_lazy_context_restore(fpu_context_t *fctx)
{
}
/SPARTAN/trunk/arch/ia64/src/ia64.c
0,0 → 1,28
/*
* Copyright (C) 2005 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/