From 14e14cc4e9407783a559b22dffd4bd2062714dd5 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 21 Oct 2022 20:19:28 -0700 Subject: [PATCH] ANDROID: kleaf: Initial list of ddk_headers (1: Pixel) This CL includes headers used by the external modules of a real Pixel device. Allowlist: This is a list of headers and a list of include directories that are known to be safe to be used by modules. - This list includes: - Everything under - arch/arm64/include - include Unsafe list: This is the list of headers that are known to be used by a certain Pixel device kernel build, minus allowlist. This means, with the allowlist and unsafe list, the certain Pixel device kernel build can be transitioned to DDK without any change to the source code. - Note that for cleaness of DDK modules, we may want to remove some items in the allowlist of includes and require device source code to #include from the correct directory. The command to generate this list is: bazel run //build/kernel/kleaf:gen_ddk_headers \ --gen_ddk_headers_target=//gs/google-modules/soc-modules:slider_modules_install -- -k Manual edits: - manually removed the following headers that no longer exist on android14-5.15: remove hdrs arch/arm64/kvm/hyp/include/nvhe/ffa.h|//common:all_headers_unsafe remove hdrs arch/arm64/kvm/hyp/include/nvhe/iommu.h|//common:all_headers_unsafe remove hdrs arch/arm64/kvm/hyp/include/nvhe/pkvm.h|//common:all_headers_unsafe remove hdrs drivers/scsi/ufs/ufs.h|//common:all_headers_unsafe remove hdrs drivers/scsi/ufs/ufs_quirks.h|//common:all_headers_unsafe remove hdrs drivers/scsi/ufs/ufshcd.h|//common:all_headers_unsafe remove hdrs drivers/scsi/ufs/ufshcd-crypto.h|//common:all_headers_unsafe remove hdrs drivers/scsi/ufs/ufshcd-pltfrm.h|//common:all_headers_unsafe remove hdrs drivers/scsi/ufs/ufshci.h|//common:all_headers_unsafe remove hdrs drivers/scsi/ufs/unipro.h|//common:all_headers_unsafe - manually remove a source: remove hdrs lib/vdso/gettimeofday.c|//common:all_headers_unsafe Bug: 248351908 Change-Id: Ie75c45f1646ec6055dcdb6f49d3001691581c046 Signed-off-by: Yifan Hong --- BUILD.bazel | 55 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index e9df6eec9ea0..7e08410d8081 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -268,10 +268,15 @@ ddk_headers( # directories that are safe to use in DDK modules. ddk_headers( name = "all_headers_allowlist", - hdrs = [], + hdrs = [":all_headers_allowlist_globs"], # The list of include directories where source files can #include headers # from. In other words, these are the `-I` option to the C compiler. - includes = [], + includes = [ + "arch/arm64/include", + "arch/arm64/include/uapi", + "include", + "include/uapi", + ], visibility = ["//visibility:private"], ) @@ -280,7 +285,10 @@ ddk_headers( # are safe to use. filegroup( name = "all_headers_allowlist_globs", - srcs = [], + srcs = glob([ + "arch/arm64/include/**/*.h", + "include/**/*.h", + ]), visibility = ["//visibility:private"], ) @@ -292,9 +300,46 @@ filegroup( # - be moved into all_headers ddk_headers( name = "all_headers_unsafe", - hdrs = [], + hdrs = [ + "drivers/devfreq/governor.h", + "drivers/dma-buf/heaps/deferred-free-helper.h", + "drivers/dma-buf/heaps/page_pool.h", + "drivers/dma/dmaengine.h", + "drivers/pci/controller/dwc/pcie-designware.h", + "drivers/pinctrl/core.h", + "drivers/pinctrl/samsung/pinctrl-samsung.h", + "drivers/staging/android/debug_kinfo.h", + "drivers/thermal/thermal_core.h", + "drivers/thermal/thermal_netlink.h", + "drivers/usb/core/phy.h", + "drivers/usb/dwc3/core.h", + "drivers/usb/dwc3/debug.h", + "drivers/usb/dwc3/gadget.h", + "drivers/usb/dwc3/io.h", + "drivers/usb/dwc3/trace.h", + "drivers/usb/gadget/configfs.h", + "drivers/usb/gadget/function/u_serial.h", + "drivers/usb/host/pci-quirks.h", + "drivers/usb/host/xhci.h", + "drivers/usb/host/xhci-ext-caps.h", + "drivers/usb/host/xhci-mvebu.h", + "drivers/usb/host/xhci-plat.h", + "drivers/usb/host/xhci-rcar.h", + "drivers/usb/typec/tcpm/tcpci.h", + ], # The list of include directories where source files can #include headers # from. In other words, these are the `-I` option to the C compiler. - includes = [], + includes = [ + "drivers/devfreq", + "drivers/dma", + "drivers/dma-buf", + "drivers/pci/controller/dwc", + "drivers/pinctrl", + "drivers/scsi/ufs", + "drivers/thermal", + "drivers/usb", + "drivers/usb/gadget/function", + "drivers/usb/typec", + ], visibility = ["//visibility:private"], )