| Branch: | Revision:

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

History | View | Annotate | Download (11.7 kB)

# Date Author Comment
21c04611 12/09/2013 05:41 pm Bobby Bingham

target-sh4: move features flag after CPU_COMMON

Everything before CPU_COMMON in the structure is cleared as part of a
CPU reset. This included the features flag, which indicates whether SH4A
instructions are supported or not. As a result, a CPU reset downgraded...

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 <>

6291ad77 07/09/2013 10:20 pm Peter Maydell

linux-user: Move cpu_clone_regs() and cpu_set_tls() into linux-user

The functions cpu_clone_regs() and cpu_set_tls() are not purely CPU
related -- they are specific to the TLS ABI for a a particular OS.
Move them into the linux-user/ tree where they belong....

259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

Both fields are used in VMState, thus need to be moved together.
Explicitly zero them on reset since they were located before

Pass PowerPCCPU to kvmppc_handle_halt().

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...

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

target-sh4: Move PVR/PRR/CVR into SuperHCPUClass

They are never changed once initialized, and moving them to the class
will allow to inspect them before instantiating.

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

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

target-sh4: Move TCG initialization to SuperHCPU initfn

Add a tcg_enabled() check to suppress it for qtest.

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

6b4c305c 12/19/2012 09:32 am Paolo Bonzini

fpu: move public header file to include/fpu

Signed-off-by: Paolo Bonzini <>

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

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

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]...

a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific). Replace it with a finger-friendly,...

445e9571 06/05/2012 12:00 am Andreas Färber

target-sh4: Let cpu_sh4_init() return SuperHCPU

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

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

339894be 04/30/2012 12:32 pm Andreas Färber

target-sh4: QOM'ify CPU

Embed CPUSH4State as first member of SuperHCPU.

Let CPUClass::reset() call cpu_state_reset() for now.

Signed-off-by: Andreas Färber <>
Reviewed-by: Peter Maydell <>

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

73e5716c 03/14/2012 11:20 pm Andreas Färber

target-sh4: Don't overuse CPUState

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

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

97b348e7 08/07/2011 12:32 pm Blue Swirl

Remove unused is_softmmu parameter from cpu_handle_mmu_fault

Parameter is_softmmu (and its evil mutant twin brother is_softmuu)
is not used in cpu_*_handle_mmu_fault() functions, remove them
and adjust callers.

Acked-by: Richard Henderson <>...

f081c76c 06/26/2011 09:25 pm Blue Swirl

Move cpu_has_work and cpu_pc_from_tb to cpu.h

Move functions cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h. This is
needed by later patches.

Signed-off-by: Blue Swirl <>

efac4154 03/04/2011 12:33 am Aurelien Jarno

target-sh4: move intr_at_halt out of cpu_halted()

All targets except SH4 have the same cpu_halted() routine, and it has
only one caller. It is therefore a good candidate for inlining.

The difference is the handling of the intr_at_halt, which is necessary...

9f97309a 01/26/2011 03:30 pm Aurelien Jarno

sh4: implement missing mmaped TLB write functions

Signed-off-by: Aurelien Jarno <>

bc656a29 01/26/2011 03:30 pm Aurelien Jarno

sh4: implement missing mmaped TLB read functions

Signed-off-by: Aurelien Jarno <>

26ac1ea5 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: define FPSCR constants

Define FPSCR constants for all field and use them instead of hardcoded

Signed-off-by: Aurelien Jarno <>

4f6493ff 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: fix reset on r2d

Signed-off-by: Aurelien Jarno <>

c0f809c4 01/10/2011 12:59 am Aurelien Jarno

target-sh4: implement writes to mmaped ITLB

Some Linux kernels seems to implement ITLB/UTLB flushing through by
writing all TLB entries through the memory mapped interface instead
of writing one to MMUCR.TI.

Implement memory mapped ITLB write interface so that such kernels can...

9a78eead 10/30/2010 11:01 am Stefan Weil

target-xxx: Use fprintf_function (format checking)

fprintf_function uses format checking with GCC_FMT_ATTR.

Format errors were fixed in
  • target-i386/helper.c
  • target-mips/translate.c
  • target-ppc/translate.c

Cc: Blue Swirl <>
Signed-off-by: Stefan Weil <>...

a88790a1 07/03/2010 09:48 am Paolo Bonzini

remove exec-all.h inclusion from cpu.h

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

