From nobody Fri Mar 24 13:13:56 2023 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 4PjjMn2KtJz41Z3r; Fri, 24 Mar 2023 13:13:57 +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 4PjjMn0DwJz434x; Fri, 24 Mar 2023 13:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679663637; 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=MkjNJ5mjAjla8hNfUrAZmgCMQn1ol72ers4R7nM/yZQ=; b=QTUCIn43xYe9vF8Rh91mZvXBx4wcYz8/2py1Z/t7RM2G3Y5+F2vwa2dkdF2T2pCbleas47 aeyN9rXQ8jpM9ZquFaiwYoGOzzYT6I38edueSmug14qXwGA+tjF7Wh9eIhrbqyZSNSn1TJ JedavpbTBDnyVV1H2DlUujFOtWZ0gqoZI8j3F+yg61JWfbbZgRXBoj2XSEloQuyIg+Cmfq T5JUsNNa1yX5ho2X4LMglYgrWW/0VH1fimAY++fFnuEf3+KkeCUev2qYUsHhYSpV02zsqs PTY091eshb37M6H5NzwDmwKdMeuMUzSjsK9d18n0Bz+ioadOfp8+UEXueJXFTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679663637; 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=MkjNJ5mjAjla8hNfUrAZmgCMQn1ol72ers4R7nM/yZQ=; b=mTk1qv4ufqLBLXzx+lkdB+aOfAfn4y3vA5JNJxoVLDyhlnfel1WFjkqVSBK73MXjY2NuWM /rQsw8uI6VEPl5W53uhInnommyJYyMHUcWVgu30/nGO2lnqa68CZimgoRgJ+JpUFPqEl+0 4lUqhHSnh5jDzvp5voqCF/iQQ2dx1DwN4S+myrsBFhnO1hRIYOwXKVePQntqRhvCYHDELz D31SWSJtoxU7AMbxQjGT/iy2T2s+3giy+d8Hu7h9JwUcvoRU3TKo3unTwfJiFcl+gUwNew CY0GhgFgmi9/vyh/i61bB6+iFj7xs6ZrrLKtFSxi5JHov3XlrWEe8vPGQMWLPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679663637; a=rsa-sha256; cv=none; b=PI2pcAQH9Opm7pu4RxU2ANLFu6hy5CueZSZS4XVo/0o2uFXByLDtXgvdnR1emF5KNbWwM0 emBTEaaZO6/JUC91oUyJdI6qCWCluoUSEKddgDuq/M4s8wFDrLySHeV/LRRqQrwWSDgYVy Lk7rbB9vIWHQ5JAaagQOKguno72taaQiR/zfmLoTanc+espqgUno3eZMda3AYXd1cS8vOe 4rjX7GXeN/zalQG+cB4MqL/RpV5dRJjyVcFlhCCemDY5B0RAn0ILJvGuqmFqYK7dWoXZQn G/kdqRQ94Tk2IDDF4D6V+FPdckyienrHwD0dwdEPDAm5GG6Nf5YdeV4KbjH02Q== 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 4PjjMm68BszKCx; Fri, 24 Mar 2023 13:13:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32ODDuGF031175; Fri, 24 Mar 2023 13:13:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32ODDu8H031174; Fri, 24 Mar 2023 13:13:56 GMT (envelope-from git) Date: Fri, 24 Mar 2023 13:13:56 GMT Message-Id: <202303241313.32ODDu8H031174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9521266b82df - stable/13 - arm64/machdep: Add parameter to the EFI table walking code 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9521266b82dfaa82ca4ac56276a049aee5f01ad9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9521266b82dfaa82ca4ac56276a049aee5f01ad9 commit 9521266b82dfaa82ca4ac56276a049aee5f01ad9 Author: Warner Losh AuthorDate: 2022-11-30 23:28:01 +0000 Commit: Mitchell Horne CommitDate: 2023-03-24 13:12:40 +0000 arm64/machdep: Add parameter to the EFI table walking code It would be nice to be able to pass an arbitrary pointer to the callback code. Add one, and pass NULL in all the places that we do that today. As noted by andrew@, we should likely refactor this into MI code and use it here and amd64, but for the future. Sponsored by: Netflix Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D37439 (cherry picked from commit 6849950da7d770fa6531b915922799c20e960d42) --- sys/arm64/arm64/machdep.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 768d02b510b2..283ca221d7f3 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -420,10 +420,10 @@ arm64_get_writable_addr(vm_offset_t addr, vm_offset_t *out) return (false); } -typedef void (*efi_map_entry_cb)(struct efi_md *); +typedef void (*efi_map_entry_cb)(struct efi_md *, void *argp); static void -foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb) +foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb, void *argp) { struct efi_md *map, *p; size_t efisz; @@ -442,12 +442,12 @@ foreach_efi_map_entry(struct efi_map_header *efihdr, efi_map_entry_cb cb) for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, efihdr->descriptor_size)) { - cb(p); + cb(p, argp); } } static void -exclude_efi_map_entry(struct efi_md *p) +exclude_efi_map_entry(struct efi_md *p, void *argp __unused) { switch (p->md_type) { @@ -470,11 +470,11 @@ static void exclude_efi_map_entries(struct efi_map_header *efihdr) { - foreach_efi_map_entry(efihdr, exclude_efi_map_entry); + foreach_efi_map_entry(efihdr, exclude_efi_map_entry, NULL); } static void -add_efi_map_entry(struct efi_md *p) +add_efi_map_entry(struct efi_md *p, void *argp __unused) { switch (p->md_type) { @@ -512,12 +512,11 @@ add_efi_map_entry(struct efi_md *p) static void add_efi_map_entries(struct efi_map_header *efihdr) { - - foreach_efi_map_entry(efihdr, add_efi_map_entry); + foreach_efi_map_entry(efihdr, add_efi_map_entry, NULL); } static void -print_efi_map_entry(struct efi_md *p) +print_efi_map_entry(struct efi_md *p, void *argp __unused) { const char *type; static const char *types[] = { @@ -577,7 +576,7 @@ print_efi_map_entries(struct efi_map_header *efihdr) printf("%23s %12s %12s %8s %4s\n", "Type", "Physical", "Virtual", "#Pages", "Attr"); - foreach_efi_map_entry(efihdr, print_efi_map_entry); + foreach_efi_map_entry(efihdr, print_efi_map_entry, NULL); } #ifdef FDT