public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* [commit] New iniput pin for sw-elf-loader
@ 2005-05-12 16:17 Dave Brolley
  0 siblings, 0 replies; only message in thread
From: Dave Brolley @ 2005-05-12 16:17 UTC (permalink / raw)
  To: sid

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

Hi,

I've committed the attached patch which adds a new input pin, "probe", 
to sw-elf-loader. When driven with an address, the address will go 
through the same checks as addresses of requests on the "probe-upstream" 
bus. This can be used by other components in the system to check whether 
a write to a given address should be handled specially.

Dave


[-- Attachment #2: sid-loader.ChangeLog --]
[-- Type: text/plain, Size: 352 bytes --]

2005-05-12  Dave Brolley  <brolley@redhat.com>

	* compLoader.cxx (probe_address): New method of loader_probe_bus.
	(loader_probe_bus::write): Call probe_address.
	(handle_probe_pin): New method of generic_loader.
	(generic_loader): Initialize probe_pin and add "probe" pin.
	* sw-load-elf.xml: Describe the new pin.
	* sw-load-elf.txt: Regenerated.
	

[-- Attachment #3: sid-loader.patch.txt --]
[-- Type: text/plain, Size: 4975 bytes --]

Index: sid/component/loader/compLoader.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/loader/compLoader.cxx,v
retrieving revision 1.9
diff -c -p -r1.9 compLoader.cxx
*** sid/component/loader/compLoader.cxx	29 Jun 2004 19:10:39 -0000	1.9
--- sid/component/loader/compLoader.cxx	12 May 2005 16:06:17 -0000
*************** class loader_probe_bus: public sidutil::
*** 77,90 ****
      
      void set_section_table (const struct TextSection *s) { section_table = s; }
  
      // Some macros to make manufacturing of the cartesian-product
      // calls simpler.
  #define SID_GB_WRITE(dtype) \
        sid::bus::status write(sid::host_int_4 addr, dtype data) throw ()\
  	  { if (LIKELY(*target)) \
                { \
!                 if (write_to_code_address_pin && textSectionAddress (addr, section_table)) \
!                   write_to_code_address_pin->drive (addr); \
                  return (*target)->write(addr, data); \
                } \
              else return sid::bus::unpermitted; \
--- 77,95 ----
      
      void set_section_table (const struct TextSection *s) { section_table = s; }
  
+     void probe_address (sid::host_int_4 addr)
+       {
+ 	if (write_to_code_address_pin && textSectionAddress (addr, section_table))
+ 	  write_to_code_address_pin->drive (addr);
+       }
+ 
      // Some macros to make manufacturing of the cartesian-product
      // calls simpler.
  #define SID_GB_WRITE(dtype) \
        sid::bus::status write(sid::host_int_4 addr, dtype data) throw ()\
  	  { if (LIKELY(*target)) \
                { \
!                 probe_address (addr); \
                  return (*target)->write(addr, data); \
                } \
              else return sid::bus::unpermitted; \
*************** protected:
*** 142,147 ****
--- 147,158 ----
  
    loader_probe_bus probe_upstream;
    bus           *probe_downstream;
+   callback_pin<generic_loader> probe_pin;
+ 
+   void handle_probe_pin (sid::host_int_4 v)
+     {
+       probe_upstream.probe_address (v);
+     }
  
    // The load pin was triggered.
    virtual void load_it (host_int_4) = 0;
*************** public:
*** 161,167 ****
      load_accessor_insn(0),
      load_accessor_data(0),
      probe_upstream (& probe_downstream, & this->write_to_code_address_pin),
!     probe_downstream(0)
      {
        add_pin("load!", & this->doit_pin);
        add_pin("start-pc-set", & this->start_pc_pin);
--- 172,179 ----
      load_accessor_insn(0),
      load_accessor_data(0),
      probe_upstream (& probe_downstream, & this->write_to_code_address_pin),
!     probe_downstream(0),
!     probe_pin (this, & generic_loader::handle_probe_pin)
      {
        add_pin("load!", & this->doit_pin);
        add_pin("start-pc-set", & this->start_pc_pin);
*************** public:
*** 174,179 ****
--- 186,192 ----
        add_attribute("file", & this->load_file, "setting");
        add_bus ("probe-upstream", & this->probe_upstream);
        add_accessor ("probe-downstream", & this->probe_downstream);
+       add_pin ("probe", & this->probe_pin);
        add_attribute("verbose?", & this->verbose_p, "setting");
        add_attribute_virtual ("state-snapshot", this,
  			     & generic_loader::save_state,
Index: sid/component/loader/sw-load-elf.xml
===================================================================
RCS file: /cvs/src/src/sid/component/loader/sw-load-elf.xml,v
retrieving revision 1.3
diff -c -p -r1.3 sw-load-elf.xml
*** sid/component/loader/sw-load-elf.xml	21 Oct 2003 21:30:44 -0000	1.3
--- sid/component/loader/sw-load-elf.xml	12 May 2005 16:06:17 -0000
***************
*** 9,14 ****
--- 9,15 ----
      <defpin name="endian-set" direction="out" legalvalues="0/1/2" behaviors="loading"/>
      <defpin name="error" direction="out" legalvalues="any" behaviors="loading"/>
      <defpin name="write-to-code-address" direction="out" legalvalues="any address" behaviors="error checking"/>
+     <defpin name="probe" direction="in" legalvalues="any address" behaviors="error checking"/>
  
      <defattribute name="state-snapshot" legalvalues="opaque string" behaviors="save/restore"/>
      <defattribute name="file" category="setting" legalvalues="file name" defaultvalue='"/dev/null"' behaviors="configuration"/>
***************
*** 73,79 ****
        to a code segment, the write-to-code-address pin is driven with the
        address of the write attempt. All reads and writes
        coming in through the probe-upstream bus are passed on to the
!       probe-downstream accessor.
        </p>
      </behavior>
  
--- 74,81 ----
        to a code segment, the write-to-code-address pin is driven with the
        address of the write attempt. All reads and writes
        coming in through the probe-upstream bus are passed on to the
!       probe-downstream accessor. In addition, addresses driven on the
!       "probe" pin are checked in the same way.
        </p>
      </behavior>
  

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-12 16:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-12 16:17 [commit] New iniput pin for sw-elf-loader Dave Brolley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).