flash/nor: Add erased_value to drivers and pass it to targets
[openocd.git] / src / target / x86_32_common.c
index 6bcd4aff22b56499529009741ad85d345798133a..c21167e1e1af35625546c3407b1074548405a96b 100644 (file)
@@ -8,8 +8,9 @@
  * Jeffrey Maxwell (jeffrey.r.maxwell@intel.com)
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -17,8 +18,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * Contact Information:
  * Intel Corporation
@@ -48,7 +48,7 @@ static int read_mem(struct target *t, uint32_t size,
                        uint32_t addr, uint8_t *buf);
 static int write_mem(struct target *t, uint32_t size,
                        uint32_t addr, const uint8_t *buf);
-static int calcaddr_pyhsfromlin(struct target *t, uint32_t addr,
+static int calcaddr_physfromlin(struct target *t, uint32_t addr,
                        uint32_t *physaddr);
 static int read_phys_mem(struct target *t, uint32_t phys_address,
                        uint32_t size, uint32_t count, uint8_t *buffer);
@@ -134,7 +134,7 @@ int x86_32_common_virt2phys(struct target *t, uint32_t address, uint32_t *physic
 
        } else {
                /* target halted in protected mode */
-               if (calcaddr_pyhsfromlin(t, address, physical) != ERROR_OK) {
+               if (calcaddr_physfromlin(t, address, physical) != ERROR_OK) {
                        LOG_ERROR("%s failed to calculate physical address from 0x%08" PRIx32,
                                        __func__, address);
                        return ERROR_FAIL;
@@ -444,7 +444,7 @@ static int write_mem(struct target *t, uint32_t size,
        return retval;
 }
 
-int calcaddr_pyhsfromlin(struct target *t, uint32_t addr, uint32_t *physaddr)
+int calcaddr_physfromlin(struct target *t, uint32_t addr, uint32_t *physaddr)
 {
        uint8_t entry_buffer[8];
 
@@ -592,7 +592,7 @@ int x86_32_common_read_memory(struct target *t, uint32_t addr,
                        return retval;
                }
                uint32_t physaddr = 0;
-               if (calcaddr_pyhsfromlin(t, addr, &physaddr) != ERROR_OK) {
+               if (calcaddr_physfromlin(t, addr, &physaddr) != ERROR_OK) {
                        LOG_ERROR("%s failed to calculate physical address from 0x%08" PRIx32, __func__, addr);
                        retval = ERROR_FAIL;
                }
@@ -646,7 +646,7 @@ int x86_32_common_write_memory(struct target *t, uint32_t addr,
                        return retval;
                }
                uint32_t physaddr = 0;
-               if (calcaddr_pyhsfromlin(t, addr, &physaddr) != ERROR_OK) {
+               if (calcaddr_physfromlin(t, addr, &physaddr) != ERROR_OK) {
                        LOG_ERROR("%s failed to calculate physical address from 0x%08" PRIx32,
                                        __func__, addr);
                        retval = ERROR_FAIL;
@@ -1016,7 +1016,7 @@ static int set_swbp(struct target *t, struct breakpoint *bp)
        uint8_t opcode = SW_BP_OPCODE;
        uint8_t readback;
 
-       if (calcaddr_pyhsfromlin(t, bp->address, &physaddr) != ERROR_OK)
+       if (calcaddr_physfromlin(t, bp->address, &physaddr) != ERROR_OK)
                return ERROR_FAIL;
        if (read_phys_mem(t, physaddr, 1, 1, bp->orig_instr))
                return ERROR_FAIL;
@@ -1072,7 +1072,7 @@ static int unset_swbp(struct target *t, struct breakpoint *bp)
        uint8_t current_instr;
 
        /* check that user program has not modified breakpoint instruction */
-       if (calcaddr_pyhsfromlin(t, bp->address, &physaddr) != ERROR_OK)
+       if (calcaddr_physfromlin(t, bp->address, &physaddr) != ERROR_OK)
                return ERROR_FAIL;
        if (read_phys_mem(t, physaddr, 1, 1, &current_instr))
                return ERROR_FAIL;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)