Statistics
| Branch: | Revision:

root / target-xtensa / cpu.h @ feature-archipelago

History | View | Annotate | Download (14.2 kB)

# Date Author Comment
604e1f9c 02/24/2014 02:47 am Max Filippov

target-xtensa: provide HW confg ID registers

Signed-off-by: Max Filippov <>

a00817cc 07/29/2013 05:35 pm Max Filippov

target-xtensa: avoid double-stopping at breakpoints

env->exception_taken is set every time an exception is taken. It is used
to allow single-stepping to stop at the first exception handler
instruction. This however must exclude debug exceptions, as otherwise...

bdf7ae5b 07/23/2013 03:41 am Andreas Färber

cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()

Where no extra implementation is needed, fall back to CPUClass::set_pc().

Acked-by: Michael Walle <> (for lm32)
Signed-off-by: Andreas Färber <>

97a8ea5a 03/12/2013 11:35 am Andreas Färber

cpu: Replace do_interrupt() by CPUClass::do_interrupt method

This removes a global per-target function and thus takes us one step
closer to compiling multiple targets into one executable.

It will also allow to override the interrupt handling for certain CPU...

25733ead 02/16/2013 03:50 pm Andreas Färber

target-xtensa: Move TCG initialization to XtensaCPU initfn

Combine this with breakpoint handler registration, guarding both with
tcg_enabled() to suppress also TCG init for qtest. Rename the handler to
xtensa_breakpoint_handler() since it needs to become global....

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

fcc803d1 12/08/2012 08:48 pm Max Filippov

target-xtensa: implement ATOMCTL SR

ATOMCTL SR controls s32c1i opcode behavior depending on targeted memory
type. See ISA, 4.3.12.4 for details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

4e41d2f5 12/08/2012 08:48 pm Max Filippov

target-xtensa: implement CACHEATTR SR

In XEA1, the Options for Memory Protection and Translation and the
corresponding TLB management instructions are not available. Instead,
functionality similar to the Region Protection Option is available
through the cache attribute register. See ISA, A.2.14 for details....

fe0bd475 12/08/2012 08:48 pm Max Filippov

target-xtensa: restrict available SRs by enabled options

Beginning with the RA-2004.1 release, SR access instructions (rsr, wsr,
xsr) are associated with their corresponding SR and raise illegal opcode
exception in case the register is not configured for the core....

b7909d81 12/08/2012 08:48 pm Max Filippov

target-xtensa: implement MISC SR

The Miscellaneous Special Registers Option provides zero to four scratch
registers within the processor readable and writable by RSR, WSR, and
XSR. These registers are privileged. They may be useful for some
application-specific exception and interrupt processing tasks in the...

3993c6bd 10/31/2012 05:11 am Andreas Färber

cpus: Pass CPUState to [qemu_]cpu_has_work()

For target-mips also change the return type to bool.

Make include paths for cpu-qom.h consistent for alpha and unicore32.

Signed-off-by: Andreas Färber <>
[AF: Updated new target-openrisc function accordingly]...

ef04a846 09/22/2012 08:59 pm Max Filippov

target-xtensa: implement coprocessor context option

In case Coprocessor Context option is enabled CPENABLE SR bits control
whether access to coprocessors is allowed or would rise one of
CoprocessorXDisabled exceptions.

See ISA, 4.4.5 for more details.

FP is coprocessor 0....

dd519cbe 09/22/2012 08:59 pm Max Filippov

target-xtensa: add FP registers

There are 16 32-bit FP registers (f0 - f15), control and status user
registers (fcr, fsr).

See ISA, 4.3.10 for more details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

e38077ff 08/09/2012 09:37 pm Max Filippov

target-xtensa: make default CPU depend on target endianness

This makes usable default for -cpu option both for qemu-system-xtensa
and qemu-system-xtensaeb fixing the following error:

$ qemu-system-xtensaeb -M sim
Unable to find CPU definition

Signed-off-by: Max Filippov <>...

16bde77a 06/09/2012 01:45 pm Max Filippov

target-xtensa: extract TLB entry setting method

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

