OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [mips64/] [kernel/] [entry.S] - Blame information for rev 1275

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * This file is subject to the terms and conditions of the GNU General Public
3
 * License.  See the file "COPYING" in the main directory of this archive
4
 * for more details.
5
 *
6
 * Low level exception handling
7
 *
8
 * Copyright (C) 1994 - 2000, 2001 Ralf Baechle
9
 * Copyright (C) 1999, 2000 Silicon Graphics
10
 * Copyright (C) 2001 MIPS Technologies, Inc.
11
 */
12
#include 
13
#include 
14
#include 
15
#include 
16
#include 
17
 
18
#define KU_USER 0x10
19
 
20
                .text
21
                .align  5
22
FEXPORT(ret_from_fork)
23
                move    a0, v0                  # prev
24
                jal     schedule_tail
25
                ld      t0, TASK_PTRACE($28)    # syscall tracing enabled?
26
                andi    t0, _PT_TRACESYS
27
                bnez    t0, tracesys_exit
28
                j       ret_from_sys_call
29
 
30
tracesys_exit:
31
                jal     syscall_trace
32
                b       ret_from_sys_call
33
 
34
EXPORT(ret_from_irq)
35
EXPORT(ret_from_exception)
36
                ld      t0, PT_STATUS(sp)       # returning to kernel mode?
37
                andi    t0, t0, KU_USER
38
                bnez    t0, ret_from_sys_call
39
                j       restore_all
40
 
41
reschedule:     jal     schedule
42
 
43
FEXPORT(ret_from_sys_call)
44
                mfc0    t0, CP0_STATUS  # need_resched and signals atomic test
45
                ori     t0, t0, 1
46
                xori    t0, t0, 1
47
                mtc0    t0, CP0_STATUS
48
                SSNOP; SSNOP; SSNOP
49
 
50
                ld      v0, TASK_NEED_RESCHED($28)
51
                lw      v1, TASK_SIGPENDING($28)
52
                bnez    v0, reschedule
53
                bnez    v1, signal_return
54
 
55
restore_all:    .set    noat
56
                RESTORE_ALL
57
                eret
58
                .set    at
59
 
60
signal_return:  .type   signal_return, @function
61
 
62
                mfc0    t0, CP0_STATUS
63
                ori     t0, t0, 1
64
                mtc0    t0, CP0_STATUS
65
 
66
                move    a0, zero
67
                move    a1, sp
68
                jal     do_signal
69
                b       restore_all
70
 
71
/*
72
 * Common spurious interrupt handler.
73
 */
74
                .text
75
                .align  5
76
LEAF(spurious_interrupt)
77
                /*
78
                 * Someone tried to fool us by sending an interrupt but we
79
                 * couldn't find a cause for it.
80
                 */
81
                lui     t1, %hi(irq_err_count)
82
1:              ll      t0, %lo(irq_err_count)(t1)
83
                addiu   t0, 1
84
                sc      t0, %lo(irq_err_count)(t1)
85
                beqz    t0, 1b
86
                j       ret_from_irq
87
                END(spurious_interrupt)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.