qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/6] Improved comments on m68k_move_to/from help


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH 3/6] Improved comments on m68k_move_to/from helpers
Date: Tue, 2 Jul 2019 11:44:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

Le 16/06/2019 à 16:22, Lucien Murray-Pitts a écrit :
> Added more detailed comments to each case of m68k_move_to/from helpers to list
> the supported CPUs for that CR as they were wrong in some cases, and
> missing some cpu classes in other cases.
> 
> Signed-off-by: Lucien Murray-Pitts <address@hidden>
> ---
>  target/m68k/helper.c | 41 +++++++++++++++++++++++++++++++----------
>  1 file changed, 31 insertions(+), 10 deletions(-)
> 
> diff --git a/target/m68k/helper.c b/target/m68k/helper.c
> index b0bb579403..5483ce9837 100644
> --- a/target/m68k/helper.c
> +++ b/target/m68k/helper.c

I think it would be good to add references:

/* M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL
 * 1.3 SUPERVISOR PROGRAMMING MODEL
 * Table 1-1. Supervisor Registers
 *            Not Related To Paged Memory Managem
 * Table 1-2. Supervisor Registers
 *            Related To Paged Memory Management
 */

and a summary is in the movec instruction description of the same manual

/* MOVEC Move Control Register
 *      (MC68010, MC68020, MC68030, MC68040, CPU32)
*/

> @@ -197,40 +197,47 @@ void HELPER(m68k_movec_to)(CPUM68KState *env, uint32_t 
> reg, uint32_t val)
>      M68kCPU *cpu = m68k_env_get_cpu(env);
>  
>      switch (reg) {
> -    /* MC680[1234]0 */
> +    /* MC680[12346]0 */
>      case M68K_CR_SFC:
>          env->sfc = val & 7;
>          return;
> +    /* MC680[12346]0 */
>      case M68K_CR_DFC:
>          env->dfc = val & 7;
>          return;
> +    /* MC680[12346]0 */
>      case M68K_CR_VBR:
>          env->vbr = val;
>          return;
> -    /* MC680[234]0 */
> +    /* MC680[2346]0 */
>      case M68K_CR_CACR:
>          env->cacr = val;
>          m68k_switch_sp(env);
>          return;
> -    /* MC680[34]0 */
> +    /* MC680[46]0 */

030 uses pmove to manage MMU registers (SRP, CRP, TC MMUSR and ACUSR).
For the moment, I have only implemented the 040 MMU, that's why the
instructions is not implemented.

>      case M68K_CR_TC:
>          env->mmu.tcr = val;
>          return;
> +    /* MC680[4]0 */
>      case M68K_CR_MMUSR:
>          env->mmu.mmusr = val;
>          return;
> +    /* MC680[46]0 */
>      case M68K_CR_SRP:
>          env->mmu.srp = val;
>          return;
>      case M68K_CR_URP:
>          env->mmu.urp = val;
>          return;
> +    /* MC680[46]0 */
>      case M68K_CR_USP:
>          env->sp[M68K_USP] = val;
>          return;
> +    /* MC680[234]0 */
>      case M68K_CR_MSP:
>          env->sp[M68K_SSP] = val;
>          return;
> +    /* MC680[234]0 */
>      case M68K_CR_ISP:
>          env->sp[M68K_ISP] = val;
>          return;
...

Thanks,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]