This is the mail archive of the sid@sources.redhat.com mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] New iniput pin for sw-elf-loader


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

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]