1 /* 2 * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU) 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifndef COMMON_VARS_H 13 #define COMMON_VARS_H 14 15 /* Leave 8K space to per-CPU stack */ 16 #define CPU_STACK_SIZE 4096 17 #define STACK_ALIGNMENT 16 18 19 #ifndef KBASE 20 #if __SIZEOF_POINTER__ == 4 /* 32-bit architecture */ 21 #define KBASE 0xc0000000 22 #else /* 64-bit architecture */ 23 #define KBASE 0xffffff0000000000 24 #endif 25 #endif 26 27 #endif /* COMMON_VARS_H */