Skip to content

Commit

Permalink
Fixup unit tests for cpu_queue_job() in mem_region.c
Browse files Browse the repository at this point in the history
Fixes: 06808a0
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
stewartsmith committed Jul 18, 2018
1 parent 041d69b commit 13e9a66
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/test/Makefile.check
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CORE_TEST := \
core/test/run-buddy \
core/test/run-pci-quirk

HOSTCFLAGS+=-I . -I include
HOSTCFLAGS+=-I . -I include -Wno-error=attributes

CORE_TEST_NOSTUB := core/test/run-console-log
CORE_TEST_NOSTUB += core/test/run-console-log-buf-overrun
Expand Down
7 changes: 7 additions & 0 deletions core/test/dummy-cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,
const char *name,
void (*func)(void *data), void *data,
bool no_return);
static inline struct cpu_job *cpu_queue_job(struct cpu_thread *cpu,
const char *name,
void (*func)(void *data),
void *data)
{
return __cpu_queue_job(cpu, name, func, data, false);
}
void cpu_wait_job(struct cpu_job *job, bool free_it);
void cpu_process_local_jobs(void);
struct cpu_job *cpu_queue_job_on_node(uint32_t chip_id,
Expand Down
6 changes: 4 additions & 2 deletions core/test/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <stdarg.h>
#include <stdint.h>

#include <compiler.h>
#include "../../ccan/list/list.c"

void _prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3)));
Expand Down Expand Up @@ -48,6 +49,7 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,
const char *name,
void (*func)(void *data), void *data,
bool no_return);

void cpu_wait_job(struct cpu_job *job, bool free_it);
void cpu_process_local_jobs(void);
struct cpu_job *cpu_queue_job_on_node(uint32_t chip_id,
Expand All @@ -74,14 +76,14 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,
return NULL;
}

void cpu_wait_job(struct cpu_job *job, bool free_it)
void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it)
{
(void)job;
(void)free_it;
return;
}

void cpu_process_local_jobs(void)
void __attrconst cpu_process_local_jobs(void)
{
}

Expand Down
7 changes: 7 additions & 0 deletions hdata/test/hdata_to_dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ void cpu_process_local_jobs(void);
struct cpu_job *cpu_queue_job_on_node(uint32_t chip_id,
const char *name,
void (*func)(void *data), void *data);
static inline struct cpu_job *cpu_queue_job(struct cpu_thread *cpu,
const char *name,
void (*func)(void *data),
void *data)
{
return __cpu_queue_job(cpu, name, func, data, false);
}

struct cpu_thread __boot_cpu, *boot_cpu = &__boot_cpu;
static unsigned long fake_pvr = PVR_P7;
Expand Down
4 changes: 2 additions & 2 deletions hdata/test/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,

void cpu_wait_job(struct cpu_job *job, bool free_it);

void cpu_wait_job(struct cpu_job *job, bool free_it)
void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it)
{
(void)job;
(void)free_it;
Expand All @@ -127,7 +127,7 @@ void cpu_wait_job(struct cpu_job *job, bool free_it)

void cpu_process_local_jobs(void);

void cpu_process_local_jobs(void)
void __attrconst cpu_process_local_jobs(void)
{
}

Expand Down

0 comments on commit 13e9a66

Please sign in to comment.