The bitbang driver leaves the TCK 0 when in idle
[openocd.git] / src / target / register.c
1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include "register.h"
25
26 #include "log.h"
27 #include "command.h"
28
29 #include <string.h>
30 #include <stdlib.h>
31
32 reg_arch_type_t *reg_arch_types = NULL;
33
34 reg_t* register_get_by_name(reg_cache_t *first, char *name, int search_all)
35 {
36 int i;
37 reg_cache_t *cache = first;
38
39 while (cache)
40 {
41 for (i = 0; i < cache->num_regs; i++)
42 {
43 if (strcmp(cache->reg_list[i].name, name) == 0)
44 return &(cache->reg_list[i]);
45 }
46
47 if (search_all)
48 cache = cache->next;
49 else
50 break;
51 }
52
53 return NULL;
54 }
55
56 reg_cache_t** register_get_last_cache_p(reg_cache_t **first)
57 {
58 reg_cache_t **cache_p = first;
59
60 if (*cache_p)
61 while (*cache_p)
62 cache_p = &((*cache_p)->next);
63 else
64 return first;
65
66 return cache_p;
67 }
68
69 int register_reg_arch_type(int (*get)(reg_t *reg), int (*set)(reg_t *reg, u8 *buf))
70 {
71 reg_arch_type_t** arch_type_p = &reg_arch_types;
72 int id = 0;
73
74 if (*arch_type_p)
75 {
76 while (*arch_type_p)
77 {
78 id = (*arch_type_p)->id;
79 arch_type_p = &((*arch_type_p)->next);
80 }
81 }
82
83 (*arch_type_p) = malloc(sizeof(reg_arch_type_t));
84 (*arch_type_p)->id = id + 1;
85 (*arch_type_p)->set = set;
86 (*arch_type_p)->get = get;
87 (*arch_type_p)->next = NULL;
88
89 return id + 1;
90 }
91
92 reg_arch_type_t* register_get_arch_type(int id)
93 {
94 reg_arch_type_t *arch_type = reg_arch_types;
95
96 while (arch_type)
97 {
98 if (arch_type->id == id)
99 return arch_type;
100 arch_type = arch_type->next;
101 }
102
103 return NULL;
104 }

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)