jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / target / breakpoints.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4 * Copyright (C) 2005 by Dominic Rath *
5 * Dominic.Rath@gmx.de *
6 ***************************************************************************/
7
8 #ifndef OPENOCD_TARGET_BREAKPOINTS_H
9 #define OPENOCD_TARGET_BREAKPOINTS_H
10
11 #include <stdint.h>
12
13 #include "helper/types.h"
14
15 struct target;
16
17 enum breakpoint_type {
18 BKPT_HARD,
19 BKPT_SOFT,
20 };
21
22 enum watchpoint_rw {
23 WPT_READ = 0, WPT_WRITE = 1, WPT_ACCESS = 2
24 };
25
26 struct breakpoint {
27 target_addr_t address;
28 uint32_t asid;
29 int length;
30 enum breakpoint_type type;
31 bool is_set;
32 unsigned int number;
33 uint8_t *orig_instr;
34 struct breakpoint *next;
35 uint32_t unique_id;
36 int linked_brp;
37 };
38
39 #define WATCHPOINT_IGNORE_DATA_VALUE_MASK (~(uint64_t)0)
40
41 struct watchpoint {
42 target_addr_t address;
43 uint32_t length;
44 uint64_t mask;
45 uint64_t value;
46 enum watchpoint_rw rw;
47 bool is_set;
48 unsigned int number;
49 struct watchpoint *next;
50 int unique_id;
51 };
52
53 int breakpoint_clear_target(struct target *target);
54 int breakpoint_add(struct target *target,
55 target_addr_t address, uint32_t length, enum breakpoint_type type);
56 int context_breakpoint_add(struct target *target,
57 uint32_t asid, uint32_t length, enum breakpoint_type type);
58 int hybrid_breakpoint_add(struct target *target,
59 target_addr_t address, uint32_t asid, uint32_t length, enum breakpoint_type type);
60 int breakpoint_remove(struct target *target, target_addr_t address);
61 int breakpoint_remove_all(struct target *target);
62
63 struct breakpoint *breakpoint_find(struct target *target, target_addr_t address);
64
65 static inline void breakpoint_hw_set(struct breakpoint *breakpoint, unsigned int hw_number)
66 {
67 breakpoint->is_set = true;
68 breakpoint->number = hw_number;
69 }
70
71 int watchpoint_clear_target(struct target *target);
72 int watchpoint_add(struct target *target,
73 target_addr_t address, uint32_t length,
74 enum watchpoint_rw rw, uint64_t value, uint64_t mask);
75 int watchpoint_remove(struct target *target, target_addr_t address);
76 int watchpoint_remove_all(struct target *target);
77
78 /* report type and address of just hit watchpoint */
79 int watchpoint_hit(struct target *target, enum watchpoint_rw *rw,
80 target_addr_t *address);
81
82 static inline void watchpoint_set(struct watchpoint *watchpoint, unsigned int number)
83 {
84 watchpoint->is_set = true;
85 watchpoint->number = number;
86 }
87
88 #define ERROR_BREAKPOINT_NOT_FOUND (-1600)
89 #define ERROR_WATCHPOINT_NOT_FOUND (-1601)
90
91 #endif /* OPENOCD_TARGET_BREAKPOINTS_H */

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)