summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 03:40:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 03:40:56 +0000
commit5f7d1fd49707aedcb8f7d4c564bb24e17082c54d (patch)
treed2f426d524267b202913f9da6c3ce01195dc70d8
parentc76617c55cded20bc72f5a7bf733a04af72bb8b1 (diff)
from netbsd; add cache flushing
-rw-r--r--gnu/usr.bin/ld/sparc/md.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/usr.bin/ld/sparc/md.c b/gnu/usr.bin/ld/sparc/md.c
index 4e9a4c750bb..39f03f68054 100644
--- a/gnu/usr.bin/ld/sparc/md.c
+++ b/gnu/usr.bin/ld/sparc/md.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: md.c,v 1.1 1995/10/18 08:40:58 deraadt Exp $
+ * $Id: md.c,v 1.2 1995/12/14 03:40:55 deraadt Exp $
*/
#include <sys/param.h>
@@ -88,6 +88,14 @@ static int reloc_target_bitsize[] = {
32, 0, 22 /* _GLOB_DAT, JMP_SLOT, _RELATIVE */
};
+static __inline void
+iflush(sp)
+ jmpslot_t *sp;
+{
+ __asm __volatile("iflush %0+0" : : "r" (sp));
+ __asm __volatile("iflush %0+4" : : "r" (sp));
+ __asm __volatile("iflush %0+8" : : "r" (sp));
+}
/*
* Get relocation addend corresponding to relocation record RP
@@ -219,6 +227,7 @@ long index;
/* The following is a RELOC_WDISP30 relocation */
sp->opcode2 = CALL | ((fudge >> 2) & 0x3fffffff);
sp->reloc_index = NOP | index;
+ iflush(sp);
}
/*
@@ -246,6 +255,7 @@ u_long addr;
sp->opcode1 = SETHI | ((addr >> 10) & 0x003fffff);
sp->opcode2 = JMP | (addr & 0x000003ff);
sp->reloc_index = NOP;
+ iflush(sp);
}
/*