Merge branch 'linus' into x86/fpu, to resolve conflicts
Conflicts: arch/x86/kernel/fpu/core.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -1337,8 +1337,8 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser,
|
||||
}
|
||||
|
||||
if (first) {
|
||||
ui_browser__printf(&browser->b, "%c", folded_sign);
|
||||
width--;
|
||||
ui_browser__printf(&browser->b, "%c ", folded_sign);
|
||||
width -= 2;
|
||||
first = false;
|
||||
} else {
|
||||
ui_browser__printf(&browser->b, " ");
|
||||
@@ -1361,8 +1361,10 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser,
|
||||
width -= hpp.buf - s;
|
||||
}
|
||||
|
||||
ui_browser__write_nstring(&browser->b, "", hierarchy_indent);
|
||||
width -= hierarchy_indent;
|
||||
if (!first) {
|
||||
ui_browser__write_nstring(&browser->b, "", hierarchy_indent);
|
||||
width -= hierarchy_indent;
|
||||
}
|
||||
|
||||
if (column >= browser->b.horiz_scroll) {
|
||||
char s[2048];
|
||||
@@ -1381,7 +1383,13 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser,
|
||||
}
|
||||
|
||||
perf_hpp_list__for_each_format(entry->hpp_list, fmt) {
|
||||
ui_browser__write_nstring(&browser->b, "", 2);
|
||||
if (first) {
|
||||
ui_browser__printf(&browser->b, "%c ", folded_sign);
|
||||
first = false;
|
||||
} else {
|
||||
ui_browser__write_nstring(&browser->b, "", 2);
|
||||
}
|
||||
|
||||
width -= 2;
|
||||
|
||||
/*
|
||||
@@ -1555,10 +1563,11 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
|
||||
int indent = hists->nr_hpp_node - 2;
|
||||
bool first_node, first_col;
|
||||
|
||||
ret = scnprintf(buf, size, " ");
|
||||
ret = scnprintf(buf, size, " ");
|
||||
if (advance_hpp_check(&dummy_hpp, ret))
|
||||
return ret;
|
||||
|
||||
first_node = true;
|
||||
/* the first hpp_list_node is for overhead columns */
|
||||
fmt_node = list_first_entry(&hists->hpp_formats,
|
||||
struct perf_hpp_list_node, list);
|
||||
@@ -1573,12 +1582,16 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
|
||||
ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, " ");
|
||||
if (advance_hpp_check(&dummy_hpp, ret))
|
||||
break;
|
||||
|
||||
first_node = false;
|
||||
}
|
||||
|
||||
ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "%*s",
|
||||
indent * HIERARCHY_INDENT, "");
|
||||
if (advance_hpp_check(&dummy_hpp, ret))
|
||||
return ret;
|
||||
if (!first_node) {
|
||||
ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "%*s",
|
||||
indent * HIERARCHY_INDENT, "");
|
||||
if (advance_hpp_check(&dummy_hpp, ret))
|
||||
return ret;
|
||||
}
|
||||
|
||||
first_node = true;
|
||||
list_for_each_entry_continue(fmt_node, &hists->hpp_formats, list) {
|
||||
@@ -2076,8 +2089,21 @@ void hist_browser__init(struct hist_browser *browser,
|
||||
browser->b.use_navkeypressed = true;
|
||||
browser->show_headers = symbol_conf.show_hist_headers;
|
||||
|
||||
hists__for_each_format(hists, fmt)
|
||||
if (symbol_conf.report_hierarchy) {
|
||||
struct perf_hpp_list_node *fmt_node;
|
||||
|
||||
/* count overhead columns (in the first node) */
|
||||
fmt_node = list_first_entry(&hists->hpp_formats,
|
||||
struct perf_hpp_list_node, list);
|
||||
perf_hpp_list__for_each_format(&fmt_node->hpp, fmt)
|
||||
++browser->b.columns;
|
||||
|
||||
/* add a single column for whole hierarchy sort keys*/
|
||||
++browser->b.columns;
|
||||
} else {
|
||||
hists__for_each_format(hists, fmt)
|
||||
++browser->b.columns;
|
||||
}
|
||||
|
||||
hists__reset_column_width(hists);
|
||||
}
|
||||
|
@@ -1600,18 +1600,18 @@ static void hists__hierarchy_output_resort(struct hists *hists,
|
||||
if (prog)
|
||||
ui_progress__update(prog, 1);
|
||||
|
||||
hists->nr_entries++;
|
||||
if (!he->filtered) {
|
||||
hists->nr_non_filtered_entries++;
|
||||
hists__calc_col_len(hists, he);
|
||||
}
|
||||
|
||||
if (!he->leaf) {
|
||||
hists__hierarchy_output_resort(hists, prog,
|
||||
&he->hroot_in,
|
||||
&he->hroot_out,
|
||||
min_callchain_hits,
|
||||
use_callchain);
|
||||
hists->nr_entries++;
|
||||
if (!he->filtered) {
|
||||
hists->nr_non_filtered_entries++;
|
||||
hists__calc_col_len(hists, he);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -8,18 +8,19 @@
|
||||
# as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
|
||||
include ../../../../scripts/Makefile.include
|
||||
ifeq ($(srctree),)
|
||||
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
|
||||
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
||||
#$(info Determined 'srctree' to be $(srctree))
|
||||
endif
|
||||
|
||||
OUTPUT=./
|
||||
include $(srctree)/../../scripts/Makefile.include
|
||||
|
||||
OUTPUT=$(srctree)/
|
||||
ifeq ("$(origin O)", "command line")
|
||||
OUTPUT := $(O)/
|
||||
endif
|
||||
|
||||
ifneq ($(OUTPUT),)
|
||||
# check that the output directory actually exists
|
||||
OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
|
||||
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
|
||||
OUTPUT := $(O)/power/acpi/
|
||||
endif
|
||||
#$(info Determined 'OUTPUT' to be $(OUTPUT))
|
||||
|
||||
# --- CONFIGURATION BEGIN ---
|
||||
|
||||
@@ -70,8 +71,8 @@ WARNINGS := -Wall
|
||||
WARNINGS += $(call cc-supports,-Wstrict-prototypes)
|
||||
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
|
||||
|
||||
KERNEL_INCLUDE := ../../../include
|
||||
ACPICA_INCLUDE := ../../../drivers/acpi/acpica
|
||||
KERNEL_INCLUDE := $(OUTPUT)include
|
||||
ACPICA_INCLUDE := $(srctree)/../../../drivers/acpi/acpica
|
||||
CFLAGS += -D_LINUX -I$(KERNEL_INCLUDE) -I$(ACPICA_INCLUDE)
|
||||
CFLAGS += $(WARNINGS)
|
||||
|
||||
|
@@ -8,28 +8,42 @@
|
||||
# as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
|
||||
$(OUTPUT)$(TOOL): $(TOOL_OBJS) FORCE
|
||||
$(ECHO) " LD " $@
|
||||
$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(TOOL_OBJS) -L$(OUTPUT) -o $@
|
||||
objdir := $(OUTPUT)tools/$(TOOL)/
|
||||
toolobjs := $(addprefix $(objdir),$(TOOL_OBJS))
|
||||
$(OUTPUT)$(TOOL): $(toolobjs) FORCE
|
||||
$(ECHO) " LD " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(toolobjs) -L$(OUTPUT) -o $@
|
||||
$(ECHO) " STRIP " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) $(STRIPCMD) $@
|
||||
|
||||
$(OUTPUT)%.o: %.c
|
||||
$(ECHO) " CC " $@
|
||||
$(KERNEL_INCLUDE):
|
||||
$(ECHO) " MKDIR " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) mkdir -p $(KERNEL_INCLUDE)
|
||||
$(ECHO) " CP " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) cp -rf $(srctree)/../../../include/acpi $(KERNEL_INCLUDE)/
|
||||
|
||||
$(objdir)%.o: %.c $(KERNEL_INCLUDE)
|
||||
$(ECHO) " CC " $(subst $(OUTPUT),,$@)
|
||||
$(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
all: $(OUTPUT)$(TOOL)
|
||||
clean:
|
||||
-find $(OUTPUT) \( -not -type d \) \
|
||||
-and \( -name '*~' -o -name '*.[oas]' \) \
|
||||
-type f -print \
|
||||
| xargs rm -f
|
||||
-rm -f $(OUTPUT)$(TOOL)
|
||||
$(ECHO) " RMOBJ " $(subst $(OUTPUT),,$(objdir))
|
||||
$(QUIET) find $(objdir) \( -not -type d \)\
|
||||
-and \( -name '*~' -o -name '*.[oas]' \)\
|
||||
-type f -print | xargs rm -f
|
||||
$(ECHO) " RM " $(TOOL)
|
||||
$(QUIET) rm -f $(OUTPUT)$(TOOL)
|
||||
$(ECHO) " RMINC " $(subst $(OUTPUT),,$(KERNEL_INCLUDE))
|
||||
$(QUIET) rm -rf $(KERNEL_INCLUDE)
|
||||
|
||||
install-tools:
|
||||
$(INSTALL) -d $(DESTDIR)${sbindir}
|
||||
$(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)${sbindir}
|
||||
$(ECHO) " INST " $(TOOL)
|
||||
$(QUIET) $(INSTALL) -d $(DESTDIR)$(sbindir)
|
||||
$(QUIET) $(INSTALL_PROGRAM) $(OUTPUT)$(TOOL) $(DESTDIR)$(sbindir)
|
||||
uninstall-tools:
|
||||
- rm -f $(DESTDIR)${sbindir}/$(TOOL)
|
||||
$(ECHO) " UNINST " $(TOOL)
|
||||
$(QUIET) rm -f $(DESTDIR)$(sbindir)/$(TOOL)
|
||||
|
||||
install: all install-tools $(EXTRA_INSTALL)
|
||||
uninstall: uninstall-tools $(EXTRA_UNINSTALL)
|
||||
|
@@ -17,9 +17,7 @@ vpath %.c \
|
||||
../../os_specific/service_layers\
|
||||
.
|
||||
CFLAGS += -DACPI_APPLICATION -DACPI_SINGLE_THREAD -DACPI_DEBUGGER\
|
||||
-I.\
|
||||
-I../../../../../drivers/acpi/acpica\
|
||||
-I../../../../../include
|
||||
-I.
|
||||
LDFLAGS += -lpthread
|
||||
TOOL_OBJS = \
|
||||
acpidbg.o
|
||||
|
@@ -12,10 +12,16 @@
|
||||
#include <acpi/acpi.h>
|
||||
|
||||
/* Headers not included by include/acpi/platform/aclinux.h */
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <error.h>
|
||||
#include <stdbool.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <linux/circ_buf.h>
|
||||
#include <sys/select.h>
|
||||
#include "../../../../../include/linux/circ_buf.h"
|
||||
|
||||
#define ACPI_AML_FILE "/sys/kernel/debug/acpi/acpidbg"
|
||||
#define ACPI_AML_SEC_TICK 1
|
||||
|
@@ -19,9 +19,7 @@ vpath %.c \
|
||||
./\
|
||||
../../common\
|
||||
../../os_specific/service_layers
|
||||
CFLAGS += -DACPI_DUMP_APP -I.\
|
||||
-I../../../../../drivers/acpi/acpica\
|
||||
-I../../../../../include
|
||||
CFLAGS += -DACPI_DUMP_APP -I.
|
||||
TOOL_OBJS = \
|
||||
apdump.o\
|
||||
apfiles.o\
|
||||
@@ -49,7 +47,9 @@ TOOL_OBJS = \
|
||||
|
||||
include ../../Makefile.rules
|
||||
|
||||
install-man: ../../man/acpidump.8
|
||||
$(INSTALL_DATA) -D $< $(DESTDIR)${mandir}/man8/acpidump.8
|
||||
install-man: $(srctree)/man/acpidump.8
|
||||
$(ECHO) " INST " acpidump.8
|
||||
$(QUIET) $(INSTALL_DATA) -D $< $(DESTDIR)$(mandir)/man8/acpidump.8
|
||||
uninstall-man:
|
||||
- rm -f $(DESTDIR)${mandir}/man8/acpidump.8
|
||||
$(ECHO) " UNINST " acpidump.8
|
||||
$(QUIET) rm -f $(DESTDIR)$(mandir)/man8/acpidump.8
|
||||
|
@@ -296,7 +296,7 @@ int cmd_freq_set(int argc, char **argv)
|
||||
struct cpufreq_affected_cpus *cpus;
|
||||
|
||||
if (!bitmask_isbitset(cpus_chosen, cpu) ||
|
||||
cpupower_is_cpu_online(cpu))
|
||||
cpupower_is_cpu_online(cpu) != 1)
|
||||
continue;
|
||||
|
||||
cpus = cpufreq_get_related_cpus(cpu);
|
||||
@@ -316,10 +316,7 @@ int cmd_freq_set(int argc, char **argv)
|
||||
cpu <= bitmask_last(cpus_chosen); cpu++) {
|
||||
|
||||
if (!bitmask_isbitset(cpus_chosen, cpu) ||
|
||||
cpupower_is_cpu_online(cpu))
|
||||
continue;
|
||||
|
||||
if (cpupower_is_cpu_online(cpu) != 1)
|
||||
cpupower_is_cpu_online(cpu) != 1)
|
||||
continue;
|
||||
|
||||
printf(_("Setting cpu: %d\n"), cpu);
|
||||
|
@@ -3,8 +3,8 @@ all:
|
||||
all: ring virtio_ring_0_9 virtio_ring_poll virtio_ring_inorder ptr_ring noring
|
||||
|
||||
CFLAGS += -Wall
|
||||
CFLAGS += -pthread -O2 -ggdb
|
||||
LDFLAGS += -pthread -O2 -ggdb
|
||||
CFLAGS += -pthread -O2 -ggdb -flto -fwhole-program
|
||||
LDFLAGS += -pthread -O2 -ggdb -flto -fwhole-program
|
||||
|
||||
main.o: main.c main.h
|
||||
ring.o: ring.c main.h
|
||||
|
@@ -96,7 +96,13 @@ void set_affinity(const char *arg)
|
||||
assert(!ret);
|
||||
}
|
||||
|
||||
static void run_guest(void)
|
||||
void poll_used(void)
|
||||
{
|
||||
while (used_empty())
|
||||
busy_wait();
|
||||
}
|
||||
|
||||
static void __attribute__((__flatten__)) run_guest(void)
|
||||
{
|
||||
int completed_before;
|
||||
int completed = 0;
|
||||
@@ -141,7 +147,7 @@ static void run_guest(void)
|
||||
assert(completed <= bufs);
|
||||
assert(started <= bufs);
|
||||
if (do_sleep) {
|
||||
if (enable_call())
|
||||
if (used_empty() && enable_call())
|
||||
wait_for_call();
|
||||
} else {
|
||||
poll_used();
|
||||
@@ -149,7 +155,13 @@ static void run_guest(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void run_host(void)
|
||||
void poll_avail(void)
|
||||
{
|
||||
while (avail_empty())
|
||||
busy_wait();
|
||||
}
|
||||
|
||||
static void __attribute__((__flatten__)) run_host(void)
|
||||
{
|
||||
int completed_before;
|
||||
int completed = 0;
|
||||
@@ -160,7 +172,7 @@ static void run_host(void)
|
||||
|
||||
for (;;) {
|
||||
if (do_sleep) {
|
||||
if (enable_kick())
|
||||
if (avail_empty() && enable_kick())
|
||||
wait_for_kick();
|
||||
} else {
|
||||
poll_avail();
|
||||
|
@@ -56,15 +56,15 @@ void alloc_ring(void);
|
||||
int add_inbuf(unsigned, void *, void *);
|
||||
void *get_buf(unsigned *, void **);
|
||||
void disable_call();
|
||||
bool used_empty();
|
||||
bool enable_call();
|
||||
void kick_available();
|
||||
void poll_used();
|
||||
/* host side */
|
||||
void disable_kick();
|
||||
bool avail_empty();
|
||||
bool enable_kick();
|
||||
bool use_buf(unsigned *, void **);
|
||||
void call_used();
|
||||
void poll_avail();
|
||||
|
||||
/* implemented by main */
|
||||
extern bool do_sleep;
|
||||
|
@@ -24,8 +24,9 @@ void *get_buf(unsigned *lenp, void **bufp)
|
||||
return "Buffer";
|
||||
}
|
||||
|
||||
void poll_used(void)
|
||||
bool used_empty()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void disable_call()
|
||||
@@ -54,8 +55,9 @@ bool enable_kick()
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void poll_avail(void)
|
||||
bool avail_empty()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool use_buf(unsigned *lenp, void **bufp)
|
||||
|
@@ -133,18 +133,9 @@ void *get_buf(unsigned *lenp, void **bufp)
|
||||
return datap;
|
||||
}
|
||||
|
||||
void poll_used(void)
|
||||
bool used_empty()
|
||||
{
|
||||
void *b;
|
||||
|
||||
do {
|
||||
if (tailcnt == headcnt || __ptr_ring_full(&array)) {
|
||||
b = NULL;
|
||||
barrier();
|
||||
} else {
|
||||
b = "Buffer\n";
|
||||
}
|
||||
} while (!b);
|
||||
return (tailcnt == headcnt || __ptr_ring_full(&array));
|
||||
}
|
||||
|
||||
void disable_call()
|
||||
@@ -173,14 +164,9 @@ bool enable_kick()
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void poll_avail(void)
|
||||
bool avail_empty()
|
||||
{
|
||||
void *b;
|
||||
|
||||
do {
|
||||
barrier();
|
||||
b = __ptr_ring_peek(&array);
|
||||
} while (!b);
|
||||
return !__ptr_ring_peek(&array);
|
||||
}
|
||||
|
||||
bool use_buf(unsigned *lenp, void **bufp)
|
||||
|
@@ -163,12 +163,11 @@ void *get_buf(unsigned *lenp, void **bufp)
|
||||
return datap;
|
||||
}
|
||||
|
||||
void poll_used(void)
|
||||
bool used_empty()
|
||||
{
|
||||
unsigned head = (ring_size - 1) & guest.last_used_idx;
|
||||
|
||||
while (ring[head].flags & DESC_HW)
|
||||
busy_wait();
|
||||
return (ring[head].flags & DESC_HW);
|
||||
}
|
||||
|
||||
void disable_call()
|
||||
@@ -180,13 +179,11 @@ void disable_call()
|
||||
|
||||
bool enable_call()
|
||||
{
|
||||
unsigned head = (ring_size - 1) & guest.last_used_idx;
|
||||
|
||||
event->call_index = guest.last_used_idx;
|
||||
/* Flush call index write */
|
||||
/* Barrier D (for pairing) */
|
||||
smp_mb();
|
||||
return ring[head].flags & DESC_HW;
|
||||
return used_empty();
|
||||
}
|
||||
|
||||
void kick_available(void)
|
||||
@@ -213,20 +210,17 @@ void disable_kick()
|
||||
|
||||
bool enable_kick()
|
||||
{
|
||||
unsigned head = (ring_size - 1) & host.used_idx;
|
||||
|
||||
event->kick_index = host.used_idx;
|
||||
/* Barrier C (for pairing) */
|
||||
smp_mb();
|
||||
return !(ring[head].flags & DESC_HW);
|
||||
return avail_empty();
|
||||
}
|
||||
|
||||
void poll_avail(void)
|
||||
bool avail_empty()
|
||||
{
|
||||
unsigned head = (ring_size - 1) & host.used_idx;
|
||||
|
||||
while (!(ring[head].flags & DESC_HW))
|
||||
busy_wait();
|
||||
return !(ring[head].flags & DESC_HW);
|
||||
}
|
||||
|
||||
bool use_buf(unsigned *lenp, void **bufp)
|
||||
|
@@ -194,24 +194,16 @@ void *get_buf(unsigned *lenp, void **bufp)
|
||||
return datap;
|
||||
}
|
||||
|
||||
void poll_used(void)
|
||||
bool used_empty()
|
||||
{
|
||||
unsigned short last_used_idx = guest.last_used_idx;
|
||||
#ifdef RING_POLL
|
||||
unsigned head = (ring_size - 1) & guest.last_used_idx;
|
||||
unsigned short head = last_used_idx & (ring_size - 1);
|
||||
unsigned index = ring.used->ring[head].id;
|
||||
|
||||
for (;;) {
|
||||
unsigned index = ring.used->ring[head].id;
|
||||
|
||||
if ((index ^ guest.last_used_idx ^ 0x8000) & ~(ring_size - 1))
|
||||
busy_wait();
|
||||
else
|
||||
break;
|
||||
}
|
||||
return (index ^ last_used_idx ^ 0x8000) & ~(ring_size - 1);
|
||||
#else
|
||||
unsigned head = guest.last_used_idx;
|
||||
|
||||
while (ring.used->idx == head)
|
||||
busy_wait();
|
||||
return ring.used->idx == last_used_idx;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -224,22 +216,11 @@ void disable_call()
|
||||
|
||||
bool enable_call()
|
||||
{
|
||||
unsigned short last_used_idx;
|
||||
|
||||
vring_used_event(&ring) = (last_used_idx = guest.last_used_idx);
|
||||
vring_used_event(&ring) = guest.last_used_idx;
|
||||
/* Flush call index write */
|
||||
/* Barrier D (for pairing) */
|
||||
smp_mb();
|
||||
#ifdef RING_POLL
|
||||
{
|
||||
unsigned short head = last_used_idx & (ring_size - 1);
|
||||
unsigned index = ring.used->ring[head].id;
|
||||
|
||||
return (index ^ last_used_idx ^ 0x8000) & ~(ring_size - 1);
|
||||
}
|
||||
#else
|
||||
return ring.used->idx == last_used_idx;
|
||||
#endif
|
||||
return used_empty();
|
||||
}
|
||||
|
||||
void kick_available(void)
|
||||
@@ -266,36 +247,21 @@ void disable_kick()
|
||||
|
||||
bool enable_kick()
|
||||
{
|
||||
unsigned head = host.used_idx;
|
||||
|
||||
vring_avail_event(&ring) = head;
|
||||
vring_avail_event(&ring) = host.used_idx;
|
||||
/* Barrier C (for pairing) */
|
||||
smp_mb();
|
||||
#ifdef RING_POLL
|
||||
{
|
||||
unsigned index = ring.avail->ring[head & (ring_size - 1)];
|
||||
|
||||
return (index ^ head ^ 0x8000) & ~(ring_size - 1);
|
||||
}
|
||||
#else
|
||||
return head == ring.avail->idx;
|
||||
#endif
|
||||
return avail_empty();
|
||||
}
|
||||
|
||||
void poll_avail(void)
|
||||
bool avail_empty()
|
||||
{
|
||||
unsigned head = host.used_idx;
|
||||
#ifdef RING_POLL
|
||||
for (;;) {
|
||||
unsigned index = ring.avail->ring[head & (ring_size - 1)];
|
||||
if ((index ^ head ^ 0x8000) & ~(ring_size - 1))
|
||||
busy_wait();
|
||||
else
|
||||
break;
|
||||
}
|
||||
unsigned index = ring.avail->ring[head & (ring_size - 1)];
|
||||
|
||||
return ((index ^ head ^ 0x8000) & ~(ring_size - 1));
|
||||
#else
|
||||
while (ring.avail->idx == head)
|
||||
busy_wait();
|
||||
return head == ring.avail->idx;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user