ae4e7982 06/09/2012 01:45 pm Max Filippov

target-xtensa: update autorefill TLB entries conditionally

This is to avoid interference of internal QEMU helpers
(cpu_get_phys_page_debug, tb_invalidate_virtual_addr) with guest-visible
TLB state.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

15be3171 06/05/2012 12:00 am Andreas Färber

target-xtensa: Let cpu_xtensa_init() return XtensaCPU

Make the include paths for cpu-qom.h consistent to allow using XtensaCPU
in cpu.h.

Turn cpu_init macro into a static inline function returning
CPUXtensaState for backwards compatibility.

Signed-off-by: Andreas Färber <>...

a4633e16 04/14/2012 02:48 am Andreas Färber

target-xtensa: QOM'ify CPU

Embed CPUXtensaState as first member of XtensaCPU.
Let CPUClass::reset() call cpu_state_reset() for now.

Signed-off-by: Andreas Färber <>
Signed-off-by: Max Filippov <>

5087a72c 04/14/2012 02:48 am Andreas Färber

target-xtensa: QOM'ify CPU reset

Move code from cpu_state_reset() into QOM xtensa_cpu_reset().
To avoid moving reset_mmu() and dependencies, make it non-static.

Signed-off-by: Andreas Färber <>
Signed-off-by: Max Filippov <>

9349b4f9 03/14/2012 11:20 pm Andreas Färber

Rename CPUState -> CPUArchState

Scripted conversion:
for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do
sed -i "s/CPUState/CPUArchState/g" $file
done...

97129ac8 03/14/2012 11:20 pm Andreas Färber

target-xtensa: Don't overuse CPUState

