Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\aperture_64.c Create Date:2022-07-28 08:53:02
Last Modify:2020-03-17 10:38:51 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Read a standard AGPv3 bridge header

Proto:static unsigned int __init read_agp(int bus, int slot, int func, int cap, unsigned int *order)

Type:unsigned int

Parameter:

TypeParameterName
intbus
intslot
intfunc
intcap
unsigned int *order
167  pr_info("pci 0000:%02x:%02x:%02x: AGP bridge\n", bus, slot, func)
168  apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14)
169  If apsizereg == 0xffffffff Then
170  pr_err("pci 0000:%02x:%02x.%d: APSIZE unreadable\n", bus, slot, func)
172  Return 0
176  old_order = order
178  apsize = apsizereg & 0xfff
180  If apsize & 0xff Then apsize |= 0xf00
182  nbits = returns the hamming weight of a N-bit word(apsize)
183  order = 7 - nbits
184  If ((int) * order < 0) Then order = 0
187  aper_low = Direct PCI access. This is used for PCI accesses in early boot beforethe PCI subsystem works.
188  aper_hi = Direct PCI access. This is used for PCI accesses in early boot beforethe PCI subsystem works.
189  aper = aper_low & ~((1 << 22) - 1) | aper_hi << 32
195  pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (old size %uMB)\n", bus, slot, func, aper, aper + (32ULL << (old_order + 20)) - 1, 32 << old_order)
198  If aper + (32ULL << 20 + order ) > 0x100000000ULL Then
199  pr_info("pci 0000:%02x:%02x.%d: AGP aperture size %uMB (APSIZE %#x) is not right, using settings from NB\n", bus, slot, func, 32 << * order, apsizereg)
201  order = old_order
204  pr_info("pci 0000:%02x:%02x.%d: AGP aperture [bus addr %#010Lx-%#010Lx] (%uMB, APSIZE %#x)\n", bus, slot, func, aper, aper + (32ULL << ( * order + 20)) - 1, 32 << * order, apsizereg)
208  If Not aperture_valid(aper, (32 * 1024 * 1024) << * order, 32 << 20) Then Return 0
210  Return aper
Caller
NameDescribe
search_agp_bridgeLook for an AGP bridge