• R/O
  • SSH
  • HTTPS

chibios: コミット


コミットメタ情報

リビジョン14530 (tree)
日時2021-06-11 21:41:37
作者gdisirio

ログメッセージ

Made unlikely all debug paths.

変更サマリ

差分

--- trunk/os/rt/include/chdebug.h (revision 14529)
+++ trunk/os/rt/include/chdebug.h (revision 14530)
@@ -118,7 +118,7 @@
118118 #define chDbgCheck(c) do { \
119119 /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant by design.*/ \
120120 if (CH_DBG_ENABLE_CHECKS != FALSE) { \
121- if (!(c)) { \
121+ if (unlikely(!(c))) { \
122122 /*lint -restore*/ \
123123 chSysHalt(__func__); \
124124 } \
@@ -144,7 +144,7 @@
144144 #define chDbgAssert(c, r) do { \
145145 /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant by design.*/ \
146146 if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
147- if (!(c)) { \
147+ if (unlikely(!(c))) { \
148148 /*lint -restore*/ \
149149 chSysHalt(__func__); \
150150 } \
--- trunk/os/rt/src/chdebug.c (revision 14529)
+++ trunk/os/rt/src/chdebug.c (revision 14530)
@@ -112,8 +112,8 @@
112112 void __dbg_check_disable(void) {
113113 os_instance_t *oip = currcore;
114114
115- if ((oip->dbg.isr_cnt != (cnt_t)0) ||
116- (oip->dbg.lock_cnt != (cnt_t)0)) {
115+ if (unlikely((oip->dbg.isr_cnt != (cnt_t)0) ||
116+ (oip->dbg.lock_cnt != (cnt_t)0))) {
117117 chSysHalt("SV#1");
118118 }
119119 }
@@ -126,8 +126,8 @@
126126 void __dbg_check_suspend(void) {
127127 os_instance_t *oip = currcore;
128128
129- if ((oip->dbg.isr_cnt != (cnt_t)0) ||
130- (oip->dbg.lock_cnt != (cnt_t)0)) {
129+ if (unlikely((oip->dbg.isr_cnt != (cnt_t)0) ||
130+ (oip->dbg.lock_cnt != (cnt_t)0))) {
131131 chSysHalt("SV#2");
132132 }
133133 }
@@ -140,8 +140,8 @@
140140 void __dbg_check_enable(void) {
141141 os_instance_t *oip = currcore;
142142
143- if ((oip->dbg.isr_cnt != (cnt_t)0) ||
144- (oip->dbg.lock_cnt != (cnt_t)0)) {
143+ if (unlikely((oip->dbg.isr_cnt != (cnt_t)0) ||
144+ (oip->dbg.lock_cnt != (cnt_t)0))) {
145145 chSysHalt("SV#3");
146146 }
147147 }
@@ -154,8 +154,8 @@
154154 void __dbg_check_lock(void) {
155155 os_instance_t *oip = currcore;
156156
157- if ((oip->dbg.isr_cnt != (cnt_t)0) ||
158- (oip->dbg.lock_cnt != (cnt_t)0)) {
157+ if (unlikely((oip->dbg.isr_cnt != (cnt_t)0) ||
158+ (oip->dbg.lock_cnt != (cnt_t)0))) {
159159 chSysHalt("SV#4");
160160 }
161161 oip->dbg.lock_cnt = (cnt_t)1;
@@ -169,8 +169,8 @@
169169 void __dbg_check_unlock(void) {
170170 os_instance_t *oip = currcore;
171171
172- if ((oip->dbg.isr_cnt != (cnt_t)0) ||
173- (oip->dbg.lock_cnt <= (cnt_t)0)) {
172+ if (unlikely((oip->dbg.isr_cnt != (cnt_t)0) ||
173+ (oip->dbg.lock_cnt <= (cnt_t)0))) {
174174 chSysHalt("SV#5");
175175 }
176176 oip->dbg.lock_cnt = (cnt_t)0;
@@ -184,8 +184,8 @@
184184 void __dbg_check_lock_from_isr(void) {
185185 os_instance_t *oip = currcore;
186186
187- if ((oip->dbg.isr_cnt <= (cnt_t)0) ||
188- (oip->dbg.lock_cnt != (cnt_t)0)) {
187+ if (unlikely((oip->dbg.isr_cnt <= (cnt_t)0) ||
188+ (oip->dbg.lock_cnt != (cnt_t)0))) {
189189 chSysHalt("SV#6");
190190 }
191191 oip->dbg.lock_cnt = (cnt_t)1;
@@ -199,8 +199,8 @@
199199 void __dbg_check_unlock_from_isr(void) {
200200 os_instance_t *oip = currcore;
201201
202- if ((oip->dbg.isr_cnt <= (cnt_t)0) ||
203- (oip->dbg.lock_cnt <= (cnt_t)0)) {
202+ if (unlikely((oip->dbg.isr_cnt <= (cnt_t)0) ||
203+ (oip->dbg.lock_cnt <= (cnt_t)0))) {
204204 chSysHalt("SV#7");
205205 }
206206 oip->dbg.lock_cnt = (cnt_t)0;
@@ -215,8 +215,8 @@
215215 os_instance_t *oip = currcore;
216216
217217 port_lock_from_isr();
218- if ((oip->dbg.isr_cnt < (cnt_t)0) ||
219- (oip->dbg.lock_cnt != (cnt_t)0)) {
218+ if (unlikely((oip->dbg.isr_cnt < (cnt_t)0) ||
219+ (oip->dbg.lock_cnt != (cnt_t)0))) {
220220 chSysHalt("SV#8");
221221 }
222222 oip->dbg.isr_cnt++;
@@ -232,8 +232,8 @@
232232 os_instance_t *oip = currcore;
233233
234234 port_lock_from_isr();
235- if ((oip->dbg.isr_cnt <= (cnt_t)0) ||
236- (oip->dbg.lock_cnt != (cnt_t)0)) {
235+ if (unlikely((oip->dbg.isr_cnt <= (cnt_t)0) ||
236+ (oip->dbg.lock_cnt != (cnt_t)0))) {
237237 chSysHalt("SV#9");
238238 }
239239 oip->dbg.isr_cnt--;
@@ -251,8 +251,8 @@
251251 void chDbgCheckClassI(void) {
252252 os_instance_t *oip = currcore;
253253
254- if ((oip->dbg.isr_cnt < (cnt_t)0) ||
255- (oip->dbg.lock_cnt <= (cnt_t)0)) {
254+ if (unlikely((oip->dbg.isr_cnt < (cnt_t)0) ||
255+ (oip->dbg.lock_cnt <= (cnt_t)0))) {
256256 chSysHalt("SV#10");
257257 }
258258 }
@@ -268,8 +268,8 @@
268268 void chDbgCheckClassS(void) {
269269 os_instance_t *oip = currcore;
270270
271- if ((oip->dbg.isr_cnt != (cnt_t)0) ||
272- (oip->dbg.lock_cnt <= (cnt_t)0)) {
271+ if (unlikely((oip->dbg.isr_cnt != (cnt_t)0) ||
272+ (oip->dbg.lock_cnt <= (cnt_t)0))) {
273273 chSysHalt("SV#11");
274274 }
275275 }
旧リポジトリブラウザで表示