Changeset 7328ff4 in mainline for kernel/arch/mips32/src/debugger.c
- Timestamp:
- 2018-09-06T18:18:52Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ffa73c6
- Parents:
- d51cca8
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-13 01:29:17)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-06 18:18:52)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/debugger.c
rd51cca8 r7328ff4 147 147 } 148 148 149 static inline void write_inst(uintptr_t addr, uint32_t inst) 150 { 151 *((uint32_t *) addr) = inst; 152 smc_coherence((uint32_t *) addr, 4); 153 } 154 149 155 #ifdef CONFIG_KCONSOLE 150 156 … … 212 218 213 219 /* Set breakpoint */ 214 *((sysarg_t *) cur->address) = 0x0d; 215 smc_coherence(cur->address, 4); 220 write_inst(cur->address, 0x0d); 216 221 217 222 irq_spinlock_unlock(&bkpoint_lock, true); … … 245 250 } 246 251 247 ((uint32_t *) cur->address)[0] = cur->instruction; 248 smc_coherence(((uint32_t *) cur->address)[0], 4); 249 ((uint32_t *) cur->address)[1] = cur->nextinstruction; 250 smc_coherence(((uint32_t *) cur->address)[1], 4); 252 write_inst(cur->address, cur->instruction); 253 write_inst(cur->address + 4, cur->nextinstruction); 251 254 252 255 cur->address = (uintptr_t) NULL; … … 357 360 if (cur->flags & BKPOINT_REINST) { 358 361 /* Set breakpoint on first instruction */ 359 ((uint32_t *) cur->address)[0] = 0x0d; 360 smc_coherence(((uint32_t *)cur->address)[0], 4); 362 write_inst(cur->address, 0x0d); 361 363 362 364 /* Return back the second */ 363 ((uint32_t *) cur->address)[1] = cur->nextinstruction; 364 smc_coherence(((uint32_t *) cur->address)[1], 4); 365 write_inst(cur->address + 4, cur->nextinstruction); 365 366 366 367 cur->flags &= ~BKPOINT_REINST; … … 379 380 380 381 /* Return first instruction back */ 381 ((uint32_t *)cur->address)[0] = cur->instruction; 382 smc_coherence(cur->address, 4); 382 write_inst(cur->address, cur->instruction); 383 383 384 384 if (!(cur->flags & BKPOINT_ONESHOT)) { 385 385 /* Set Breakpoint on next instruction */ 386 ((uint32_t *)cur->address)[1] = 0x0d;386 write_inst(cur->address + 4, 0x0d); 387 387 cur->flags |= BKPOINT_REINST; 388 388 }
Note:
See TracChangeset
for help on using the changeset viewer.