Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: checkp.h | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #define CHECKPOINT_HACKS | |
39 | #if 1 /* def N1_setup*/ | |
40 | #define OBP_TOP_COPY_BASE 0x1d0000000 | |
41 | #define OBP_TOP_BASE 0x46000000 | |
42 | #define OBP_TOP_COPY_LENGTH 0x2000000 | |
43 | #define DUMP_BASE_ADDR 0x180800000 | |
44 | #define PA_DUMP_AREA 0x180c00000 | |
45 | #define PA_DUMP_FLAGS_AREA 0x180d00000 | |
46 | #define SRC_ADDR 0x000100000 | |
47 | #define DST_ADDR 0x190100000 | |
48 | #else 0x4000000 | |
49 | #define OBP_TOP_COPY_BASE 0x1deff0000 | |
50 | #define OBP_TOP_BASE 0x1feff0000 | |
51 | #define DUMP_BASE_ADDR 0x0c0000000 | |
52 | #define PA_DUMP_AREA 0x0c0c00000 | |
53 | #define PA_DUMP_FLAGS_AREA 0x0c0d00000 | |
54 | #define SRC_ADDR 0x000000000 | |
55 | #define DST_ADDR 0x018000000 | |
56 | #endif | |
57 | ||
58 | /* #define NUM_THREADS 1 */ | |
59 | /* #define MAX_THREADS 28 */ | |
60 | #define OBP_MEM 2047 | |
61 | #define HV_MEM 128 | |
62 | #define MEM_SIZE ((OBP_MEM+HV_MEM)*1024*1024) | |
63 | #define N_BLOCKS (MEM_SIZE/0x2000) | |
64 | #define N_BLOCK_WORDS (N_BLOCKS/64) | |
65 | ||
66 | ||
67 | #define LOG_ADDR_FOR_CHECKP(pa, len, scr, scr1, scr2) \ | |
68 | setx PA_DUMP_AREA, scr, scr1 ;\ | |
69 | srlx pa, 19, scr/*# of 8k pages from base */ ;\ | |
70 | sllx scr, 3, scr ;\ | |
71 | add scr1, scr, scr1 ;\ | |
72 | srlx len, 13, len ;\ | |
73 | /*put a bit mask of page flags within 64 bit word that are modified*/ \ | |
74 | subcc %g0, 1, scr2 /*assume all */ ;\ | |
75 | subcc len, 1, %g0 ;\ | |
76 | move %icc, 1, scr2 /*only 1 bit if 8k page */ ;\ | |
77 | subcc len, 8, %g0 ;\ | |
78 | move %icc, 0xff, scr2 /*only 8 bits if 64k page */ ;\ | |
79 | srlx pa, 13, pa ;\ | |
80 | and pa, 0x3f, scr /*shift mask to correct position */ ;\ | |
81 | sllx scr2, scr, scr2 ;\ | |
82 | ldx [scr1], scr /*or in new page bits */ ;\ | |
83 | or scr,scr2,scr ;\ | |
84 | subcc len, 8, %g0 ;\ | |
85 | ble 1f ;\ | |
86 | stx scr, [scr1] ;\ | |
87 | /*below only for 4M page size (512 8k pages accessed) */ ;\ | |
88 | stx scr, [scr1+0x8] ;\ | |
89 | stx scr, [scr1+0x10] ;\ | |
90 | stx scr, [scr1+0x18] ;\ | |
91 | stx scr, [scr1+0x20] ;\ | |
92 | stx scr, [scr1+0x28] ;\ | |
93 | stx scr, [scr1+0x30] ;\ | |
94 | stx scr, [scr1+0x38] ;\ | |
95 | 1: |