author | Mark J. Nelson <Mark.J.Nelson@Sun.COM> |
Wed, 06 Aug 2008 16:29:39 -0600 | |
changeset 7298 | b69e27387f74 |
parent 0 | 68f95e015346 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
7298
b69e27387f74
6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents:
0
diff
changeset
|
5 |
* Common Development and Distribution License (the "License"). |
b69e27387f74
6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents:
0
diff
changeset
|
6 |
* You may not use this file except in compliance with the License. |
0 | 7 |
* |
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
21 |
/* |
|
22 |
* Copyright (c) 1995-1997, by Sun Microsystems, Inc. |
|
23 |
* All rights reserved. |
|
24 |
*/ |
|
25 |
||
7298
b69e27387f74
6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents:
0
diff
changeset
|
26 |
.file "sync_instruction_memory.s" |
0 | 27 |
|
28 |
#include <sys/asm_linkage.h> |
|
29 |
||
30 |
/* |
|
31 |
* void sync_instruction_memory(caddr_t addr, int len) |
|
32 |
* |
|
33 |
* Make the memory at {addr, addr+len} valid for instruction execution. |
|
34 |
*/ |
|
35 |
||
36 |
#ifdef lint |
|
37 |
#define nop |
|
38 |
void |
|
39 |
sync_instruction_memory(caddr_t addr, int len) |
|
40 |
{ |
|
41 |
caddr_t end = addr + len; |
|
42 |
caddr_t start = addr & ~7; |
|
43 |
for (; start < end; start += 8) |
|
44 |
flush(start); |
|
45 |
nop; nop; nop; nop; nop; |
|
46 |
return; |
|
47 |
} |
|
48 |
#else |
|
49 |
ENTRY(sync_instruction_memory) |
|
50 |
add %o0, %o1, %o2 |
|
51 |
andn %o0, 7, %o0 |
|
52 |
||
53 |
cmp %o0, %o2 |
|
54 |
bgeu 2f |
|
55 |
nop |
|
56 |
flush %o0 |
|
57 |
1: |
|
58 |
add %o0, 8, %o0 |
|
59 |
cmp %o0, %o2 |
|
60 |
blu,a 1b |
|
61 |
flush %o0 |
|
62 |
! |
|
63 |
! when we get here, we have executed 3 instructions after the |
|
64 |
! last flush; SPARC V8 requires 2 more for flush to be visible |
|
65 |
! The retl;nop pair will do it. |
|
66 |
! |
|
67 |
2: |
|
68 |
retl |
|
69 |
clr %o0 |
|
70 |
SET_SIZE(sync_instruction_memory) |
|
71 |
||
72 |
ENTRY(nop) |
|
73 |
retl |
|
74 |
nop |
|
75 |
SET_SIZE(nop) |
|
76 |
#endif |