From nobody Fri Feb 09 18:44:22 2024 X-Original-To: dev-commits-src-main@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 4TWjSR22Hfz5B7tp; Fri, 9 Feb 2024 18:44:23 +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 4TWjSR1HQPz4g6f; Fri, 9 Feb 2024 18:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707504263; 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=ZP29np5ptdoxnrW7MvnEDrpM/7IZsb0Mdg3R5fm5Idc=; b=DdUAY1cDUOksggV6jKP7ids4OX/xd8A/lLwciDsAitZ7LFkOGQinY3133cAO2X0FWtMWvS NqW0YdrOBZrcyENI91W6tQ2ehF5tegB0srCY22RTPceF3qMuHgd6f4UTjuNgKGjfKWfNtb fC5mB7BTkrxlyDkrWNo/cVn8NTWRl6SCAYjA2rk3VaIIx6kmQOifZWrROyMTtUQb5dvXph UW+Kmy+BKZlc6uNRTU6XFbUh3gIIkJjbfsBcFyMH+5TgUj75HaOwYRYzGU+4k/egkMrNNJ 5S1lhasyf1CfbzJeaoAbl8mS+naXTsNYuOXqZXYBWi+vl0VzgSkLHx/Ca/bo8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707504263; 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=ZP29np5ptdoxnrW7MvnEDrpM/7IZsb0Mdg3R5fm5Idc=; b=AfgJB5NR00BngngNDfSpGOrr21l4emgMMELxgh0CYMgs5S8jbGQ10agxXK0NW3xAZrHDM3 aEluCqASojCaNxvoxCJA2sp/iwpJ08r2yoP0qO4DK6YBgwQlOPUZARxvaQ/wo9mIMiiBfI rOZ3EugKGN102Ixxhc5aREDnkAFtA4q+rjracGZd/75f04fwVG03hlX00Q8iGJhJe26sRJ dhPu9oqyc5tr+xbcmXiMCjkd5ohDMcDSu41WPvEFR03Vsz/UG0BDhRmq0dL/jmoZ5Iv7qA dtaSEEKAtweVEb4EVs3gy+Xz1E+2iwdVa4mjkqTqdL+kUlOBrOzLOvN/mfb52g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707504263; a=rsa-sha256; cv=none; b=e+mvg29tzQEk/mqNeYqe3VC5613rRR1Y9BT92U46dEDaMccIs18wpyPrT2esefPKjwyPBf dvzwBBpbg4I/+6fz4S0bx2iz85IQ5UadDnqXA/auOFqUOTN+Y8UuKThnn8PBNw8WB8s4XW Bnpoxnc9GaenbHSHryFXU0XKarvogio9VRzd2EhJCyVGZmN4RBhRZ6dZJprS+pMNLiWnf/ oMnI3sF3CFzlIo42SVjhrHkGiEBrz8Yplbil9146Nhl+38dACABVjbEbbTpfSbyi4cOL6d 6DPEA9LnKoyIC/X28H59c3SIZXpdwppKh6f89+tLdgsXGBYbUYk0Ppi8pQMM6Q== 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 4TWjSR0L2qzkPs; Fri, 9 Feb 2024 18:44:23 +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 419IiMuS054720; Fri, 9 Feb 2024 18:44:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 419IiM2K054717; Fri, 9 Feb 2024 18:44:22 GMT (envelope-from git) Date: Fri, 9 Feb 2024 18:44:22 GMT Message-Id: <202402091844.419IiM2K054717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0e72b8d36562 - main - acpi: Use kobj typedefs for new-bus method prototypes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e72b8d36562cb7ecf610dbd7357af830820e4b4 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0e72b8d36562cb7ecf610dbd7357af830820e4b4 commit 0e72b8d36562cb7ecf610dbd7357af830820e4b4 Author: John Baldwin AuthorDate: 2024-02-09 18:27:44 +0000 Commit: John Baldwin CommitDate: 2024-02-09 18:27:44 +0000 acpi: Use kobj typedefs for new-bus method prototypes Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43685 --- sys/dev/acpica/acpi.c | 80 ++++++++++++++++++++---------------------------- sys/dev/acpica/acpivar.h | 8 ++--- 2 files changed, 36 insertions(+), 52 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 7d1fc10afb9e..b2a337b3487d 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -111,52 +111,46 @@ static BOOLEAN acpi_sleep_states[ACPI_S_STATE_COUNT]; static void acpi_lookup(void *arg, const char *name, device_t *dev); static int acpi_modevent(struct module *mod, int event, void *junk); -static int acpi_probe(device_t dev); -static int acpi_attach(device_t dev); -static int acpi_suspend(device_t dev); -static int acpi_resume(device_t dev); -static int acpi_shutdown(device_t dev); -static device_t acpi_add_child(device_t bus, u_int order, const char *name, - int unit); -static int acpi_print_child(device_t bus, device_t child); -static void acpi_probe_nomatch(device_t bus, device_t child); -static void acpi_driver_added(device_t dev, driver_t *driver); -static void acpi_child_deleted(device_t dev, device_t child); -static int acpi_read_ivar(device_t dev, device_t child, int index, - uintptr_t *result); -static int acpi_write_ivar(device_t dev, device_t child, int index, - uintptr_t value); -static struct resource_list *acpi_get_rlist(device_t dev, device_t child); + +static device_probe_t acpi_probe; +static device_attach_t acpi_attach; +static device_suspend_t acpi_suspend; +static device_resume_t acpi_resume; +static device_shutdown_t acpi_shutdown; + +static bus_add_child_t acpi_add_child; +static bus_print_child_t acpi_print_child; +static bus_probe_nomatch_t acpi_probe_nomatch; +static bus_driver_added_t acpi_driver_added; +static bus_child_deleted_t acpi_child_deleted; +static bus_read_ivar_t acpi_read_ivar; +static bus_write_ivar_t acpi_write_ivar; +static bus_get_resource_list_t acpi_get_rlist; +static bus_set_resource_t acpi_set_resource; +static bus_alloc_resource_t acpi_alloc_resource; +static bus_adjust_resource_t acpi_adjust_resource; +static bus_release_resource_t acpi_release_resource; +static bus_delete_resource_t acpi_delete_resource; +static bus_child_pnpinfo_t acpi_child_pnpinfo_method; +static bus_child_location_t acpi_child_location_method; +static bus_hint_device_unit_t acpi_hint_device_unit; +static bus_get_property_t acpi_bus_get_prop; +static bus_get_device_path_t acpi_get_device_path; + +static acpi_id_probe_t acpi_device_id_probe; +static acpi_evaluate_object_t acpi_device_eval_obj; +static acpi_get_property_t acpi_device_get_prop; +static acpi_scan_children_t acpi_device_scan_children; + +static isa_pnp_probe_t acpi_isa_pnp_probe; + static void acpi_reserve_resources(device_t dev); static int acpi_sysres_alloc(device_t dev); -static int acpi_set_resource(device_t dev, device_t child, int type, - int rid, rman_res_t start, rman_res_t count); -static struct resource *acpi_alloc_resource(device_t bus, device_t child, - int type, int *rid, rman_res_t start, rman_res_t end, - rman_res_t count, u_int flags); -static int acpi_adjust_resource(device_t bus, device_t child, int type, - struct resource *r, rman_res_t start, rman_res_t end); -static int acpi_release_resource(device_t bus, device_t child, int type, - int rid, struct resource *r); -static void acpi_delete_resource(device_t bus, device_t child, int type, - int rid); static uint32_t acpi_isa_get_logicalid(device_t dev); static int acpi_isa_get_compatid(device_t dev, uint32_t *cids, int count); -static ssize_t acpi_bus_get_prop(device_t bus, device_t child, const char *propname, - void *propvalue, size_t size, device_property_type_t type); -static int acpi_device_id_probe(device_t bus, device_t dev, char **ids, char **match); -static ACPI_STATUS acpi_device_eval_obj(device_t bus, device_t dev, - ACPI_STRING pathname, ACPI_OBJECT_LIST *parameters, - ACPI_BUFFER *ret); -static ACPI_STATUS acpi_device_get_prop(device_t bus, device_t dev, - ACPI_STRING propname, const ACPI_OBJECT **value); static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, UINT32 level, void *context, void **retval); -static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev, - int max_depth, acpi_scan_cb_t user_fn, void *arg); static ACPI_STATUS acpi_find_dsd(struct acpi_device *ad); -static int acpi_isa_pnp_probe(device_t bus, device_t child, - struct isa_pnp_id *ids); static void acpi_platform_osc(device_t dev); static void acpi_probe_children(device_t bus); static void acpi_probe_order(ACPI_HANDLE handle, int *order); @@ -181,15 +175,7 @@ static int acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_debug_objects_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_pm_func(u_long cmd, void *arg, ...); -static int acpi_child_location_method(device_t acdev, device_t child, - struct sbuf *sb); -static int acpi_child_pnpinfo_method(device_t acdev, device_t child, - struct sbuf *sb); -static int acpi_get_device_path(device_t bus, device_t child, - const char *locator, struct sbuf *sb); static void acpi_enable_pcie(void); -static void acpi_hint_device_unit(device_t acdev, device_t child, - const char *name, int *unitp); static void acpi_reset_interfaces(device_t dev); static device_method_t acpi_methods[] = { diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 4d76a77cdbf8..bb969821b945 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -462,8 +462,7 @@ EVENTHANDLER_DECLARE(acpi_video_event, acpi_event_handler_t); /* Device power control. */ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable); ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state); -int acpi_device_pwr_for_sleep(device_t bus, device_t dev, - int *dstate); +acpi_pwr_for_sleep_t acpi_device_pwr_for_sleep; int acpi_set_powerstate(device_t child, int state); /* APM emulation */ @@ -578,9 +577,8 @@ int acpi_pxm_get_cpu_locality(int apic_id); * Returns the VM domain ID if found, or -1 if not found / invalid. */ int acpi_map_pxm_to_vm_domainid(int pxm); -int acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, - size_t setsize, cpuset_t *cpuset); -int acpi_get_domain(device_t dev, device_t child, int *domain); +bus_get_cpus_t acpi_get_cpus; +bus_get_domain_t acpi_get_domain; #ifdef __aarch64__ /*