Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: "Asgari J. Jinia" <AsgariJ@KPITCummins.com>
Cc: gdb-patches@sources.redhat.com, kazu@cs.umass.edu,
	dvenkat@noida.hcltech.com
Subject: Re: [PATCH-H8300] TRAPA instruction handling
Date: Thu, 15 Apr 2004 20:45:00 -0000	[thread overview]
Message-ID: <407EF462.1010001@redhat.com> (raw)
In-Reply-To: <69595093233BB547BB70CF5E492B63F204A8FBD9@sohm.kpit.com>

Asgari J. Jinia wrote:
> Hi,
> 
> In h8300 simulator, stack handling of TRAPA instruction is not
> as per hardware manual. Presently it takes 12 bytes to store
> CCR,PC and EXR registers on stack but it should do it with 6
> bytes. Also simulation of @aa:8 addressing is broken as SBR
> register is initialized to zero after initialized with 0xFFFFFF00.
> 
> Following patch does proper stack and @aa:8 handling.
> 
> Regards,
> Asgari Jinia

The implementation's good, but I can't comment on the technical 
correctness.  Adding Kazu and Venkat to Cc: in case they can.

Michael


> ---------------------------------------------------------------------
> 
> ChangeLog
> sim/h8300
> 
> 2004-04-13  Asgari Jinia  <asgarij@kpitcummins.com>
> 
> 	* compile.c (sim_resume): updated stack for TRAPA as per
> 	hardware manual.
> 	(init_pointers): Initialization of h8_get_reg_buf removed as it
> 	corrupts SBR_REGNUM register, initialized in sim_state_initialize 
> 	function.
> 
> 
> 
> --- sim/h8300/compile.old.c	2004-01-06 06:28:48.000000000 +0530
> +++ sim/h8300/compile.c	2004-04-13 14:31:43.000000000 +0530
> @@ -1808,7 +1808,6 @@ init_pointers (SIM_DESC sd)
>  
>        h8_set_mask (sd, memory_size - 1);
>  
> -      memset (h8_get_reg_buf (sd), 0, sizeof (((STATE_CPU (sd, 0))->regs)));
>  
>        for (i = 0; i < 8; i++)
>  	{
> @@ -3584,14 +3583,13 @@ sim_resume (SIM_DESC sd, int step, int s
>  
>  	  if (h8300smode)			/* pop exr */
>  	    {
> -	      h8_set_exr (sd, GET_MEMORY_L (tmp));
> -	      tmp += 4;
> +	      h8_set_exr (sd, GET_MEMORY_W (tmp));
> +	      tmp += 2;
>  	    }
>  	  if (h8300hmode && !h8300_normal_mode)
>  	    {
> -	      h8_set_ccr (sd, GET_MEMORY_L (tmp));
> -	      tmp += 4;
> -	      pc = GET_MEMORY_L (tmp);
> +	      h8_set_ccr (sd, (GET_MEMORY_L (tmp) >> 24));
> +	      pc = GET_MEMORY_L (tmp) & 0x00FFFFFF;
>  	      tmp += 4;
>  	    }
>  	  else
> @@ -3671,17 +3669,16 @@ sim_resume (SIM_DESC sd, int step, int s
>     	  else
>     	    {
>     	      tmp -= 4;
> -   	      SET_MEMORY_L (tmp, code->next_pc);
> -   	      tmp -= 4;
> -   	      SET_MEMORY_L (tmp, h8_get_ccr (sd));
> +   	      SET_MEMORY_L (tmp, (code->next_pc & 0x00FFFFFF)+
> +   	                    ((tmp, h8_get_ccr (sd))<<24));
>     	    }
>     	  intMaskBit = 1;
>     	  BUILDSR (sd);
>   
>  	  if (h8300smode)
>  	    {
> -	      tmp -= 4;
> -	      SET_MEMORY_L (tmp, h8_get_exr (sd));
> +	      tmp -= 2;
> +	      SET_MEMORY_W (tmp, h8_get_exr (sd));
>  	    }
>  
>  	  h8_set_reg (sd, SP_REGNUM, tmp);
> 



      reply	other threads:[~2004-04-15 20:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 10:06 Asgari J. Jinia
2004-04-15 20:45 ` Michael Snyder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=407EF462.1010001@redhat.com \
    --to=msnyder@redhat.com \
    --cc=AsgariJ@KPITCummins.com \
    --cc=dvenkat@noida.hcltech.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kazu@cs.umass.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox