* [Qemu-devel] [PATCH 00/12] target-lm32: various fixes
@ 2013-03-06 21:59 Michael Walle
2013-03-06 21:59 ` [Qemu-devel] [PATCH 01/12] target-lm32: fix debug memory access Michael Walle
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 21:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
This patchset contains various minor fixes and cleanups for the
LatticeMico32 target and its supported hardware models.
Patch 11 and 12 were already posted on this list, but never picked up.
If there are no objections, i'll send a pull request next week.
Michael Walle (12):
target-lm32: fix debug memory access
lm32-dis: fix NULL pointer dereference
milkymist-uart: fix receive buffering
lm32_uart: fix receive buffering
target-lm32: don't log cpu state in translation
tests: tcg: lm32: add more test cases
target-lm32: fix cmpgui and cmpgeui opcodes
target-lm32: remove dead code
target-lm32: flush tlb after clearing env
target-lm32: use HELPER() macro
configure: proper OpenGL/GLX probe
configure: rename OpenGL feature to GLX
configure | 34 +++++++++++++++++-----------------
disas/lm32.c | 8 ++++----
hw/lm32/Makefile.objs | 2 +-
hw/lm32_uart.c | 1 +
hw/milkymist-hw.h | 4 ++--
hw/milkymist-uart.c | 1 +
target-lm32/cpu.c | 4 ++--
target-lm32/cpu.h | 10 ----------
target-lm32/helper.c | 7 ++++++-
target-lm32/op_helper.c | 20 ++++++++++----------
target-lm32/translate.c | 23 ++++++++++++++---------
tests/tcg/lm32/test_cmpgei.S | 15 +++++++++++++++
tests/tcg/lm32/test_cmpgeui.S | 15 +++++++++++++++
tests/tcg/lm32/test_cmpgi.S | 15 +++++++++++++++
tests/tcg/lm32/test_cmpgui.S | 17 ++++++++++++++++-
15 files changed, 119 insertions(+), 57 deletions(-)
--
1.7.2.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 01/12] target-lm32: fix debug memory access
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
@ 2013-03-06 21:59 ` Michael Walle
2013-03-06 21:59 ` [Qemu-devel] [PATCH 02/12] lm32-dis: fix NULL pointer dereference Michael Walle
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 21:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
CPU models which have the LM32_FLAG_IGNORE_MSB flag set will shadow the
lower 2GB to the upper 2GB memory space. This will fix the debug memory
access used by qemu console and GDB to match this behaviour.
Signed-off-by: Michael Walle <michael@walle.cc>
---
target-lm32/helper.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/target-lm32/helper.c b/target-lm32/helper.c
index 47ae7e7..ef04643 100644
--- a/target-lm32/helper.c
+++ b/target-lm32/helper.c
@@ -39,7 +39,12 @@ int cpu_lm32_handle_mmu_fault(CPULM32State *env, target_ulong address, int rw,
hwaddr cpu_get_phys_page_debug(CPULM32State *env, target_ulong addr)
{
- return addr & TARGET_PAGE_MASK;
+ addr &= TARGET_PAGE_MASK;
+ if (env->flags & LM32_FLAG_IGNORE_MSB) {
+ return addr & 0x7fffffff;
+ } else {
+ return addr;
+ }
}
void do_interrupt(CPULM32State *env)
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 02/12] lm32-dis: fix NULL pointer dereference
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
2013-03-06 21:59 ` [Qemu-devel] [PATCH 01/12] target-lm32: fix debug memory access Michael Walle
@ 2013-03-06 21:59 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 03/12] milkymist-uart: fix receive buffering Michael Walle
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 21:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Signed-off-by: Michael Walle <michael@walle.cc>
---
disas/lm32.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/disas/lm32.c b/disas/lm32.c
index a8eefe0..1718c86 100644
--- a/disas/lm32.c
+++ b/disas/lm32.c
@@ -303,11 +303,11 @@ int print_insn_lm32(bfd_vma memaddr, struct disassemble_info *info)
}
case 'c': {
uint8_t csr;
- const char *csr_name;
+ const Lm32CsrInfo *info;
csr = (op >> 21) & 0x1f;
- csr_name = find_csr_info(csr)->name;
- if (csr_name) {
- fprintf_fn(stream, "%s", csr_name);
+ info = find_csr_info(csr);
+ if (info) {
+ fprintf_fn(stream, "%s", info->name);
} else {
fprintf_fn(stream, "0x%x", csr);
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 03/12] milkymist-uart: fix receive buffering
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
2013-03-06 21:59 ` [Qemu-devel] [PATCH 01/12] target-lm32: fix debug memory access Michael Walle
2013-03-06 21:59 ` [Qemu-devel] [PATCH 02/12] lm32-dis: fix NULL pointer dereference Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 04/12] lm32_uart: " Michael Walle
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Inform qemu-char when more input data can be received.
Signed-off-by: Michael Walle <michael@walle.cc>
---
hw/milkymist-uart.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hw/milkymist-uart.c b/hw/milkymist-uart.c
index e73eb84..29572b7 100644
--- a/hw/milkymist-uart.c
+++ b/hw/milkymist-uart.c
@@ -132,6 +132,7 @@ static void uart_write(void *opaque, hwaddr addr, uint64_t value,
case R_STAT:
/* write one to clear bits */
s->regs[addr] &= ~(value & (STAT_RX_EVT | STAT_TX_EVT));
+ qemu_chr_accept_input(s->chr);
break;
default:
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 04/12] lm32_uart: fix receive buffering
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (2 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 03/12] milkymist-uart: fix receive buffering Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 05/12] target-lm32: don't log cpu state in translation Michael Walle
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Inform qemu-char when more input data can be received.
Signed-off-by: Michael Walle <michael@walle.cc>
---
hw/lm32_uart.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hw/lm32_uart.c b/hw/lm32_uart.c
index 9c89cca..5b44f7f 100644
--- a/hw/lm32_uart.c
+++ b/hw/lm32_uart.c
@@ -137,6 +137,7 @@ static uint64_t uart_read(void *opaque, hwaddr addr,
r = s->regs[R_RXTX];
s->regs[R_LSR] &= ~LSR_DR;
uart_update_irq(s);
+ qemu_chr_accept_input(s->chr);
break;
case R_IIR:
case R_LSR:
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 05/12] target-lm32: don't log cpu state in translation
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (3 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 04/12] lm32_uart: " Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 06/12] tests: tcg: lm32: add more test cases Michael Walle
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Don't dump the cpu state because it can also be enabled by the "-d cpu"
parameter.
Signed-off-by: Michael Walle <michael@walle.cc>
---
target-lm32/translate.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 695d9c5..f51ffc5 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -1027,11 +1027,6 @@ static void gen_intermediate_code_internal(CPULM32State *env,
cpu_abort(env, "LM32: unaligned PC=%x\n", pc_start);
}
- if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
- qemu_log("-----------------------------------------\n");
- log_cpu_state(env, 0);
- }
-
next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
lj = -1;
num_insns = 0;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 06/12] tests: tcg: lm32: add more test cases
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (4 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 05/12] target-lm32: don't log cpu state in translation Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 07/12] target-lm32: fix cmpgui and cmpgeui opcodes Michael Walle
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Esp. for testing zero/sign extend in compare operations.
Signed-off-by: Michael Walle <michael@walle.cc>
---
tests/tcg/lm32/test_cmpgei.S | 15 +++++++++++++++
tests/tcg/lm32/test_cmpgeui.S | 15 +++++++++++++++
tests/tcg/lm32/test_cmpgi.S | 15 +++++++++++++++
tests/tcg/lm32/test_cmpgui.S | 17 ++++++++++++++++-
4 files changed, 61 insertions(+), 1 deletions(-)
diff --git a/tests/tcg/lm32/test_cmpgei.S b/tests/tcg/lm32/test_cmpgei.S
index 6a8870f..6e388a2 100644
--- a/tests/tcg/lm32/test_cmpgei.S
+++ b/tests/tcg/lm32/test_cmpgei.S
@@ -52,4 +52,19 @@ mvi r3, 0
cmpgei r3, r3, 0
check_r3 1
+test_name CMPGEI_11
+mvi r1, 0
+cmpgei r3, r1, -32768
+check_r3 1
+
+test_name CMPGEI_12
+mvi r1, -1
+cmpgei r3, r1, -32768
+check_r3 1
+
+test_name CMPGEI_13
+mvi r1, -32768
+cmpgei r3, r1, -32768
+check_r3 1
+
end
diff --git a/tests/tcg/lm32/test_cmpgeui.S b/tests/tcg/lm32/test_cmpgeui.S
index b9d1755..3866d96 100644
--- a/tests/tcg/lm32/test_cmpgeui.S
+++ b/tests/tcg/lm32/test_cmpgeui.S
@@ -52,4 +52,19 @@ mvi r3, 0
cmpgeui r3, r3, 0
check_r3 1
+test_name CMPGEUI_11
+mvi r1, 0
+cmpgeui r3, r1, 0x8000
+check_r3 0
+
+test_name CMPGEUI_12
+mvi r1, -1
+cmpgeui r3, r1, 0x8000
+check_r3 1
+
+test_name CMPGEUI_13
+ori r1, r0, 0x8000
+cmpgeui r3, r1, 0x8000
+check_r3 1
+
end
diff --git a/tests/tcg/lm32/test_cmpgi.S b/tests/tcg/lm32/test_cmpgi.S
index 1f622d2..21695f9 100644
--- a/tests/tcg/lm32/test_cmpgi.S
+++ b/tests/tcg/lm32/test_cmpgi.S
@@ -52,4 +52,19 @@ mvi r3, 0
cmpgi r3, r3, 0
check_r3 0
+test_name CMPGI_11
+mvi r1, 0
+cmpgi r3, r1, -32768
+check_r3 1
+
+test_name CMPGI_12
+mvi r1, -1
+cmpgi r3, r1, -32768
+check_r3 1
+
+test_name CMPGI_13
+mvi r1, -32768
+cmpgi r3, r1, -32768
+check_r3 0
+
end
diff --git a/tests/tcg/lm32/test_cmpgui.S b/tests/tcg/lm32/test_cmpgui.S
index 759bb64..dd94001 100644
--- a/tests/tcg/lm32/test_cmpgui.S
+++ b/tests/tcg/lm32/test_cmpgui.S
@@ -35,7 +35,7 @@ check_r3 1
test_name CMPGUI_7
mvi r1, -1
cmpgui r3, r1, 0xffff
-check_r3 0
+check_r3 1
test_name CMPGUI_8
mvi r3, 0
@@ -52,4 +52,19 @@ mvi r3, 0
cmpgui r3, r3, 0
check_r3 0
+test_name CMPGUI_11
+mvi r1, 0
+cmpgui r3, r1, 0x8000
+check_r3 0
+
+test_name CMPGUI_12
+mvi r1, -1
+cmpgui r3, r1, 0x8000
+check_r3 1
+
+test_name CMPGUI_13
+ori r1, r0, 0x8000
+cmpgui r3, r1, 0x8000
+check_r3 0
+
end
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 07/12] target-lm32: fix cmpgui and cmpgeui opcodes
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (5 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 06/12] tests: tcg: lm32: add more test cases Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 08/12] target-lm32: remove dead code Michael Walle
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
For unsigned compares the immediate has to be zero extended.
Signed-off-by: Michael Walle <michael@walle.cc>
---
target-lm32/translate.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index f51ffc5..e885bb3 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -324,10 +324,20 @@ static inline void gen_compare(DisasContext *dc, int cond)
int rX = (dc->format == OP_FMT_RR) ? dc->r2 : dc->r1;
int rY = (dc->format == OP_FMT_RR) ? dc->r0 : dc->r0;
int rZ = (dc->format == OP_FMT_RR) ? dc->r1 : -1;
+ int i;
if (dc->format == OP_FMT_RI) {
- tcg_gen_setcondi_tl(cond, cpu_R[rX], cpu_R[rY],
- sign_extend(dc->imm16, 16));
+ switch (cond) {
+ case TCG_COND_GEU:
+ case TCG_COND_GTU:
+ i = zero_extend(dc->imm16, 16);
+ break;
+ default:
+ i = sign_extend(dc->imm16, 16);
+ break;
+ }
+
+ tcg_gen_setcondi_tl(cond, cpu_R[rX], cpu_R[rY], i);
} else {
tcg_gen_setcond_tl(cond, cpu_R[rX], cpu_R[rY], cpu_R[rZ]);
}
@@ -373,7 +383,7 @@ static void dec_cmpgeu(DisasContext *dc)
{
if (dc->format == OP_FMT_RI) {
LOG_DIS("cmpgeui r%d, r%d, %d\n", dc->r0, dc->r1,
- sign_extend(dc->imm16, 16));
+ zero_extend(dc->imm16, 16));
} else {
LOG_DIS("cmpgeu r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
}
@@ -385,7 +395,7 @@ static void dec_cmpgu(DisasContext *dc)
{
if (dc->format == OP_FMT_RI) {
LOG_DIS("cmpgui r%d, r%d, %d\n", dc->r0, dc->r1,
- sign_extend(dc->imm16, 16));
+ zero_extend(dc->imm16, 16));
} else {
LOG_DIS("cmpgu r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 08/12] target-lm32: remove dead code
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (6 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 07/12] target-lm32: fix cmpgui and cmpgeui opcodes Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 09/12] target-lm32: flush tlb after clearing env Michael Walle
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Signed-off-by: Michael Walle <michael@walle.cc>
---
target-lm32/cpu.h | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/target-lm32/cpu.h b/target-lm32/cpu.h
index 6948d0e..03db008 100644
--- a/target-lm32/cpu.h
+++ b/target-lm32/cpu.h
@@ -232,18 +232,8 @@ static inline void cpu_set_tls(CPULM32State *env, target_ulong newtls)
{
}
-static inline int cpu_interrupts_enabled(CPULM32State *env)
-{
- return env->ie & IE_IE;
-}
-
#include "exec/cpu-all.h"
-static inline target_ulong cpu_get_pc(CPULM32State *env)
-{
- return env->pc;
-}
-
static inline void cpu_get_tb_cpu_state(CPULM32State *env, target_ulong *pc,
target_ulong *cs_base, int *flags)
{
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 09/12] target-lm32: flush tlb after clearing env
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (7 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 08/12] target-lm32: remove dead code Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 10/12] target-lm32: use HELPER() macro Michael Walle
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
The tlb data is stored within the CPU env. Therefore, the initialization
has to be done after we clear the environment. Otherwise the tlb will have
a valid entry for address 0x0.
Signed-off-by: Michael Walle <michael@walle.cc>
---
target-lm32/cpu.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c
index a2badb5..5e1ab80 100644
--- a/target-lm32/cpu.c
+++ b/target-lm32/cpu.c
@@ -36,10 +36,10 @@ static void lm32_cpu_reset(CPUState *s)
lcc->parent_reset(s);
- tlb_flush(env, 1);
-
/* reset cpu state */
memset(env, 0, offsetof(CPULM32State, breakpoints));
+
+ tlb_flush(env, 1);
}
static void lm32_cpu_realizefn(DeviceState *dev, Error **errp)
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 10/12] target-lm32: use HELPER() macro
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (8 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 09/12] target-lm32: flush tlb after clearing env Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 11/12] configure: proper OpenGL/GLX probe Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 12/12] configure: rename OpenGL feature to GLX Michael Walle
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Instead of hardcoding the function name, use the HELPER() macro for this.
Signed-off-by: Michael Walle <michael@walle.cc>
---
target-lm32/op_helper.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/target-lm32/op_helper.c b/target-lm32/op_helper.c
index 53410b1..ab249e1 100644
--- a/target-lm32/op_helper.c
+++ b/target-lm32/op_helper.c
@@ -17,55 +17,55 @@
#define SHIFT 3
#include "exec/softmmu_template.h"
-void helper_raise_exception(CPULM32State *env, uint32_t index)
+void HELPER(raise_exception)(CPULM32State *env, uint32_t index)
{
env->exception_index = index;
cpu_loop_exit(env);
}
-void helper_hlt(CPULM32State *env)
+void HELPER(hlt)(CPULM32State *env)
{
env->halted = 1;
env->exception_index = EXCP_HLT;
cpu_loop_exit(env);
}
-void helper_wcsr_im(CPULM32State *env, uint32_t im)
+void HELPER(wcsr_im)(CPULM32State *env, uint32_t im)
{
lm32_pic_set_im(env->pic_state, im);
}
-void helper_wcsr_ip(CPULM32State *env, uint32_t im)
+void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im)
{
lm32_pic_set_ip(env->pic_state, im);
}
-void helper_wcsr_jtx(CPULM32State *env, uint32_t jtx)
+void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)
{
lm32_juart_set_jtx(env->juart_state, jtx);
}
-void helper_wcsr_jrx(CPULM32State *env, uint32_t jrx)
+void HELPER(wcsr_jrx)(CPULM32State *env, uint32_t jrx)
{
lm32_juart_set_jrx(env->juart_state, jrx);
}
-uint32_t helper_rcsr_im(CPULM32State *env)
+uint32_t HELPER(rcsr_im)(CPULM32State *env)
{
return lm32_pic_get_im(env->pic_state);
}
-uint32_t helper_rcsr_ip(CPULM32State *env)
+uint32_t HELPER(rcsr_ip)(CPULM32State *env)
{
return lm32_pic_get_ip(env->pic_state);
}
-uint32_t helper_rcsr_jtx(CPULM32State *env)
+uint32_t HELPER(rcsr_jtx)(CPULM32State *env)
{
return lm32_juart_get_jtx(env->juart_state);
}
-uint32_t helper_rcsr_jrx(CPULM32State *env)
+uint32_t HELPER(rcsr_jrx)(CPULM32State *env)
{
return lm32_juart_get_jrx(env->juart_state);
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 11/12] configure: proper OpenGL/GLX probe
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (9 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 10/12] target-lm32: use HELPER() macro Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 12/12] configure: rename OpenGL feature to GLX Michael Walle
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
Probe for GL and GLX symbols and X11 library. This fixes a build error
where the header files are available but the libraries are not.
Signed-off-by: Michael Walle <michael@walle.cc>
---
configure | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 2f98c5a..4f0d011 100755
--- a/configure
+++ b/configure
@@ -2437,9 +2437,9 @@ if test "$opengl" != "no" ; then
#include <X11/Xlib.h>
#include <GL/gl.h>
#include <GL/glx.h>
-int main(void) { return GL_VERSION != 0; }
+int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
EOF
- if compile_prog "" "-lGL" ; then
+ if compile_prog "" "-lGL -lX11" ; then
opengl=yes
else
if test "$opengl" = "yes" ; then
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 12/12] configure: rename OpenGL feature to GLX
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
` (10 preceding siblings ...)
2013-03-06 22:00 ` [Qemu-devel] [PATCH 11/12] configure: proper OpenGL/GLX probe Michael Walle
@ 2013-03-06 22:00 ` Michael Walle
11 siblings, 0 replies; 13+ messages in thread
From: Michael Walle @ 2013-03-06 22:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Walle
As the probe now actually checks for the availability of GLX, rename it
accordingly. The only user of this feature is the milkymist-tmu2 model.
Signed-off-by: Michael Walle <michael@walle.cc>
---
configure | 30 +++++++++++++++---------------
hw/lm32/Makefile.objs | 2 +-
hw/milkymist-hw.h | 4 ++--
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index 4f0d011..f0c73da 100755
--- a/configure
+++ b/configure
@@ -217,7 +217,7 @@ spice=""
rbd=""
smartcard_nss=""
usb_redir=""
-opengl=""
+glx=""
zlib="yes"
guest_agent="yes"
want_tools="yes"
@@ -857,9 +857,9 @@ for opt do
;;
--enable-vhost-net) vhost_net="yes"
;;
- --disable-opengl) opengl="no"
+ --disable-glx) glx="no"
;;
- --enable-opengl) opengl="yes"
+ --enable-glx) glx="yes"
;;
--disable-rbd) rbd="no"
;;
@@ -2430,9 +2430,9 @@ EOF
fi
##########################################
-# opengl probe, used by milkymist-tmu2
-if test "$opengl" != "no" ; then
- opengl_libs="-lGL -lX11"
+# GLX probe, used by milkymist-tmu2
+if test "$glx" != "no" ; then
+ glx_libs="-lGL -lX11"
cat > $TMPC << EOF
#include <X11/Xlib.h>
#include <GL/gl.h>
@@ -2440,13 +2440,13 @@ if test "$opengl" != "no" ; then
int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
EOF
if compile_prog "" "-lGL -lX11" ; then
- opengl=yes
+ glx=yes
else
- if test "$opengl" = "yes" ; then
- feature_not_found "opengl"
+ if test "$glx" = "yes" ; then
+ feature_not_found "glx"
fi
- opengl_libs=
- opengl=no
+ glx_libs=
+ glx=no
fi
fi
@@ -3404,7 +3404,7 @@ echo "rbd support $rbd"
echo "xfsctl support $xfs"
echo "nss used $smartcard_nss"
echo "usb net redir $usb_redir"
-echo "OpenGL support $opengl"
+echo "GLX support $glx"
echo "libiscsi support $libiscsi"
echo "build guest agent $guest_agent"
echo "seccomp support $seccomp"
@@ -3711,8 +3711,8 @@ if test "$usb_redir" = "yes" ; then
echo "CONFIG_USB_REDIR=y" >> $config_host_mak
fi
-if test "$opengl" = "yes" ; then
- echo "CONFIG_OPENGL=y" >> $config_host_mak
+if test "$glx" = "yes" ; then
+ echo "CONFIG_GLX=y" >> $config_host_mak
fi
if test "$libiscsi" = "yes" ; then
@@ -3991,7 +3991,7 @@ case "$target_arch2" in
target_nptl="yes"
;;
lm32)
- target_libs_softmmu="$opengl_libs"
+ target_libs_softmmu="$glx_libs"
;;
m68k)
bflt="yes"
diff --git a/hw/lm32/Makefile.objs b/hw/lm32/Makefile.objs
index 4e1843c..c813eb2 100644
--- a/hw/lm32/Makefile.objs
+++ b/hw/lm32/Makefile.objs
@@ -15,7 +15,7 @@ obj-y += milkymist-minimac2.o
obj-y += milkymist-pfpu.o
obj-y += milkymist-softusb.o
obj-y += milkymist-sysctl.o
-obj-$(CONFIG_OPENGL) += milkymist-tmu2.o
+obj-$(CONFIG_GLX) += milkymist-tmu2.o
obj-y += milkymist-uart.o
obj-y += milkymist-vgafb.o
obj-y += framebuffer.o
diff --git a/hw/milkymist-hw.h b/hw/milkymist-hw.h
index c8bd7e9..e6a081e 100644
--- a/hw/milkymist-hw.h
+++ b/hw/milkymist-hw.h
@@ -87,7 +87,7 @@ static inline DeviceState *milkymist_pfpu_create(hwaddr base,
return dev;
}
-#ifdef CONFIG_OPENGL
+#ifdef CONFIG_GLX
#include <X11/Xlib.h>
#include <GL/glx.h>
static const int glx_fbconfig_attr[] = {
@@ -101,7 +101,7 @@ static const int glx_fbconfig_attr[] = {
static inline DeviceState *milkymist_tmu2_create(hwaddr base,
qemu_irq irq)
{
-#ifdef CONFIG_OPENGL
+#ifdef CONFIG_GLX
DeviceState *dev;
Display *d;
GLXFBConfig *configs;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2013-03-06 22:01 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06 21:59 [Qemu-devel] [PATCH 00/12] target-lm32: various fixes Michael Walle
2013-03-06 21:59 ` [Qemu-devel] [PATCH 01/12] target-lm32: fix debug memory access Michael Walle
2013-03-06 21:59 ` [Qemu-devel] [PATCH 02/12] lm32-dis: fix NULL pointer dereference Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 03/12] milkymist-uart: fix receive buffering Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 04/12] lm32_uart: " Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 05/12] target-lm32: don't log cpu state in translation Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 06/12] tests: tcg: lm32: add more test cases Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 07/12] target-lm32: fix cmpgui and cmpgeui opcodes Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 08/12] target-lm32: remove dead code Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 09/12] target-lm32: flush tlb after clearing env Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 10/12] target-lm32: use HELPER() macro Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 11/12] configure: proper OpenGL/GLX probe Michael Walle
2013-03-06 22:00 ` [Qemu-devel] [PATCH 12/12] configure: rename OpenGL feature to GLX Michael Walle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).