From nobody Wed Apr 17 03:33:39 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 4VK62C6PN9z5Hj0t; Wed, 17 Apr 2024 03:33:39 +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 4VK62C5sz1z4QTN; Wed, 17 Apr 2024 03:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713324819; 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=BzeCKGodOENO2b41L1SWkdZHAAnOoIpXqL6z8VXH4RM=; b=jr3rCWWPrLFL3VVxwp7KOjQKQOP4qNL+dVPPsROvrYLM4c69VW5z+OHodGulER0qPm7Fnh X/O3+bY2WNG3vITzS4DXYujKE1w7sSdq5z4sjmwAGVlY2hgiAwzEPoHk+i3rs6VBO+KS25 aZU2F1SM+ZEcK3MFPh3ulQ3RBlihRP3wlO7WtxQx14PnATXK03xKjkvkYaqJsHEz+guRxW 2xm15NL/czrEFj2mhAZl2i/yC4Ywmno9kcycyw5eQ+1UPRBgwsJD4NAPGKwhxFiB4IFFQa vt4z3cdSrxS9AODBF54eV4LcRbsWT2YGlRlR/B+mD56QY6XpF1IJNgEfHE1zGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713324819; a=rsa-sha256; cv=none; b=axillVXLZxaEnrv7kpoM13Mlh9skzxT89htr28XFmmoiUZ9b1Jb+lHe+5Lj77BlAwawP8x lxrj2HjX5FUKxMQkdhMg4XN8JNgQzhNavd81JRIkvewWvYhgUx7FGxkIC8ADapR1PIEY+n w0kOMmk/UAn+dLaetqqckngzXEOtkGwwJxf5LSXyxFoC2sQ4RYJA1hH5XQlgH2w0UZKvoW 8UT+ExGbN/g5JX0+e5ZqfZTWsGH2BIhnb+Msjsycm8wD5fE62FYHsOn08v/kW8qKNeIPIz RjhUy9QAjUmXMRj6vBWRvHQ9hOdi7v72i+1HdmAl5IRpA9rP1F7dud8y0oMWRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713324819; 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=BzeCKGodOENO2b41L1SWkdZHAAnOoIpXqL6z8VXH4RM=; b=EaQ3DnKHbzI9kfCZpjIeymhVGwHy7ZeAa5VKEprGlH1XXiyI6Uz2uL85s4SDKGHKcEqiWP ADabpoD+Vn2iwST+aveWYgKUr+aYVtrYrJp1nQgZvtqa6Uy7D2LmfmGNg1brkJNm7fvsYb 9ogpRYfsNWKH/0qA8UpnL1cQTcLN00r91EmWnqH6cX0u68VXpuUYjtR0bGMa5/gndMSYQ/ NWRYkKcnV5WIGBPf8uti+EkhogzIbSTPpiPqQxxjCCbH4lQu7IxgWgvLgFjXxno11Awcii 46tK8FYbSFWKC0xcsQme81L95Zfjl/kfQPmijlaS++si2VoxPnXBVXV5vOkBRg== 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 4VK62C5SHyz18Wd; Wed, 17 Apr 2024 03:33:39 +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 43H3XdgG086545; Wed, 17 Apr 2024 03:33:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43H3XdLZ086542; Wed, 17 Apr 2024 03:33:39 GMT (envelope-from git) Date: Wed, 17 Apr 2024 03:33:39 GMT Message-Id: <202404170333.43H3XdLZ086542@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: de22251127cd - main - arm_kernel_bothdr.awk: Update to latest ota 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: de22251127cd0e89ce1edb56c58b202496a97ba3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=de22251127cd0e89ce1edb56c58b202496a97ba3 commit de22251127cd0e89ce1edb56c58b202496a97ba3 Author: Warner Losh AuthorDate: 2024-04-15 21:07:46 +0000 Commit: Warner Losh CommitDate: 2024-04-17 03:30:17 +0000 arm_kernel_bothdr.awk: Update to latest ota The latest ota is the first one in FreeBSD that treats 0 + "0xf" as being '0' instead of '15'. Don't use this old trick anymore to convert from hexidecimal to a number. Write a function to do that instead. This fixes kernel.bin building on arm*. awk on 14 doesn't need this, but to build FreeBSD stable/14's kernel.bin on 15 we'll need it, so fast MFC. MFC After: 3 days Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44801 --- sys/tools/arm_kernel_boothdr.awk | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/tools/arm_kernel_boothdr.awk b/sys/tools/arm_kernel_boothdr.awk index dcc65ab40b66..e0f193f7922c 100644 --- a/sys/tools/arm_kernel_boothdr.awk +++ b/sys/tools/arm_kernel_boothdr.awk @@ -47,6 +47,10 @@ BEGIN { } gHdrType = hdrtype + for (i = 0; i < 16; i++) { + hex[sprintf("%x", i)] = i; + hex[sprintf("%X", i)] = i; + } } function addr_to_offset(addr) { @@ -56,11 +60,13 @@ function addr_to_offset(addr) { function hexstr_to_num(str) { - # Prepend a 0x onto the string, then coerce it to a number by doing - # arithmetic with it, which makes awk run it through strtod(), - # which handles hex numbers that have a 0x prefix. + sum = 0; + len = length(str); + for (i = 1; i <= len; i++) { + sum = sum * 16 + hex[substr(str, i, 1)]; + } - return 0 + ("0x" str) + return sum; } function write_le32(num) {