10eb0cc0 07/03/2010 09:48 am Paolo Bonzini

move cpu_pc_from_tb to target-*/exec.h

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Blue Swirl <>

3c7b48b7 03/12/2010 08:44 pm Paul Brook

Target specific usermode cleanup

Disable various target specific code that is only relevant to system emulation.

Signed-off-by: Paul Brook <>

52705890 03/12/2010 06:28 pm Richard Henderson

Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h.

Removes a set of ifdefs from exec.c.

Introduce TARGET_VIRT_ADDR_SPACE_BITS for all targets other
than Alpha. This will be used for page_find_alloc, which is
supposed to be using virtual addresses in the first place....

af090497 02/09/2010 10:08 pm Aurelien Jarno

target-sh4: MMU: reduce the size of a TLB entry

Reduce the size of the TLB entry from 32 to 16 bytes, reorganising
members and using a bit field.

Signed-off-by: Aurelien Jarno <>

e0bcb9ca 02/09/2010 10:07 pm Aurelien Jarno

sh7750: handle MMUCR TI bit

When the MMUCR TI bit is set, all the UTLB and ITLB entries should be

Signed-off-by: Aurelien Jarno <>

c227f099 10/02/2009 12:12 am Anthony Liguori

Revert "Get rid of _t suffix"

In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem. Something
like this must be presented on the list first so people can provide input...

99a0949b 10/01/2009 09:45 pm malc

Get rid of _t suffix

Some not so obvious bits, slirp and Xen were left alone for the time

Signed-off-by: malc <>

0b5c1ce8 08/24/2009 04:21 pm Nathan Froyd

cleanup cpu-exec.c, part 0/N: consolidate handle_cpu_signal

handle_cpu_signal is very nearly copy-paste code for each target, with a
few minor variations. This patch sets up appropriate defaults for a
generic handle_cpu_signal and provides overrides for particular targets...

8167ee88 07/16/2009 11:47 pm Blue Swirl

Update to a hopefully more future proof FSF address

Signed-off-by: Blue Swirl <>

852d481f 04/02/2009 02:10 am edgar_igl

SH: Improve movca.l/ocbi emulation.

Author: Vladimir Prus <>

Fix movcal.l/ocbi emulation.
  • target-sh4/cpu.h (memory_content): New.
    (CPUSH4State): New fields movcal_backup and movcal_backup_tail.
  • target-sh4/helper.h (helper_movcal)...
c2764719 03/07/2009 05:24 pm pbrook

The _exit syscall is used for both thread termination in NPTL applications,
and process termination in legacy applications. Try to guess which we want
based on the presence of multiple threads.

Also implement locking when modifying the CPU list.

Signed-off-by: Paul Brook <>...

ef7ec1c1 03/03/2009 08:12 am aurel32

clean build: Fix remaining sh4 warnings

Signed-off-by: Jan Kiszka <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

66c7c806 03/02/2009 07:13 pm aurel32

SH: Implement MOVCO.L and MOVLI.L

  • target-sh4/cpu.h (struct CPUSH4State): New field ldst.
  • target-sh4/translate.c (cpu_ldst): New.
    (sh4_translate_init): Initialize cpu_ldst.
    (_decode_opc): Support MOVCO.L and MOVLI.L.

(Vladimir Prus)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

c2432a42 02/07/2009 05:18 pm aurel32

SH7750/51: add register BCR3, BCR4, PCR, RTCOR, RTCNT, RTCSR, SDMR2, SDMR3 and fix BCR2 support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

fad6cb1a 01/05/2009 12:05 am aurel32

Update FSF address in GPL/LGPL boilerplate

The attached patch updates the FSF address in the GPL/LGPL boilerplate
in most GPL/LGPLed files, and also in COPYING.LIB.

Signed-off-by: Stuart Brady <>
Signed-off-by: Aurelien Jarno <>...

56cd2b96 12/13/2008 09:27 pm aurel32

target-sh4: make the initial value of SR easier to read

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

71968fa6 12/13/2008 08:57 pm aurel32

target-sh4: add prefi, icbi, synco

(Vladimir Prus)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

a9c43f8e 12/13/2008 08:57 pm aurel32

target-sh4: add SH7785 as CPU option

(Vladimir Prus)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

42083220 12/12/2008 12:42 am aurel32

target-sh4: remove 2 warnings

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

d8299bcc 12/08/2008 12:46 am aurel32

SH4: Implement FD bit

