target/openrisc/or1k: Use 'bool' data type
[openocd.git] / src / target / openrisc / or1k.c
index 3895ddfaf518100ef48ea5e8cfd302574a947305..34b1b07483bcacd3d469b137d7ae084ffcc63866 100644 (file)
@@ -424,8 +424,8 @@ static int or1k_read_core_reg(struct target *target, int num)
                reg_value = or1k->core_regs[num];
                buf_set_u32(or1k->core_cache->reg_list[num].value, 0, 32, reg_value);
                LOG_DEBUG("Read core reg %i value 0x%08" PRIx32, num , reg_value);
-               or1k->core_cache->reg_list[num].valid = 1;
-               or1k->core_cache->reg_list[num].dirty = 0;
+               or1k->core_cache->reg_list[num].valid = true;
+               or1k->core_cache->reg_list[num].dirty = false;
        } else {
                /* This is an spr, always read value from HW */
                int retval = du_core->or1k_jtag_read_cpu(&or1k->jtag,
@@ -453,8 +453,8 @@ static int or1k_write_core_reg(struct target *target, int num)
        uint32_t reg_value = buf_get_u32(or1k->core_cache->reg_list[num].value, 0, 32);
        or1k->core_regs[num] = reg_value;
        LOG_DEBUG("Write core reg %i value 0x%08" PRIx32, num , reg_value);
-       or1k->core_cache->reg_list[num].valid = 1;
-       or1k->core_cache->reg_list[num].dirty = 0;
+       or1k->core_cache->reg_list[num].valid = true;
+       or1k->core_cache->reg_list[num].dirty = false;
 
        return ERROR_OK;
 }
@@ -487,8 +487,8 @@ static int or1k_set_core_reg(struct reg *reg, uint8_t *buf)
 
        if (or1k_reg->list_num < OR1KNUMCOREREGS) {
                buf_set_u32(reg->value, 0, 32, value);
-               reg->dirty = 1;
-               reg->valid = 1;
+               reg->dirty = true;
+               reg->valid = true;
        } else {
                /* This is an spr, write it to the HW */
                int retval = du_core->or1k_jtag_write_cpu(&or1k->jtag,
@@ -541,8 +541,8 @@ static struct reg_cache *or1k_build_reg_cache(struct target *target)
                reg_list[i].group = or1k_core_reg_list_arch_info[i].group;
                reg_list[i].size = 32;
                reg_list[i].value = calloc(1, 4);
-               reg_list[i].dirty = 0;
-               reg_list[i].valid = 0;
+               reg_list[i].dirty = false;
+               reg_list[i].valid = false;
                reg_list[i].type = &or1k_reg_type;
                reg_list[i].arch_info = &arch_info[i];
                reg_list[i].number = i;
@@ -1248,8 +1248,7 @@ static int or1k_profiling(struct target *target, uint32_t *samples,
                samples[sample_count++] = reg_value;
 
                gettimeofday(&now, NULL);
-               if ((sample_count >= max_num_samples) ||
-                       ((now.tv_sec >= timeout.tv_sec) && (now.tv_usec >= timeout.tv_usec))) {
+               if ((sample_count >= max_num_samples) || timeval_compare(&now, &timeout) > 0) {
                        LOG_INFO("Profiling completed. %" PRIu32 " samples.", sample_count);
                        break;
                }

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)