From owner-svn-src-head@freebsd.org Tue Nov 14 03:23:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9660CFD36D; Tue, 14 Nov 2017 03:23:47 +0000 (UTC) (envelope-from jhibbits@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 mx1.freebsd.org (Postfix) with ESMTPS id 842A96BC4D; Tue, 14 Nov 2017 03:23:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAE3NkYY000249; Tue, 14 Nov 2017 03:23:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAE3NkCP000248; Tue, 14 Nov 2017 03:23:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711140323.vAE3NkCP000248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 14 Nov 2017 03:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325790 - head/sys/mips/beri X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/mips/beri X-SVN-Commit-Revision: 325790 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: Tue, 14 Nov 2017 03:23:48 -0000 Author: jhibbits Date: Tue Nov 14 03:23:46 2017 New Revision: 325790 URL: https://svnweb.freebsd.org/changeset/base/325790 Log: Convert BERI to use ofw_parse_bootargs() Summary: ofw_parse_bootargs() was added in r306065 as an attempt to unify the various copies of the same code. This simply migrates BERI to use it. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D12962 Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Tue Nov 14 03:21:39 2017 (r325789) +++ head/sys/mips/beri/beri_machdep.c Tue Nov 14 03:23:46 2017 (r325790) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include #include +#include #endif #include @@ -161,46 +162,6 @@ platform_reset(void) __asm__ __volatile("wait"); } -#ifdef FDT -/* Parse cmd line args as env - copied from xlp_machdep. */ -/* XXX-BZ this should really be centrally provided for all (boot) code. */ -static void -_parse_bootargs(char *cmdline) -{ - char *n, *v; - - while ((v = strsep(&cmdline, " \n")) != NULL) { - if (*v == '\0') - continue; - if (*v == '-') { - while (*v != '\0') { - v++; - switch (*v) { - case 'a': boothowto |= RB_ASKNAME; break; - /* Someone should simulate that ;-) */ - case 'C': boothowto |= RB_CDROM; break; - case 'd': boothowto |= RB_KDB; break; - case 'D': boothowto |= RB_MULTIPLE; break; - case 'm': boothowto |= RB_MUTE; break; - case 'g': boothowto |= RB_GDB; break; - case 'h': boothowto |= RB_SERIAL; break; - case 'p': boothowto |= RB_PAUSE; break; - case 'r': boothowto |= RB_DFLTROOT; break; - case 's': boothowto |= RB_SINGLE; break; - case 'v': boothowto |= RB_VERBOSE; break; - } - } - } else { - n = strsep(&v, "="); - if (v == NULL) - kern_setenv(n, "1"); - else - kern_setenv(n, v); - } - } -} -#endif - void platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) @@ -279,9 +240,7 @@ platform_start(__register_t a0, __register_t a1, __re /* * Get bootargs from FDT if specified. */ - chosen = OF_finddevice("/chosen"); - if (OF_getprop(chosen, "bootargs", buf, sizeof(buf)) != -1) - _parse_bootargs(buf); + ofw_parse_bootargs(); #endif /*