summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/include/llvm-c/Support.h
diff options
context:
space:
mode:
authorzbb <zbb@FreeBSD.org>2015-07-09 11:32:29 +0000
committerzbb <zbb@FreeBSD.org>2015-07-09 11:32:29 +0000
commit99ff382570a14b26be5e95ed8886d0936ca03502 (patch)
tree62da4bc6a8ad154f56ea07d47a54d6fadc13432b /contrib/llvm/include/llvm-c/Support.h
parent58e696649e35af551042cee351aacf02aefae047 (diff)
downloadFreeBSD-src-99ff382570a14b26be5e95ed8886d0936ca03502.zip
FreeBSD-src-99ff382570a14b26be5e95ed8886d0936ca03502.tar.gz
Rework CPU identification on ARM64
This commit reworks the code responsible for identification of the CPUs during runtime. It is necessary to provide a way for workarounds and erratums to be applied only for certain HW versions. The copy of MIDR is now stored in pcpu to provide a fast and convenient way for assambly code to read it (pcpu is used quite often so there is a chance it's inside the cache). The MIDR is also better way of identification than using user-friendly cpu_desc structure, because it can be compiled into comparision of single u32 with only one access to the memory - this is crucial for some erratums which are called from performance-critical places. Changes in cpu_identify makes this function safe to be called on non-boot CPUs. New function CPU_MATCH was implemented which returns boolean value based on mathing masked MIDR with chip identification. Example of usage: printf("is thunder: %d\n", CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0)); printf("is generic: %d\n", CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, CPU_IMPL_ARM, CPU_PART_FOUNDATION, 0, 0)); Reviewed by: andrew Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3030
Diffstat (limited to 'contrib/llvm/include/llvm-c/Support.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud