Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\mtrr\generic.c Create Date:2022-07-28 08:06:13
Last Modify:2022-05-18 17:45:43 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:generic_get_mtrr

Proto:static void generic_get_mtrr(unsigned int reg, unsigned long *base, unsigned long *size, mtrr_type *type)

Type:void

Parameter:

TypeParameterName
unsigned intreg
unsigned long *base
unsigned long *size
mtrr_type *type
590  get_cpu()
592  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(MTRRphysMask_MSR(reg), mask_lo, mask_hi)
594  If (mask_lo & 0x800) == 0 Then
596  base = 0
597  size = 0
598  type = 0
599  Go to out_put_cpu
602  Access to machine-specific registers (available on 586 and better only)* Note: the rd* operations modify the parameters directly (without using* pointer indirection), this allows gcc to optimize better(MTRRphysBase_MSR(reg), base_lo, base_hi)
605  tmp = mask_hi << 32 - PAGE_SHIFT determines the page size | mask_lo >> PAGE_SHIFT determines the page size
606  mask = size_or_mask | tmp
609  hi = ls64 - find last set bit in a 64-bit word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffsll, but returns the position of the most significant set bit
610  If hi > 0 Then
611  tmp |= ~((1ULL << hi - 1 ) - 1)
613  If tmp != mask Then
614  pr_warn("mtrr: your BIOS has configured an incorrect mask, fixing it.\n")
616  mask = tmp
624  size = -mask
625  base = base_hi << 32 - PAGE_SHIFT determines the page size | base_lo >> PAGE_SHIFT determines the page size
626  type = base_lo & 0xff
628  out_put_cpu :
629  put_cpu()