Skip to content

Commit 15a9cb7

Browse files
committed
test: workarounds for unittests on arm
1 parent ff2b623 commit 15a9cb7

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

api/smp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,21 @@ struct minimal_barrier_t
5959
{
6060
__sync_fetch_and_add(&val, 1);
6161
}
62-
62+
6363
void spin_wait(int max)
6464
{
6565
asm("mfence");
6666
while (this->val < max) {
6767
asm("pause; nop;");
6868
}
6969
}
70-
70+
7171
void reset(int val)
7272
{
7373
asm volatile("mfence");
7474
this->val = val;
7575
}
76-
76+
7777
private:
7878
volatile int val = 0;
7979
};
@@ -131,4 +131,11 @@ public:
131131
// access a std::array of structs indexed by current CPU id
132132
#define PER_CPU(x) (per_cpu_help<decltype(x)::value_type, x.size()>(x))
133133

134+
#ifndef ARCH_X86
135+
typedef int spinlock_t;
136+
inline void lock(spinlock_t&) {}
137+
inline void unlock(spinlock_t&) {}
138+
#endif
139+
134140
#endif
141+

0 commit comments

Comments
 (0)