sr.h (6f3544cd7084abbadd83637993a4f41fd30e6ccd) | sr.h (54c562081ff82b6429078f76d44491e7d1e95673) |
---|---|
1/*- 2 * Copyright (C) 2002 Benno Rice. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 38#define SR_TYPE 0x80000000 /* Type selector */ 39#define SR_KS 0x40000000 /* Supervisor-state protection key */ 40#define SR_KP 0x20000000 /* User-state protection key */ 41#define SR_N 0x10000000 /* No-execute protection */ 42#define SR_VSID_MASK 0x00ffffff /* Virtual Segment ID mask */ 43 44/* Kernel segment register usage */ | 1/*- 2 * Copyright (C) 2002 Benno Rice. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 38#define SR_TYPE 0x80000000 /* Type selector */ 39#define SR_KS 0x40000000 /* Supervisor-state protection key */ 40#define SR_KP 0x20000000 /* User-state protection key */ 41#define SR_N 0x10000000 /* No-execute protection */ 42#define SR_VSID_MASK 0x00ffffff /* Virtual Segment ID mask */ 43 44/* Kernel segment register usage */ |
45#ifdef __powerpc64__ 46#define USER_SR 63 47#else | |
48#define USER_SR 12 | 45#define USER_SR 12 |
49#endif | |
50#define KERNEL_SR 13 51#define KERNEL2_SR 14 52#define KERNEL3_SR 15 53#define KERNEL_VSIDBITS 0xfffffUL 54#define KERNEL_SEGMENT (0xfffff0 + KERNEL_SR) 55#define KERNEL2_SEGMENT (0xfffff0 + KERNEL2_SR) 56#define EMPTY_SEGMENT 0xfffff0 57#ifdef __powerpc64__ 58#define USER_ADDR 0xcffffffff0000000UL 59#else 60#define USER_ADDR ((uintptr_t)USER_SR << ADDR_SR_SHFT) 61#endif 62#define SEGMENT_LENGTH 0x10000000UL 63#define SEGMENT_INVMASK 0x0fffffffUL 64#define SEGMENT_MASK ~SEGMENT_INVMASK 65 66#endif /* !_MACHINE_SR_H_ */ | 46#define KERNEL_SR 13 47#define KERNEL2_SR 14 48#define KERNEL3_SR 15 49#define KERNEL_VSIDBITS 0xfffffUL 50#define KERNEL_SEGMENT (0xfffff0 + KERNEL_SR) 51#define KERNEL2_SEGMENT (0xfffff0 + KERNEL2_SR) 52#define EMPTY_SEGMENT 0xfffff0 53#ifdef __powerpc64__ 54#define USER_ADDR 0xcffffffff0000000UL 55#else 56#define USER_ADDR ((uintptr_t)USER_SR << ADDR_SR_SHFT) 57#endif 58#define SEGMENT_LENGTH 0x10000000UL 59#define SEGMENT_INVMASK 0x0fffffffUL 60#define SEGMENT_MASK ~SEGMENT_INVMASK 61 62#endif /* !_MACHINE_SR_H_ */ |