/*************************************************************************** * * Copyright (C) 2001 International Business Machines * All rights reserved. * * This file is part of the GPFS mmfslinux kernel module. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *************************************************************************** */ /* @(#)87 1.26 src/avs/fs/mmfs/ts/kernext/gpl-linux/arch-gpl.h, mmfs, avs_rgpfs24, rgpfs240610b 5/10/05 16:55:12 */ #ifndef _h_arch_gpl #define _h_arch_gpl #define LEVEL_1 // uncomment to get privilege level 1 where the storage is // NOT accessible by all users ??? #if defined(GPFS_ARCH_IA64) || defined(GPFS_ARCH_PPC64) \ || defined(GPFS_ARCH_X86_64) #define PGD_OFFSET(mm, page) pgd_offset_k(page) #else #define PGD_OFFSET(mm, page) pgd_offset(mm, page) #endif #ifdef GPFS_ARCH_IA64 /* In the kernel's mapped region we have a full 43 bit space available and completely ignore the region number (since we know its in region number 5).*/ #ifdef LEVEL_1 #define PRIVILEGE_FLAGS _PAGE_PL_1 // privilege level 1 #else #define PRIVILEGE_FLAGS _PAGE_PL_3 // privilege level 3(user) #endif #else //GPFS_ARCH_I386 #define PRIVILEGE_FLAGS _PAGE_USER #endif int kxSaveThreadInfo(int pid, void* reg); #ifdef GPFS_ARCH_IA64 int set_privilege_level(unsigned long progLevel); int get_privilege_level(); #else #define set_privilege_level(_a) 0 #define get_privilege_level(_a) 0 #endif #if LINUX_KERNEL_VERSION >= 2050000 #include #endif /* General macros for flushing tlb entries */ #if defined(GPFS_ARCH_POWER) || defined(GPFS_ARCH_PPC64) \ || defined(GPFS_ARCH_X86_64) #define FLUSH_TLB_PAGE(V,A) NOOP //??? #define FLUSH_TLB_RANGE(M,S,E) NOOP //??? #endif #ifdef GPFS_ARCH_I386 #define FLUSH_TLB_PAGE(V,A) flush_tlb_page(V,A) /* Temporary workaround for running i386 Linux distros on EM64T or x86-64 architecture; we need to flush the tlb on all cpus in this case in a rather convoluted manner (vfree) after changing the protection bits. This will go away with the use of pointer swizzling on ia32 in the near future. */ #define FLUSH_TLB_RANGE(M,S,E) \ { void *_tptr; \ _tptr = vmalloc(PAGE_SIZE); \ vfree(_tptr); \ } #define FLUSH_TLB_ALL() #endif /* GPFS_ARCH_I386 */ #if defined(GPFS_ARCH_IA64) #define FLUSH_TLB_PAGE(V,A) flush_tlb_page(V,A) #if LINUX_KERNEL_VERSION >= 2060500 /* flush_tlb_range now uses vma struct instead of mm struct. */ #define FLUSH_TLB_RANGE(M,S,E) \ { struct vm_area_struct vma; \ vma.vm_mm = M; \ flush_tlb_range(&vma,S,E); \ } #else #define FLUSH_TLB_RANGE(M,S,E) flush_tlb_range(M,S,E) #endif /* LINUX_KERNEL_VERSION >= 2060500 */ #define FLUSH_TLB_ALL() flush_tlb_all() #endif /* GPFS_ARCH_IA64 */ #endif /* _h_arch_gpl */