函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:arch\x86\include\asm\numachip\numachip_csr.h Create Date:2022-07-27 09:30:49
首页 Copyright©Brick

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#endif /* _ASM_X86_NUMACHIP_NUMACHIP_H */
#include <asm/numachip/numachip_csr.h>
/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Numascale NumaConnect-Specific Header file
 *
 * Copyright (C) 2011 Numascale AS. All rights reserved.
 *
 * Send feedback to <support@numascale.com>
 *
 */
 
#ifndef _ASM_X86_NUMACHIP_NUMACHIP_CSR_H
#define _ASM_X86_NUMACHIP_NUMACHIP_CSR_H
 
#include <linux/smp.h>
#include <linux/io.h>
 
#define CSR_NODE_SHIFT      16
#define CSR_NODE_BITS(p)    (((unsigned long)(p)) << CSR_NODE_SHIFT)
#define CSR_NODE_MASK       0x0fff      /* 4K nodes */
 
/* 32K CSR space, b15 indicates geo/non-geo */
#define CSR_OFFSET_MASK 0x7fffUL
#define CSR_G0_NODE_IDS (0x008 + (0 << 12))
#define CSR_G3_EXT_IRQ_GEN (0x030 + (3 << 12))
 
/*
 * Local CSR space starts in global CSR space with "nodeid" = 0xfff0, however
 * when using the direct mapping on x86_64, both start and size needs to be
 * aligned with PMD_SIZE which is 2M
 */
#define NUMACHIP_LCSR_BASE  0x3ffffe000000ULL
#define NUMACHIP_LCSR_LIM   0x3fffffffffffULL
#define NUMACHIP_LCSR_SIZE  (NUMACHIP_LCSR_LIM - NUMACHIP_LCSR_BASE + 1)
#define NUMACHIP_LAPIC_BITS 8
 
static inline void *lcsr_address(unsigned long offset)
{
    return __va(NUMACHIP_LCSR_BASE | (1UL << 15) |
        CSR_NODE_BITS(0xfff0) | (offset & CSR_OFFSET_MASK));
}