Scripted conversion:
sed -i "s/CPUState/CPUXtensaState/g" target-xtensa/*.[hc]
sed -i "s/#define CPUXtensaState/#define CPUState/" target-xtensa/cpu.h

Signed-off-by: Andreas Färber <>
Acked-by: Anthony Liguori <>

f14c4b5f 02/20/2012 06:07 pm Max Filippov

target-xtensa: add DBREAK data breakpoints

Add DBREAKA/DBREAKC SRs and implement DBREAK breakpoints as debug
watchpoints.

This implementation is not fully compliant to ISA: when a breakpoint is
set to an unmapped/inaccessible memory address it generates TLB/memory...

35b5c044 02/18/2012 12:55 pm Max Filippov

target-xtensa: add ICOUNT SR and debug exception

ICOUNT SR gets incremented on every instruction completion provided that
CINTLEVEL at the beginning of the instruction execution is lower than
ICOUNTLEVEL.

When ICOUNT would increment to 0 a debug exception is raised if...

ab58c5b4 02/18/2012 12:55 pm Max Filippov

target-xtensa: add DEBUGCAUSE SR and configuration

DEBUGCAUSE SR holds information about the most recent debug exception.
See ISA, 4.7.7 for more details.

Signed-off-by: Max Filippov <>

e61dc8f7 02/18/2012 12:55 pm Max Filippov

target-xtensa: implement instruction breakpoints

Add IBREAKA/IBREAKENABLE SRs and implement debug exception, BREAK and
BREAK.N instructions and IBREAK breakpoints.

IBREAK breakpoint address is considered constant for TB lifetime.
On IBREAKA/IBREAKENABLE change corresponding TBs are invalidated....

692f737c 02/17/2012 11:25 pm Max Filippov

target-xtensa: implement info tlb monitor command

Command dumps valid ITLB and DTLB entries.

Signed-off-by: Max Filippov <>

ac8b7db4 10/16/2011 01:39 pm Max Filippov

target-xtensa: extract core configuration from overlay

Introduce overlay_tool.h that defines core configuration blocks from
data available in the linux architecture variant overlay.

Overlay data is automatically generated in the core configuration
process by Tensilica tools and can be directly converted to qemu xtensa...

b8929a54 10/16/2011 01:39 pm Max Filippov

target-xtensa: implement external interrupt mapping

Xtensa cores may have different mapping of external interrupt pins to
internal IRQ numers. Implement API to acquire core IRQ by its external
interrupt number.

Signed-off-by: Max Filippov <>...

7f65f4b0 10/16/2011 01:39 pm Max Filippov

target-xtensa: increase xtensa options accuracy

- add separate options for each operation in the MISC_OP;
- add an option for MULSH/MULUH;
- put S32C1I under conditional store option.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

6825b6c3 10/16/2011 12:03 am Max Filippov

target-xtensa: implement MAC16 option

See ISA, 4.3.7 for the details.

- add ACC and MR special registers;
- implement MAC16 and all inner MAC* opcode groups.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

890c6333 10/16/2011 12:03 am Max Filippov

target-xtensa: fix guest hang on masked CCOMPARE interrupt

QEMU timer is used to post CCOMPARE interrupt when the core is halted.
If that CCOMPARE interrupt is masked off then the timer must be rearmed
in the callback, otherwise it will be rearmed next time the core goes to...

97836cee 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement relocatable vectors

See ISA, 4.4.3 for details.

Vector addresses recorded in core configuration are absolute values that
correspond to default VECBASE value.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

ccfcaba6 09/10/2011 07:57 pm Max Filippov

target-xtensa: add gdb support

Specific xtensa processor overlay for GDB contains register map in
the gdb/xtensa-config.c. This description is used by the GDB to e.g.
parse 'g' response packets and it may be reused in the qemu's gdbstub
(only XTREG definitions for non-pseudoregisters are needed)....

b67ea0cd 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement memory protection options

- TLB opcode group;
- region protection option (ISA, 4.6.3);
- region translation option (ISA, 4.6.4);
- MMU option (ISA, 4.6.5).

Cache control attribute bits are not used by this implementation.

Signed-off-by: Max Filippov <>...

4dd85b6b 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement boolean option

See ISA, 4.3.9

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

553e44f9 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement windowed registers

See ISA, 4.7.1 for details.

Physical registers and currently visible window are separate fields in
CPUEnv. Only current window is accessible to TCG. On operations that
change window base helpers copy current window to and from physical...

797d780b 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement loop option

See ISA, 4.3.2 for details.

Operations that change LEND SR value invalidate TBs at the old and at
the new LEND. LEND value at TB compilation time is considered constant
and loop instruction is generated based on this value....

6ad6dbf7 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement extended L32R

See ISA, 4.3.3 for details.

TB flag XTENSA_TBFLAG_LITBASE is used to track enable bit of LITBASE SR.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

b994e91b 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement interrupt option

See ISA, 4.4.6 (interrupt option), 4.4.7 (high priority interrupt
option) and 4.4.8 (timer interrupt option) for details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

f3df4c04 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement CPENABLE and PRID SRs

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

3580ecad 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement shifts (ST1 and RST1 groups)

- ST1: SAR (shift amount special register) manipulation, NSA;
- RST1: shifts, 16-bit multiplication.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

809377aa 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement LSAI group

- base + offset load/store operations for 1/2/4 byte values;
- cache operations (not implemented);
- multiprocessor synchronization operations.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

f0a548b9 09/10/2011 07:57 pm Max Filippov

target-xtensa: add PS register and access control

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

40643d7c 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement exceptions

- mark privileged opcodes with ring check;
- make debug exception on exception handler entry.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

2af3da91 09/10/2011 07:57 pm Max Filippov

target-xtensa: add special and user registers

Special Registers hold the majority of the state added to the processor
by the options. See ISA, 5.3 for details.

User Registers hold state added in support of designer's TIE and in some
cases of options that Tensilica provides. See ISA, 5.4 for details....

2328826b 09/10/2011 07:57 pm Max Filippov

target-xtensa: add target stubs

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

dedc5eae 09/10/2011 07:57 pm Max Filippov

target-xtensa: implement disas_xtensa_insn

Set up disas_xtensa_insn switch structure, mark required options on high
level groups. Implement arithmetic/bit logic/jump/call0.

Implement code generation loop with single step/breakpoint checking.

Signed-off-by: Max Filippov <>...