* [PATCH]: SH 2a - Part 3: Bank register handling
@ 2004-09-09 12:44 Corinna Vinschen
2004-10-05 20:09 ` Elena Zannoni
0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2004-09-09 12:44 UTC (permalink / raw)
To: gdb-patches
Hi,
this is SH 2a patch 2. It handles the "bank" pseudo register so
that reading and writing is performed on the correct register set
inside of the register banks.
Corinna
* sh-tdep.c (sh_pseudo_register_read): Add PSEUDO_BANK_REGNUM handling.
(sh_pseudo_register_write): Ditto.
--- sh-tdep.c.2 2004-09-08 18:35:04.000000000 +0200
+++ sh-tdep.c 2004-09-08 18:35:31.000000000 +0200
@@ -1866,6 +1866,9 @@ sh_pseudo_register_read (struct gdbarch
int base_regnum, portion;
char temp_buffer[MAX_REGISTER_SIZE];
+ if (reg_nr == PSEUDO_BANK_REGNUM)
+ regcache_raw_read (regcache, BANK_REGNUM, buffer);
+ else
if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
{
base_regnum = dr_reg_base_num (reg_nr);
@@ -1902,7 +1905,19 @@ sh_pseudo_register_write (struct gdbarch
int base_regnum, portion;
char temp_buffer[MAX_REGISTER_SIZE];
- if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
+ if (reg_nr == PSEUDO_BANK_REGNUM)
+ {
+ /* When the bank register is written to, the whole register bank
+ is switched and all values in the bank registers must be read
+ from the target/sim again. We're just invalidating the regcache
+ so that a re-read happens next time it's necessary. */
+ int bregnum;
+
+ regcache_raw_write (regcache, BANK_REGNUM, buffer);
+ for (bregnum = R0_BANK0_REGNUM; bregnum < MACLB_REGNUM; ++bregnum)
+ set_register_cached (bregnum, 0);
+ }
+ else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
{
base_regnum = dr_reg_base_num (reg_nr);
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH]: SH 2a - Part 3: Bank register handling
2004-09-09 12:44 [PATCH]: SH 2a - Part 3: Bank register handling Corinna Vinschen
@ 2004-10-05 20:09 ` Elena Zannoni
2004-10-06 8:58 ` Corinna Vinschen
0 siblings, 1 reply; 3+ messages in thread
From: Elena Zannoni @ 2004-10-05 20:09 UTC (permalink / raw)
To: gdb-patches
Corinna Vinschen writes:
> Hi,
>
> this is SH 2a patch 2. It handles the "bank" pseudo register so
^^^^
3
> that reading and writing is performed on the correct register set
> inside of the register banks.
>
OK
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH]: SH 2a - Part 3: Bank register handling
2004-10-05 20:09 ` Elena Zannoni
@ 2004-10-06 8:58 ` Corinna Vinschen
0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2004-10-06 8:58 UTC (permalink / raw)
To: gdb-patches
On Oct 5 10:11, Elena Zannoni wrote:
> Corinna Vinschen writes:
> > this is SH 2a patch 2. It handles the "bank" pseudo register so
> ^^^^
> 3
Yep!
> > that reading and writing is performed on the correct register set
> > inside of the register banks.
>
> OK
Thanks, applied.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-10-06 8:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-09 12:44 [PATCH]: SH 2a - Part 3: Bank register handling Corinna Vinschen
2004-10-05 20:09 ` Elena Zannoni
2004-10-06 8:58 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox