From nobody Fri Feb 16 04:00:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TbdWQ6hT6z59ZGx; Fri, 16 Feb 2024 04:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TbdWQ5V91z4HWt; Fri, 16 Feb 2024 04:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708056034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lIVLsZRnKwxuO7oWVADVEDxPiQysvgyxiD6Q/Hrts4A=; b=L6ejnZxB6Llc1Z2L46uzTaBAhMni/L3FUL0u07+oyXOxiPlwffO9c8o0oW2n8no/nMsbtL nmu7WPdGs1Yb07HGzRkq4a8tNixz6jDo88dOwqMyA3vIJUMyvp2RaoGadbK3aIU3ObW0yd 12CfuP9g2rqLnY8KgrLSvx3wgLTud/bwq0LhDHA4e+qKJ/eM1T4Ebtr6eKBDAR42wrDYr1 1LuiQYvM/HjwD1vLESPHwg4qaabTS93M3nl4UU4hYnoCJBqKW+wwL99FHzUDJ5yjOuStsA cY9GdO4AcheGV4mUDb+PA9ObESNvDqHCqmhZFeSRh6tt6m7WtNDC2FRimjynhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708056034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lIVLsZRnKwxuO7oWVADVEDxPiQysvgyxiD6Q/Hrts4A=; b=ywRoZRejbSEc0gHAriOQ5lfOLF2IDb4m8izA0X5Gt7zIoswOjANHdZ0poxAglWAOkAfU44 Juk0ttCkMXhqJQkBM41jNDP29Iw+KLvhsVWjChnQ6uhAiz0rXRZvpOUTj2OzEnRGWHYAo/ 0RQmv8Irs2RWvybeha6A2NeoRAziyYtFP3v4XU1BHaODC7ZikKz9YsgxBW1ocjKAg+WkU/ 8tS/FstwRZ3h90E+rNmye5d5FkqERaT9LwbmswH8GF/9rFlMTx05TqBegF/1NTaSEWQtXu PRhoaQ2wQLiTU4q7g1uUNYzh2pT2dW17qjJOotgpARzUMDoYv7+bq0uhpmK99A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708056034; a=rsa-sha256; cv=none; b=wBlZ20oM6sshqrMHjtg7Iwq6/RPctsp6Byxncf9pFilGAyzNVNmjUgPWQ1bVnY6tqc2/8c SDKySY8gURJ8Xcx0riA6IgyE7rvBJ3mwQPW3P6mLUh6LZ2/k4tnBdKd4HjKj1yiZzmL+3r a5mZD+IljCaNHTZH+iV3xwHFt0jccsj1YEeewuwAmIEs1H2tDjUnWdxVUGEgo8vc2x8owE AVzKGV+hT4JYeDWIvbQIgdKA5e4eOpPICr54/kRNDBPbdXpGpAh+dazkYT/9fGR7R/A8J9 vPnEdydrBOn8aajKT648KBisv2ASLpK3fA+s9enuKrPFUPYHZnrBm6+QdpDCow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TbdWQ4bDPz18mb; Fri, 16 Feb 2024 04:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41G40Yon019338; Fri, 16 Feb 2024 04:00:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41G40Yqx019335; Fri, 16 Feb 2024 04:00:34 GMT (envelope-from git) Date: Fri, 16 Feb 2024 04:00:34 GMT Message-Id: <202402160400.41G40Yqx019335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 588ff0748f4a - main - loader: Simplify build a little List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 588ff0748f4acf8e00395f86e4956f184c7d3795 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=588ff0748f4acf8e00395f86e4956f184c7d3795 commit 588ff0748f4acf8e00395f86e4956f184c7d3795 Author: Warner Losh AuthorDate: 2024-02-16 03:55:05 +0000 Commit: Warner Losh CommitDate: 2024-02-16 03:59:23 +0000 loader: Simplify build a little Confine -DDISK_DEBUG to biosdisc.c, the only file it affects. Use modern variable arrays instead of alloca and add a sanity size minimum for biospnp nodes. These nodes are tiny enough that we needn't do a malloc/free pair: the stack is fine. Sponsored by: Netflix Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D43914 --- stand/i386/libi386/Makefile | 8 ++------ stand/i386/libi386/biospnp.c | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/stand/i386/libi386/Makefile b/stand/i386/libi386/Makefile index 0bc0efd35f22..fcba20fa26c4 100644 --- a/stand/i386/libi386/Makefile +++ b/stand/i386/libi386/Makefile @@ -23,7 +23,7 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} .ifdef(BOOT_BIOSDISK_DEBUG) # Make the disk code more talkative -CFLAGS+= -DDISK_DEBUG +CFLAGS.biosdisk.c+= -DDISK_DEBUG .endif # terminal emulation @@ -35,11 +35,7 @@ CFLAGS.teken.c+= -I${SRCTOP}/sys/teken CFLAGS.bootinfo.c+= -I${SRCTOP}/sys/teken -I${SRCTOP}/contrib/pnglite CFLAGS.vbe.c+= -I${SRCTOP}/sys/teken -I${SRCTOP}/contrib/pnglite -# XXX: make alloca() useable -CFLAGS+= -Dalloca=__builtin_alloca - -CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ - -I${LDRSRC} -I${BOOTSRC}/i386/common \ +CFLAGS+= -I${LDRSRC} -I${BOOTSRC}/i386/common \ -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers diff --git a/stand/i386/libi386/biospnp.c b/stand/i386/libi386/biospnp.c index 7e3bc97a35ee..a26c0d4d52d8 100644 --- a/stand/i386/libi386/biospnp.c +++ b/stand/i386/libi386/biospnp.c @@ -155,6 +155,7 @@ biospnp_enumerate(void) { uint8_t Node; struct pnp_devNode *devNodeBuffer; + uint8_t buffer[max(pnp_NodeSize, sizeof(*devNodeBuffer))]; int result; struct pnpinfo *pi; int count; @@ -163,7 +164,7 @@ biospnp_enumerate(void) if (biospnp_init()) return; - devNodeBuffer = (struct pnp_devNode *)alloca(pnp_NodeSize); + devNodeBuffer = (struct pnp_devNode *)buffer; Node = 0; count = 1000; while((Node != 0xff) && (count-- > 0)) {