Add support for booting into kdb on arm platforms when the RB_KDB is set
(using "boot -d" at the loader propmt or setting boot_ddb in loader.conf). Submitted by: Thomas Skibo <thomasskibo@yahoo.com> Differential Revision: https://reviews.freebsd.org/D14428
This commit is contained in:
parent
f0a2d31ab1
commit
bf56e64a4c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329989
@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#include <sys/linker.h>
|
#include <sys/linker.h>
|
||||||
#include <sys/msgbuf.h>
|
#include <sys/msgbuf.h>
|
||||||
|
#include <sys/reboot.h>
|
||||||
#include <sys/rwlock.h>
|
#include <sys/rwlock.h>
|
||||||
#include <sys/sched.h>
|
#include <sys/sched.h>
|
||||||
#include <sys/syscallsubr.h>
|
#include <sys/syscallsubr.h>
|
||||||
@ -785,6 +786,16 @@ set_stackptrs(int cpu)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
arm_kdb_init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
kdb_init();
|
||||||
|
#ifdef KDB
|
||||||
|
if (boothowto & RB_KDB)
|
||||||
|
kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef FDT
|
#ifdef FDT
|
||||||
#if __ARM_ARCH < 6
|
#if __ARM_ARCH < 6
|
||||||
@ -1054,7 +1065,7 @@ initarm(struct arm_boot_params *abp)
|
|||||||
|
|
||||||
init_param2(physmem);
|
init_param2(physmem);
|
||||||
dbg_monitor_init();
|
dbg_monitor_init();
|
||||||
kdb_init();
|
arm_kdb_init();
|
||||||
|
|
||||||
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
|
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
|
||||||
sizeof(struct pcb)));
|
sizeof(struct pcb)));
|
||||||
@ -1263,7 +1274,7 @@ initarm(struct arm_boot_params *abp)
|
|||||||
/* Init message buffer. */
|
/* Init message buffer. */
|
||||||
msgbufinit(msgbufp, msgbufsize);
|
msgbufinit(msgbufp, msgbufsize);
|
||||||
dbg_monitor_init();
|
dbg_monitor_init();
|
||||||
kdb_init();
|
arm_kdb_init();
|
||||||
/* Apply possible BP hardening. */
|
/* Apply possible BP hardening. */
|
||||||
cpuinfo_init_bp_hardening();
|
cpuinfo_init_bp_hardening();
|
||||||
return ((void *)STACKALIGN(thread0.td_pcb));
|
return ((void *)STACKALIGN(thread0.td_pcb));
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opt_platform.h"
|
#include "opt_platform.h"
|
||||||
|
#include "opt_ddb.h"
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
@ -57,6 +58,10 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/efi.h>
|
#include <sys/efi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DDB
|
||||||
|
#include <ddb/ddb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define debugf(fmt, args...) printf(fmt, ##args)
|
#define debugf(fmt, args...) printf(fmt, ##args)
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user