From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14830 invoked by alias); 12 May 2005 16:17:53 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 14017 invoked from network); 12 May 2005 16:17:33 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 12 May 2005 16:17:33 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j4CGHXHU000941 for ; Thu, 12 May 2005 12:17:33 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j4CGHXO22482 for ; Thu, 12 May 2005 12:17:33 -0400 Received: from [172.16.14.227] (IDENT:sfldzbpWOD9ylkeuVYiWxeyqqHTpmY8T@topaz.toronto.redhat.com [172.16.14.227]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id j4CGHWk0021524 for ; Thu, 12 May 2005 12:17:32 -0400 Message-ID: <4283819C.20802@redhat.com> Date: Thu, 12 May 2005 16:17:00 -0000 From: Dave Brolley User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) MIME-Version: 1.0 To: sid@sources.redhat.com Subject: [commit] New iniput pin for sw-elf-loader Content-Type: multipart/mixed; boundary="------------090709000909090500050304" X-SW-Source: 2005-q2/txt/msg00017.txt.bz2 This is a multi-part message in MIME format. --------------090709000909090500050304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 356 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 --------------090709000909090500050304 Content-Type: text/plain; name="sid-loader.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sid-loader.ChangeLog" Content-length: 352 2005-05-12 Dave Brolley * 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. --------------090709000909090500050304 Content-Type: text/plain; name="sid-loader.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sid-loader.patch.txt" Content-length: 4975 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 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 ---- + *************** *** 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.

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

--------------090709000909090500050304--