mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
There are two ways for translating va to pa for csky: - Use TLB(Translate Lookup Buffer) and PTW (Page Table Walk) - Use SSEG0/1 (Simple Segment Mapping) We use tlb mapping 0-2G and 3G-4G virtual address area and SSEG0/1 are for 2G-2.5G and 2.5G-3G translation. We could disable SSEG0 to use 2G-2.5G as TLB user mapping. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
19 lines
522 B
C
19 lines
522 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
|
|
|
|
#ifndef __ASM_CSKY_SEGMENT_H
|
|
#define __ASM_CSKY_SEGMENT_H
|
|
|
|
typedef struct {
|
|
unsigned long seg;
|
|
} mm_segment_t;
|
|
|
|
#define KERNEL_DS ((mm_segment_t) { 0xFFFFFFFF })
|
|
|
|
#define USER_DS ((mm_segment_t) { PAGE_OFFSET })
|
|
#define get_fs() (current_thread_info()->addr_limit)
|
|
#define set_fs(x) (current_thread_info()->addr_limit = (x))
|
|
#define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
|
|
|
|
#endif /* __ASM_CSKY_SEGMENT_H */
|