Subversion Repositories HelenOS

Rev

Rev 3743 | Rev 3770 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3743 Rev 3748
1
/*
1
/*
2
 * Copyright (c) 2006 Jakub Jermar
2
 * Copyright (c) 2006 Jakub Jermar
3
 * Copyright (c) 2008 Pavel Rimsky
3
 * Copyright (c) 2008 Pavel Rimsky
4
 * All rights reserved.
4
 * All rights reserved.
5
 *
5
 *
6
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions
7
 * modification, are permitted provided that the following conditions
8
 * are met:
8
 * are met:
9
 *
9
 *
10
 * - Redistributions of source code must retain the above copyright
10
 * - Redistributions of source code must retain the above copyright
11
 *   notice, this list of conditions and the following disclaimer.
11
 *   notice, this list of conditions and the following disclaimer.
12
 * - Redistributions in binary form must reproduce the above copyright
12
 * - Redistributions in binary form must reproduce the above copyright
13
 *   notice, this list of conditions and the following disclaimer in the
13
 *   notice, this list of conditions and the following disclaimer in the
14
 *   documentation and/or other materials provided with the distribution.
14
 *   documentation and/or other materials provided with the distribution.
15
 * - The name of the author may not be used to endorse or promote products
15
 * - The name of the author may not be used to endorse or promote products
16
 *   derived from this software without specific prior written permission.
16
 *   derived from this software without specific prior written permission.
17
 *
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
28
 */
29
 
29
 
30
/** @addtogroup sparc64interrupt
30
/** @addtogroup sparc64interrupt
31
 * @{
31
 * @{
32
 */
32
 */
33
/**
33
/**
34
 * @file
34
 * @file
35
 * @brief This file contains fast MMU trap handlers.
35
 * @brief This file contains fast MMU trap handlers.
36
 */
36
 */
37
 
37
 
38
#ifndef KERN_sparc64_sun4v_MMU_TRAP_H_
38
#ifndef KERN_sparc64_sun4v_MMU_TRAP_H_
39
#define KERN_sparc64_sun4v_MMU_TRAP_H_
39
#define KERN_sparc64_sun4v_MMU_TRAP_H_
40
 
40
 
41
#include <arch/stack.h>
41
#include <arch/stack.h>
42
#include <arch/sun4v/regdef.h>
42
#include <arch/sun4v/regdef.h>
43
#include <arch/mm/tlb.h>
43
#include <arch/mm/tlb.h>
44
#include <arch/mm/sun4v/mmu.h>
44
#include <arch/mm/sun4v/mmu.h>
45
#include <arch/mm/sun4v/tte.h>
45
#include <arch/mm/sun4v/tte.h>
46
#include <arch/trap/regwin.h>
46
#include <arch/trap/regwin.h>
47
 
47
 
48
#ifdef CONFIG_TSB
48
#ifdef CONFIG_TSB
49
#include <arch/mm/tsb.h>
49
#include <arch/mm/tsb.h>
50
#endif
50
#endif
51
 
51
 
52
#define TT_FAST_INSTRUCTION_ACCESS_MMU_MISS 0x64
52
#define TT_FAST_INSTRUCTION_ACCESS_MMU_MISS 0x64
53
#define TT_FAST_DATA_ACCESS_MMU_MISS        0x68
53
#define TT_FAST_DATA_ACCESS_MMU_MISS        0x68
54
#define TT_FAST_DATA_ACCESS_PROTECTION      0x6c
54
#define TT_FAST_DATA_ACCESS_PROTECTION      0x6c
55
 
55
 
56
#define FAST_MMU_HANDLER_SIZE           128
56
#define FAST_MMU_HANDLER_SIZE           128
57
 
57
 
58
#ifdef __ASM__
58
#ifdef __ASM__
59
 
59
 
60
.macro FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER
60
.macro FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER
61
.endm
61
.endm
62
 
62
 
63
/*
63
/*
64
 * So far it is here only to process the trap which occurs when the kernel
64
 * So far it is here only to process the trap which occurs when the kernel
65
 * needs to access the bootinfo structure, which is placed in the bootloader
65
 * needs to access the bootinfo structure, which is placed in the bootloader
66
 * memory (i.e. before address 0x400000).
66
 * memory (i.e. before address 0x400000).
67
 */
67
 */
68
.macro FAST_DATA_ACCESS_MMU_MISS_HANDLER tl
68
.macro FAST_DATA_ACCESS_MMU_MISS_HANDLER tl
-
 
69
    save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
69
    set 0x8000, %o0
70
    set 0x8000, %o0
70
    set 0x0, %o1
71
    set 0x0, %o1
71
    setx 0x80000000804087c3, %g1, %o2
72
    setx 0x80000000804087c3, %g1, %o2
72
    set 0x3, %o3
73
    set 0x3, %o3
73
    ta 0x83
74
    ta 0x83
-
 
75
    restore %g0, 0, %g0
74
    retry
76
    retry
75
.endm
77
.endm
76
 
78
 
77
.macro FAST_DATA_ACCESS_PROTECTION_HANDLER tl
79
.macro FAST_DATA_ACCESS_PROTECTION_HANDLER tl
78
.endm
80
.endm
79
 
81
 
80
#endif /* __ASM__ */
82
#endif /* __ASM__ */
81
 
83
 
82
#endif
84
#endif
83
 
85
 
84
/** @}
86
/** @}
85
 */
87
 */
86
 
88