diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-08-08 21:18:31 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-08-08 21:18:31 +0000 |
commit | fbdb153f7921898ccd6746c7b77e49d71dc8e8da (patch) | |
tree | 5c0ecf7fb2ba5a66c3b9b0ba59525638a37213e2 /libexec/ld.so | |
parent | c62b70dae22668d3c42bec000fd03dc2808853c5 (diff) |
- Add some missing iflush's
- insert some nop's to make sure all copies are gone from the icache and CPU
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/sparc/rtld_machine.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libexec/ld.so/sparc/rtld_machine.c b/libexec/ld.so/sparc/rtld_machine.c index 9c462341a23..2f83bb4ce9c 100644 --- a/libexec/ld.so/sparc/rtld_machine.c +++ b/libexec/ld.so/sparc/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.3 2002/07/29 15:20:38 art Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.4 2002/08/08 21:18:30 jason Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -180,6 +180,15 @@ _dl_reloc_plt(Elf_Addr *where, Elf_Addr value) where[1] = SETHI | ((value >> 10) & 0x003fffff); __asm __volatile("iflush %0+8" : : "r" (where)); __asm __volatile("iflush %0+4" : : "r" (where)); + /* + * iflush requires 5 subsequent cycles to be sure all copies + * are flushed from the CPU and the icache. + */ + __asm __volatile("nop"); + __asm __volatile("nop"); + __asm __volatile("nop"); + __asm __volatile("nop"); + __asm __volatile("nop"); } int @@ -385,4 +394,17 @@ _dl_md_reloc_got(elf_object_t *object, int lazy) ((Elf_Addr)&_dl_bind_start - (Elf_Addr)&pltgot[1]) >> 2; pltgot[2] = NOP; pltgot[3] = (Elf_Addr) object; + __asm __volatile("iflush %0+12" : : "r" (pltgot)); + __asm __volatile("iflush %0+8" : : "r" (pltgot)); + __asm __volatile("iflush %0+4" : : "r" (pltgot)); + __asm __volatile("iflush %0+0" : : "r" (pltgot)); + /* + * iflush requires 5 subsequent cycles to be sure all copies + * are flushed from the CPU and the icache. + */ + __asm __volatile("nop"); + __asm __volatile("nop"); + __asm __volatile("nop"); + __asm __volatile("nop"); + __asm __volatile("nop"); } |