summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2016-11-13 12:04:29 +0100
committerRichard Henderson <rth@twiddle.net>2016-11-13 12:04:29 +0100
commit333f7da2d9287747779599e62a0bab89b5fa558b (patch)
tree56e4fa46cdde9d04420d2cc6aaccecfcfdea82d0 /util.c
parentc87a92639b28ac42bc8f6c67443543b405dc479b (diff)
downloadqemu-palcode-333f7da2d9287747779599e62a0bab89b5fa558b.zip
qemu-palcode-333f7da2d9287747779599e62a0bab89b5fa558b.tar.gz
qemu-palcode-333f7da2d9287747779599e62a0bab89b5fa558b.tar.bz2
Add smp support
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'util.c')
-rw-r--r--util.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/util.c b/util.c
index 1444dd6..0e943be 100644
--- a/util.c
+++ b/util.c
@@ -20,20 +20,20 @@
#include "protos.h"
+static inline long
+ndelay_with_int(unsigned long nsec)
+{
+ register long a0 __asm__("16") = nsec;
+ register long v0 __asm__("0");
+ asm volatile ("call_pal 3" : "=r"(v0) : "r"(a0));
+ return v0;
+}
void
ndelay(unsigned long nsec)
{
- unsigned long target, now;
-
- /* ??? Fix race between setting an alarm and waiting for an interrupt,
- so that we can use wtint here. This isn't used much except for
- during startup, so it probably doesn't matter much. */
-
- now = get_wall_time();
- target = now + nsec;
-
- do
- now = get_wall_time();
- while (now < target);
+ long left = nsec;
+ do {
+ left = ndelay_with_int(left);
+ } while (left > 0);
}