2 .\" Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SYNC_INSTRUCTION_MEMORY 3C "Feb 12, 1997"
8 sync_instruction_memory \- make modified instructions executable
12 \fBvoid\fR \fBsync_instruction_memory\fR(\fBcaddr_t\fR \fIaddr\fR, \fBint\fR \fIlen\fR);
18 The \fBsync_instruction_memory()\fR function performs whatever steps are
19 required to make instructions modified by a program executable.
22 Some processor architectures, including some SPARC processors, have separate
23 and independent instruction and data caches which are not kept consistent by
24 hardware. For example, if the instruction cache contains an instruction from
25 some address and the program then stores a new instruction at that address, the
26 new instruction may not be immediately visible to the instruction fetch
27 mechanism. Software must explicitly invalidate the instruction cache entries
28 for new or changed mappings of pages that might contain executable
29 instructions. The \fBsync_instruction_memory()\fR function performs this
30 function, and/or any other functions needed to make modified instructions
31 between \fIaddr\fR and \fIaddr\fR+\fIlen\fR visible. A program should call
32 \fBsync_instruction_memory()\fR after modifying instructions and before
36 On processors with unified caches (one cache for both instructions and data)
37 and pipelines which are flushed by a branch instruction, such as the x86
38 architecture, the function may do nothing and just return.
41 The changes are immediately visible to the thread calling
42 \fBsync_instruction_memory()\fR when the call returns, even if the thread
43 should migrate to another processor during or after the call. The changes
44 become visible to other threads in the same manner that stores do; that is,
45 they eventually become visible, but the latency is implementation-dependent.
48 The result of executing \fBsync_instruction_memory()\fR are unpredictable if
49 \fIaddr\fR through \fIaddr\fR+\fIlen\fR-1 are not valid for the address space
50 of the program making the call.
54 No values are returned.
58 See \fBattributes\fR(5) for descriptions of the following attributes:
66 ATTRIBUTE TYPE ATTRIBUTE VALUE