SH4 manual say that if a floating point instruction is executed while
FD bit in the status register is 1, an exception should be raised. QEMU
presently does not do that, so the kernel does not initialize FP state
for any thread, nor does it save/restore FP state. The most apparent...

6b917547 11/18/2008 09:46 pm aliguori

Refactor translation block CPU state handling (Jan Kiszka)

This patch refactors the way the CPU state is handled that is associated
with a TB. The basic motivation is to move more arch specific code out
of generic files. Specifically the long #ifdef clutter in tb_find_fast()...

622ed360 11/18/2008 09:36 pm aliguori

Convert CPU_PC_FROM_TB to static inline (Jan Kiszka)

as macros should be avoided when possible.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

0b6d3ae0 09/15/2008 10:43 am aurel32

qemu sh4 nptl support

(Michael Trimarchi)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

0fd3ca30 09/02/2008 07:18 pm aurel32

sh4: CPU versioning.

Trivial patch adding CPU listing and the ability to do per-subtype
CVR/PVR/PRR values. Presently SH7750R and SH7751R definitions are
provided, as these are the ones in present use in-tree.

The CVR value for SH7751R is intentionally restricted so the kernel...

17b086f7 09/02/2008 01:12 am aurel32

SH4: Remove dyngen leftovers

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

29e179bc 08/22/2008 11:57 am aurel32

[sh4] memory mapped TLB entries

SH4 MMU's memory mapped TLB feature is implemented.
SH-Linux seems to write to memory mapped TLB to invalidate a TLB entry,
but does not to read it. So only memory write feature is implemented.
Work on memory read feature is left....

833ed386 08/22/2008 11:57 am aurel32

[sh4] sleep instruction

This patch adds sleep instruction.

(Shin-ichiro KAWASAKI)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

9656f324 07/01/2008 11:01 pm pbrook

Move interrupt_request and user_mode_only to common cpu state.
Save and restore env->interrupt_request and env->halted.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

2e70f6ef 06/29/2008 04:03 am pbrook

Add instruction counter.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

f8ed7070 05/30/2008 08:54 pm pbrook

Fix typo.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

6e68e076 05/30/2008 08:22 pm pbrook

Move clone() register setup to target specific code. Handle fork-like clone.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

9133e39b 05/29/2008 01:08 pm bellard

Push common interrupt variables to cpu-defs.h (Glauber Costa)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

ce5232c5 05/28/2008 08:14 pm bellard

moved halted field to CPU_COMMON

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

ea2b542a 05/09/2008 09:45 pm aurel32

SH4 MMU improvements

(Shin-ichiro KAWASAKI)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

e96e2044 12/02/2007 08:18 am ths

SH4: system emulator interrupt update, by Magnus Damm.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

823029f9 12/02/2007 08:10 am ths

SH4 delay slot code update, by Magnus Damm.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

aaed909a 11/10/2007 05:15 pm bellard

added cpu_model parameter to cpu_init()

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

6ebbf390 10/14/2007 10:07 am j_mayer

Replace is_user variable with mmu_idx in softmmu core,
allowing support of more than 2 mmu access modes.
Add backward compatibility is_user variable in targets code when needed.
Implement per target cpu_mmu_index function, avoiding duplicated code
and #ifdef TARGET_xxx in softmmu core functions....

5fafdf24 09/17/2007 12:08 am ths

find -type f | xargs sed -i 's/[\t ]$//g' # on most files

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

e04ea3dc 06/25/2007 04:53 pm ths

Handle endianness of double floats, by Magnus Damm.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

ea6cf6be 06/22/2007 02:12 pm ths

Emulate more fpu opcodes, by Magnus Damm.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

d10927f8 06/22/2007 01:11 pm ths

Add missing cpu_halted function, by Magnus Damm.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

9467d44c 06/04/2007 12:02 am ths

Move target-specific defines to the target directories.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

5a7b542b 01/31/2007 02:16 pm ths

siginfo fix for Darwin/Mac OS X, by Pierre d'Herbemont.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

9042c0e2 12/23/2006 04:18 pm ths

Check ELF binaries for machine type and endianness.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

9c2a9ea1 06/18/2006 10:12 pm pbrook

SH bugfixes.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

eda9b09b 06/14/2006 06:02 pm bellard

sh4 fmov et al instructions (amatus)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

fdf9b3e8 04/28/2006 12:07 am bellard

sh4 target (Samuel Tardieu)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162