From owner-svn-src-head@freebsd.org Sun Feb 25 18:43:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0BB4F0A700; Sun, 25 Feb 2018 18:43:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 519246B0AD; Sun, 25 Feb 2018 18:43:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C6BE10B4E; Sun, 25 Feb 2018 18:43:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1PIh0Qa065511; Sun, 25 Feb 2018 18:43:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PIh0j9065508; Sun, 25 Feb 2018 18:43:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802251843.w1PIh0j9065508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 25 Feb 2018 18:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329989 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 329989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 18:43:00 -0000 Author: ian Date: Sun Feb 25 18:42:59 2018 New Revision: 329989 URL: https://svnweb.freebsd.org/changeset/base/329989 Log: 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 Differential Revision: https://reviews.freebsd.org/D14428 Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/machdep_boot.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Feb 25 18:26:50 2018 (r329988) +++ head/sys/arm/arm/machdep.c Sun Feb 25 18:42:59 2018 (r329989) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -785,7 +786,17 @@ set_stackptrs(int cpu) } #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 #if __ARM_ARCH < 6 void * @@ -1054,7 +1065,7 @@ initarm(struct arm_boot_params *abp) init_param2(physmem); dbg_monitor_init(); - kdb_init(); + arm_kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); @@ -1263,7 +1274,7 @@ initarm(struct arm_boot_params *abp) /* Init message buffer. */ msgbufinit(msgbufp, msgbufsize); dbg_monitor_init(); - kdb_init(); + arm_kdb_init(); /* Apply possible BP hardening. */ cpuinfo_init_bp_hardening(); return ((void *)STACKALIGN(thread0.td_pcb)); Modified: head/sys/arm/arm/machdep_boot.c ============================================================================== --- head/sys/arm/arm/machdep_boot.c Sun Feb 25 18:26:50 2018 (r329988) +++ head/sys/arm/arm/machdep_boot.c Sun Feb 25 18:42:59 2018 (r329989) @@ -27,6 +27,7 @@ */ #include "opt_platform.h" +#include "opt_ddb.h" #include __FBSDID("$FreeBSD$"); @@ -55,6 +56,10 @@ __FBSDID("$FreeBSD$"); #ifdef EFI #include +#endif + +#ifdef DDB +#include #endif #ifdef DEBUG