summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2015-03-28 10:40:43 +0000
committerCharles Forsyth <charles.forsyth@gmail.com>2015-03-28 10:40:43 +0000
commit7a44ee6004672c6644c33847d86201f2a8c8acde (patch)
tree4563c20363b82ab3aeea0df84ec436e4b13dedb5
parentc2179f29df449f0f6eb42c703f2233bb1409fe59 (diff)
add coherence call for weakly-ordered cpus, default to nop
-rw-r--r--emu/port/fns.h1
-rw-r--r--emu/port/lock.c1
-rw-r--r--emu/port/main.c7
-rw-r--r--emu/port/win-x11a.c1
4 files changed, 10 insertions, 0 deletions
diff --git a/emu/port/fns.h b/emu/port/fns.h
index be825d17..cf5834b7 100644
--- a/emu/port/fns.h
+++ b/emu/port/fns.h
@@ -20,6 +20,7 @@ Dir* chandirstat(Chan*);
void cinit(void);
char* clipread(void);
int clipwrite(char*);
+void (*coherence)(void);
void copen(Chan*);
void cmderror(Cmdbuf*, char*);
Block* concatblock(Block*);
diff --git a/emu/port/lock.c b/emu/port/lock.c
index 48b5d8c2..7028dbd8 100644
--- a/emu/port/lock.c
+++ b/emu/port/lock.c
@@ -34,6 +34,7 @@ canlock(Lock *l)
void
unlock(Lock *l)
{
+ coherence();
l->val = 0;
}
diff --git a/emu/port/main.c b/emu/port/main.c
index 66ebb6a9..c45a33cf 100644
--- a/emu/port/main.c
+++ b/emu/port/main.c
@@ -227,6 +227,11 @@ putenvqv(char *name, char **v, int n, int conf)
free(val);
}
+static void
+noop(void)
+{
+}
+
void
main(int argc, char *argv[])
{
@@ -234,6 +239,8 @@ main(int argc, char *argv[])
char *enva[20];
int envc;
+ if(coherence == nil)
+ coherence = noop;
quotefmtinstall();
savestartup(argc, argv);
/* set default root now, so either $EMU or -r can override it later */
diff --git a/emu/port/win-x11a.c b/emu/port/win-x11a.c
index 987b4a87..4fdd295a 100644
--- a/emu/port/win-x11a.c
+++ b/emu/port/win-x11a.c
@@ -585,6 +585,7 @@ xcurslock(void)
static void
xcursunlock(void)
{
+ coherence();
icursor.inuse = 0;
}