mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
memshr: Must be built on ia64 as well as x86, as blktap depends on it.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
2a3b9a4f92
commit
bd9d6a42bc
3 files changed
+27
-18
No files matched your search
+2
-3
@@ -21,6 +21,7 @@ SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
|
||||
SUBDIRS-$(VTPM_TOOLS) += vtpm
|
||||
SUBDIRS-y += xenstat
|
||||
SUBDIRS-$(CONFIG_Linux) += libaio
|
||||
SUBDIRS-$(CONFIG_Linux) += memshr
|
||||
SUBDIRS-$(CONFIG_Linux) += blktap
|
||||
SUBDIRS-$(CONFIG_Linux) += blktap2
|
||||
SUBDIRS-$(CONFIG_NetBSD) += libaio
|
||||
@@ -34,9 +35,7 @@ SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
|
||||
SUBDIRS-y += xenpmd
|
||||
SUBDIRS-y += libxl
|
||||
SUBDIRS-y += remus
|
||||
|
||||
SUBDIRS-$(CONFIG_X86)$(CONFIG_Linux) += memshr
|
||||
SUBDIRS-$(CONFIG_X86)$(CONFIG_Linux) += xenpaging
|
||||
SUBDIRS-$(CONFIG_X86) += xenpaging
|
||||
|
||||
# These don't cross-compile
|
||||
ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ INSTALL_PYTHON_PROG = \
|
||||
$(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
subdirs-all subdirs-clean subdirs-install: .phony
|
||||
@set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y) $(SUBDIRS-yy); do \
|
||||
@set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
|
||||
$(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \
|
||||
done
|
||||
|
||||
|
||||
+24
-14
@@ -100,21 +100,31 @@ int __hash_iterator(struct __hash *h,
|
||||
void *d);
|
||||
static void hash_resize(struct __hash *h);
|
||||
|
||||
static inline void atomic_add(uint32_t *v, uint32_t i)
|
||||
{
|
||||
asm volatile(
|
||||
"lock ; addl %1,%0"
|
||||
:"=m" (*(volatile uint32_t *)v)
|
||||
:"ir" (i), "m" (*(volatile uint32_t *)v) );
|
||||
}
|
||||
|
||||
static inline void atomic_sub(uint32_t *v, uint32_t i)
|
||||
#if defined(__ia64__)
|
||||
#define ia64_fetchadd4_rel(p, inc) do { \
|
||||
uint64_t ia64_intri_res; \
|
||||
asm volatile ("fetchadd4.rel %0=[%1],%2" \
|
||||
: "=r"(ia64_intri_res) : "r"(p), "i" (inc) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
static inline void atomic_inc(uint32_t *v) { ia64_fetchadd4_rel(v, 1); }
|
||||
static inline void atomic_dec(uint32_t *v) { ia64_fetchadd4_rel(v, -1); }
|
||||
#else /* __x86__ */
|
||||
static inline void atomic_inc(uint32_t *v)
|
||||
{
|
||||
asm volatile (
|
||||
"lock ; subl %1,%0"
|
||||
"lock ; incl %0"
|
||||
: "=m" (*(volatile uint32_t *)v)
|
||||
: "ir" (i), "m" (*(volatile uint32_t *)v) );
|
||||
: "m" (*(volatile uint32_t *)v) );
|
||||
}
|
||||
static inline void atomic_dec(uint32_t *v)
|
||||
{
|
||||
asm volatile (
|
||||
"lock ; decl %0"
|
||||
: "=m" (*(volatile uint32_t *)v)
|
||||
: "m" (*(volatile uint32_t *)v) );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BIDIR_USE_STDMALLOC
|
||||
|
||||
@@ -811,7 +821,7 @@ int __insert(struct __hash *h, __k_t k, __v_t v)
|
||||
TWO_BUCKETS_LOCK_WRUNLOCK(h, bltk, k_idx, bltv, v_idx);
|
||||
|
||||
/* Book keeping */
|
||||
atomic_add(&h->nr_ent, 1);
|
||||
atomic_inc(&h->nr_ent);
|
||||
|
||||
HASH_LOCK_RDUNLOCK(h);
|
||||
|
||||
@@ -945,7 +955,7 @@ found_again:
|
||||
*pek = e->__prim_next;
|
||||
*pev = e->__sec_next;
|
||||
|
||||
atomic_sub(&h->nr_ent, 1);
|
||||
atomic_dec(&h->nr_ent);
|
||||
nr_ent = h->nr_ent;
|
||||
/* read min_load still under the hash lock! */
|
||||
min_load = h->min_load;
|
||||
@@ -1094,7 +1104,7 @@ found_again:
|
||||
*pek = e->__prim_next;
|
||||
*pev = e->__sec_next;
|
||||
|
||||
atomic_sub(&h->nr_ent, 1);
|
||||
atomic_dec(&h->nr_ent);
|
||||
nr_ent = h->nr_ent;
|
||||
/* read min_load still under the hash lock! */
|
||||
min_load = h->min_load;
|
||||
|
||||