• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14syntax = "proto2";
15
16package pw.cpu_exception.cortex_m;
17
18message ArmV7mCpuState {
19  optional uint32 pc = 1;
20  optional uint32 lr = 2;
21  optional uint32 psr = 3;
22  optional uint32 msp = 4;
23  optional uint32 psp = 5;
24  optional uint32 exc_return = 6;
25  optional uint32 cfsr = 7;
26  optional uint32 msplim = 27;
27  optional uint32 psplim = 28;
28  optional uint32 mmfar = 8;
29  optional uint32 bfar = 9;
30  optional uint32 icsr = 10;
31  optional uint32 hfsr = 25;
32  optional uint32 shcsr = 26;
33  optional uint32 control = 11;
34
35  // General purpose registers.
36  optional uint32 r0 = 12;
37  optional uint32 r1 = 13;
38  optional uint32 r2 = 14;
39  optional uint32 r3 = 15;
40  optional uint32 r4 = 16;
41  optional uint32 r5 = 17;
42  optional uint32 r6 = 18;
43  optional uint32 r7 = 19;
44  optional uint32 r8 = 20;
45  optional uint32 r9 = 21;
46  optional uint32 r10 = 22;
47  optional uint32 r11 = 23;
48  optional uint32 r12 = 24;
49
50  // Next tag: 29
51}
52
53// This message overlays the pw.snapshot.Snapshot proto. It's valid to encode
54// this message to the same sink that a Snapshot proto is being written to.
55message SnapshotCpuStateOverlay {
56  // TODO(amontanez): Rename this to be Cortex-M arch generic, e.g.:
57  //   optional CpuState cpu_state = 20;
58  optional ArmV7mCpuState armv7m_cpu_state = 20;
59}
60