diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-09-12 17:55:27 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-09-12 17:55:27 +0100 |
commit | e567964a54b854354492a90d4d2c1e9541e4901d (patch) | |
tree | 6bee1a782c03463d08fa0e75fca418ae9dbe135f /extras/mini-os/include | |
parent | 2fcb3c6fc7ed6f5a5f96aed63b6b6d3a19a3fafc (diff) | |
download | xen-e567964a54b854354492a90d4d2c1e9541e4901d.tar.gz xen-e567964a54b854354492a90d4d2c1e9541e4901d.tar.bz2 xen-e567964a54b854354492a90d4d2c1e9541e4901d.zip |
tools: drop ia64 support
Removed support from libxc and mini-os.
This also took me under xen/include/public via various symlinks.
Dropped tools/debugger/xenitp entirely, it was described upon commit
as:
"Xenitp is a low-level debugger for ia64" and doesn't appear to be
linked into the build anywhere.
99 files changed, 14 insertions(+), 32361 deletions(-)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'extras/mini-os/include')
21 files changed, 4 insertions, 2940 deletions
diff --git a/extras/mini-os/include/hypervisor.h b/extras/mini-os/include/hypervisor.h index e299df1f73..a62cb78463 100644 --- a/extras/mini-os/include/hypervisor.h +++ b/extras/mini-os/include/hypervisor.h @@ -7,7 +7,6 @@ * Copyright (c) 2002, K A Fraser * Copyright (c) 2005, Grzegorz Milos * Updates: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com> - * Updates: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> for ia64 */ #ifndef _HYPERVISOR_H_ @@ -19,8 +18,6 @@ #include <hypercall-x86_32.h> #elif defined(__x86_64__) #include <hypercall-x86_64.h> -#elif defined(__ia64__) -#include <hypercall-ia64.h> #else #error "Unsupported architecture" #endif diff --git a/extras/mini-os/include/ia64/arch_limits.h b/extras/mini-os/include/ia64/arch_limits.h deleted file mode 100644 index c7bb9b6573..0000000000 --- a/extras/mini-os/include/ia64/arch_limits.h +++ /dev/null @@ -1,12 +0,0 @@ - -#ifndef __ARCH_LIMITS_H__ -#define __ARCH_LIMITS_H__ - -/* Commonly 16K pages are used. */ -#define __PAGE_SHIFT 14 /* 16K pages */ -#define __PAGE_SIZE (1<<(__PAGE_SHIFT)) - -#define __STACK_SIZE_PAGE_ORDER 2 -#define __STACK_SIZE (__PAGE_SIZE * (1 << __STACK_SIZE_PAGE_ORDER)) - -#endif /* __ARCH_LIMITS_H__ */ diff --git a/extras/mini-os/include/ia64/arch_mm.h b/extras/mini-os/include/ia64/arch_mm.h deleted file mode 100644 index 8889164533..0000000000 --- a/extras/mini-os/include/ia64/arch_mm.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2007 - Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * - **************************************************************************** - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef __ARCH_MM_H__ -#define __ARCH_MM_H__ - -#include "page.h" -#include "ia64_cpu.h" - -#define PFN_PHYS(x) (pfn_to_page(x)) -#define PHYS_PFN(x) (page_to_pfn(x)) -#define to_virt(x) __va(x) -#define to_phys(x) __pa(x) - -#define virt_to_mfn(x) virt_to_pfn(x) -#define virtual_to_mfn(x) (ia64_tpa((uint64_t)(x)) >> PAGE_SHIFT) - -#define map_frames(f, n) map_frames_ex(f, n, 1, 0, 1, DOMID_SELF, NULL, 0) -/* TODO */ -#define map_zero(n, a) map_frames_ex(NULL, n, 0, 0, a, DOMID_SELF, NULL, 0) -#define do_map_zero(start, n) ASSERT(n == 0) - -#endif /* __ARCH_MM_H__ */ diff --git a/extras/mini-os/include/ia64/arch_sched.h b/extras/mini-os/include/ia64/arch_sched.h deleted file mode 100644 index f5714a3b6d..0000000000 --- a/extras/mini-os/include/ia64/arch_sched.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2006 Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * All rights reserved. - * - * The file contains ia64 specific scheduler declarations. - * - **************************************************************************** - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef __ARCH_SCHED_H__ -#define __ARCH_SCHED_H__ - -#include "os.h" - -struct thread; /* Only declaration */ - -struct thread_regs -{ - unsigned long unat_b; /* NaT before spilling */ - unsigned long sp; - unsigned long rp; - unsigned long pr; - unsigned long bsp; - unsigned long pfs; - unsigned long rnat; - unsigned long lc; - - unsigned long unat_a; /* NaT after spilling. */ - unsigned long r4; - unsigned long r5; - unsigned long r6; - unsigned long r7; - - unsigned long b1; - unsigned long b2; - unsigned long b3; - unsigned long b4; - unsigned long b5; - - ia64_fpreg_t f2; - ia64_fpreg_t f3; - ia64_fpreg_t f4; - ia64_fpreg_t f5; - ia64_fpreg_t f16; - ia64_fpreg_t f17; - ia64_fpreg_t f18; - ia64_fpreg_t f19; - ia64_fpreg_t f20; - ia64_fpreg_t f21; - ia64_fpreg_t f22; - ia64_fpreg_t f23; - ia64_fpreg_t f24; - ia64_fpreg_t f25; - ia64_fpreg_t f26; - ia64_fpreg_t f27; - ia64_fpreg_t f28; - ia64_fpreg_t f29; - ia64_fpreg_t f30; - ia64_fpreg_t f31; -}; - -typedef struct thread_regs thread_regs_t; - -void arch_switch_threads(struct thread* prev, struct thread* next); - -static inline struct thread* get_current(void) -{ - register struct thread *current asm("r13"); - return current; -} - - -#endif /* __ARCH_SCHED_H__ */ diff --git a/extras/mini-os/include/ia64/arch_spinlock.h b/extras/mini-os/include/ia64/arch_spinlock.h deleted file mode 100644 index 60712b54c9..0000000000 --- a/extras/mini-os/include/ia64/arch_spinlock.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com - * The file contains ia64 special spinlock stuff. - * - **************************************************************************** - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef _ARCH_SPINLOCK_H_ -#define _ARCH_SPINLOCK_H_ - -#include "atomic.h" - -#define ARCH_SPIN_LOCK_UNLOCKED { 0 } - -#define SPIN_LOCK_UNUSED 0 -#define SPIN_LOCK_USED 1 - - -static inline void -_raw_spin_lock(spinlock_t* lck) -{ - uint32_t ret; - do { - ret = ia64_cmpxchg_acq_32(&(lck->slock), - SPIN_LOCK_UNUSED, SPIN_LOCK_USED); - } while (ret == SPIN_LOCK_USED); -} - -static inline void -_raw_spin_unlock(spinlock_t *lck) -{ - asm volatile ("st4.rel.nta [%0] = r0\n\t" :: "r"(&(lck->slock)) - : "memory" ); -} - -static inline uint32_t -_raw_spin_trylock(spinlock_t* lck) -{ - uint32_t ret; - ret = ia64_cmpxchg_acq_32(&(lck->slock), SPIN_LOCK_USED, SPIN_LOCK_USED); - return (ret == SPIN_LOCK_USED); -} - -#endif /* _ARCH_SPINLOCK_H_ */ diff --git a/extras/mini-os/include/ia64/asm.h b/extras/mini-os/include/ia64/asm.h deleted file mode 100644 index d96216f14c..0000000000 --- a/extras/mini-os/include/ia64/asm.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com - */ - -#if !defined(_ASM_H_) -#define _ASM_H_ - -#define ENTRY(_name_) \ - .global _name_; \ - .align 16; \ - .proc _name_; \ -_name_:; \ - - -#define END(_name_) \ - .endp _name_ - -#endif /* !defined(_ASM_H_) */ diff --git a/extras/mini-os/include/ia64/atomic.h b/extras/mini-os/include/ia64/atomic.h deleted file mode 100644 index ba5aa16517..0000000000 --- a/extras/mini-os/include/ia64/atomic.h +++ /dev/null @@ -1,504 +0,0 @@ -/* - * This code is mostly taken from FreeBSD machine/atomic.h - * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * - **************************************************************************** - * Copyright (c) 1998 Doug Rabson - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#ifndef _MACHINE_ATOMIC_H_ -#define _MACHINE_ATOMIC_H_ - -/* - * Various simple arithmetic on memory which is atomic in the presence - * of interrupts and SMP safe. - */ - -#if !defined(__ASSEMBLY__) - -#include <mini-os/types.h> - - -/* - * Everything is built out of cmpxchg. - */ -#define IA64_CMPXCHG(sz, sem, p, cmpval, newval, ret) \ - __asm __volatile ( \ - "mov ar.ccv=%2;;\n\t" \ - "cmpxchg" #sz "." #sem " %0=%4,%3,ar.ccv\n\t" \ - : "=r" (ret), "=m" (*p) \ - : "r" (cmpval), "r" (newval), "m" (*p) \ - : "memory") - - -/* - * Some common forms of cmpxch. - */ - -static __inline uint8_t -ia64_cmpxchg_acq_8(volatile uint8_t* p, uint8_t cmpval, uint8_t newval) -{ - uint8_t ret; - - IA64_CMPXCHG(1, acq, p, cmpval, newval, ret); - return (ret); -} - -static __inline uint16_t -ia64_cmpxchg_acq_16(volatile uint16_t* p, uint16_t cmpval, uint16_t newval) -{ - uint16_t ret; - - IA64_CMPXCHG(2, acq, p, cmpval, newval, ret); - return (ret); -} - -static __inline uint32_t -ia64_cmpxchg_acq_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval) -{ - uint32_t ret; - - IA64_CMPXCHG(4, acq, p, cmpval, newval, ret); - return (ret); -} - -static __inline uint32_t -ia64_cmpxchg_rel_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval) -{ - uint32_t ret; - - IA64_CMPXCHG(4, rel, p, cmpval, newval, ret); - return (ret); -} - -static __inline uint64_t -ia64_cmpxchg_acq_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval) -{ - uint64_t ret; - - IA64_CMPXCHG(8, acq, p, cmpval, newval, ret); - return (ret); -} - -static __inline uint64_t -ia64_cmpxchg_rel_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval) -{ - uint64_t ret; - - IA64_CMPXCHG(8, rel, p, cmpval, newval, ret); - return (ret); -} - -#define ATOMIC_STORE_LOAD(type, width, size) \ -static __inline uint##width##_t \ -ia64_ld_acq_##width(volatile uint##width##_t* p) \ -{ \ - uint##width##_t v; \ - \ - __asm __volatile ("ld" size ".acq %0=%1" \ - : "=r" (v) \ - : "m" (*p) \ - : "memory"); \ - return (v); \ -} \ - \ -static __inline uint##width##_t \ -atomic_load_acq_##width(volatile uint##width##_t* p) \ -{ \ - uint##width##_t v; \ - \ - __asm __volatile ("ld" size ".acq %0=%1" \ - : "=r" (v) \ - : "m" (*p) \ - : "memory"); \ - return (v); \ -} \ - \ -static __inline uint##width##_t \ -atomic_load_acq_##type(volatile uint##width##_t* p) \ -{ \ - uint##width##_t v; \ - \ - __asm __volatile ("ld" size ".acq %0=%1" \ - : "=r" (v) \ - : "m" (*p) \ - : "memory"); \ - return (v); \ -} \ - \ -static __inline void \ -ia64_st_rel_##width(volatile uint##width##_t* p, uint##width##_t v)\ -{ \ - __asm __volatile ("st" size ".rel %0=%1" \ - : "=m" (*p) \ - : "r" (v) \ - : "memory"); \ -} \ - \ -static __inline void \ -atomic_store_rel_##width(volatile uint##width##_t* p, uint##width##_t v)\ -{ \ - __asm __volatile ("st" size ".rel %0=%1" \ - : "=m" (*p) \ - : "r" (v) \ - : "memory"); \ -} \ - \ -static __inline void \ -atomic_store_rel_##type(volatile uint##width##_t* p, uint##width##_t v)\ -{ \ - __asm __volatile ("st" size ".rel %0=%1" \ - : "=m" (*p) \ - : "r" (v) \ - : "memory"); \ -} - -ATOMIC_STORE_LOAD(char, 8, "1") -ATOMIC_STORE_LOAD(short, 16, "2") -ATOMIC_STORE_LOAD(int, 32, "4") -ATOMIC_STORE_LOAD(long, 64, "8") - -#undef ATOMIC_STORE_LOAD - -#define IA64_ATOMIC(sz, type, name, width, op) \ - \ -static __inline type \ -atomic_##name##_acq_##width(volatile type *p, type v) \ -{ \ - type old, ret; \ - do { \ - old = *p; \ - IA64_CMPXCHG(sz, acq, p, old, old op v, ret); \ - } while (ret != old); \ - return(ret); \ -} \ - \ -static __inline type \ -atomic_##name##_rel_##width(volatile type *p, type v) \ -{ \ - type old, ret; \ - do { \ - old = *p; \ - IA64_CMPXCHG(sz, rel, p, old, old op v, ret); \ - } while (ret != old); \ - return(ret); \ -} - -IA64_ATOMIC(1, uint8_t, set, 8, |) -IA64_ATOMIC(2, uint16_t, set, 16, |) -IA64_ATOMIC(4, uint32_t, set, 32, |) -IA64_ATOMIC(8, uint64_t, set, 64, |) - -IA64_ATOMIC(1, uint8_t, clear, 8, &~) -IA64_ATOMIC(2, uint16_t, clear, 16, &~) -IA64_ATOMIC(4, uint32_t, clear, 32, &~) -IA64_ATOMIC(8, uint64_t, clear, 64, &~) - -IA64_ATOMIC(1, uint8_t, add, 8, +) -IA64_ATOMIC(2, uint16_t, add, 16, +) -IA64_ATOMIC(4, uint32_t, add, 32, +) -IA64_ATOMIC(8, uint64_t, add, 64, +) - -IA64_ATOMIC(1, uint8_t, subtract, 8, -) -IA64_ATOMIC(2, uint16_t, subtract, 16, -) -IA64_ATOMIC(4, uint32_t, subtract, 32, -) -IA64_ATOMIC(8, uint64_t, subtract, 64, -) - -#undef IA64_ATOMIC -#undef IA64_CMPXCHG - -#define atomic_set_8 atomic_set_acq_8 -#define atomic_clear_8 atomic_clear_acq_8 -#define atomic_add_8 atomic_add_acq_8 -#define atomic_subtract_8 atomic_subtract_acq_8 - -#define atomic_set_16 atomic_set_acq_16 -#define atomic_clear_16 atomic_clear_acq_16 -#define atomic_add_16 atomic_add_acq_16 -#define atomic_subtract_16 atomic_subtract_acq_16 - -#define atomic_set_32 atomic_set_acq_32 -#define atomic_clear_32 atomic_clear_acq_32 -#define atomic_add_32 atomic_add_acq_32 -#define atomic_subtract_32 atomic_subtract_acq_32 - -#define atomic_set_64 atomic_set_acq_64 -#define atomic_clear_64 atomic_clear_acq_64 -#define atomic_add_64 atomic_add_acq_64 -#define atomic_subtract_64 atomic_subtract_acq_64 - -#define atomic_set_char atomic_set_8 -#define atomic_clear_char atomic_clear_8 -#define atomic_add_char atomic_add_8 -#define atomic_subtract_char atomic_subtract_8 -#define atomic_set_acq_char atomic_set_acq_8 -#define atomic_clear_acq_char atomic_clear_acq_8 -#define atomic_add_acq_char atomic_add_acq_8 -#define atomic_subtract_acq_char atomic_subtract_acq_8 -#define atomic_set_rel_char atomic_set_rel_8 -#define atomic_clear_rel_char atomic_clear_rel_8 -#define atomic_add_rel_char atomic_add_rel_8 -#define atomic_subtract_rel_char atomic_subtract_rel_8 - -#define atomic_set_short atomic_set_16 -#define atomic_clear_short atomic_clear_16 -#define atomic_add_short atomic_add_16 -#define atomic_subtract_short atomic_subtract_16 -#define atomic_set_acq_short atomic_set_acq_16 -#define atomic_clear_acq_short atomic_clear_acq_16 -#define atomic_add_acq_short atomic_add_acq_16 -#define atomic_subtract_acq_short atomic_subtract_acq_16 -#define atomic_set_rel_short atomic_set_rel_16 -#define atomic_clear_rel_short atomic_clear_rel_16 -#define atomic_add_rel_short atomic_add_rel_16 -#define atomic_subtract_rel_short atomic_subtract_rel_16 - -#define atomic_set_int atomic_set_32 -#define atomic_clear_int atomic_clear_32 -#define atomic_add_int atomic_add_32 -#define atomic_subtract_int atomic_subtract_32 -#define atomic_set_acq_int atomic_set_acq_32 -#define atomic_clear_acq_int atomic_clear_acq_32 -#define atomic_add_acq_int atomic_add_acq_32 -#define atomic_subtract_acq_int atomic_subtract_acq_32 -#define atomic_set_rel_int atomic_set_rel_32 -#define atomic_clear_rel_int atomic_clear_rel_32 -#define atomic_add_rel_int atomic_add_rel_32 -#define atomic_subtract_rel_int atomic_subtract_rel_32 - -#define atomic_set_long atomic_set_64 -#define atomic_clear_long atomic_clear_64 -#define atomic_add_long atomic_add_64 -#define atomic_subtract_long atomic_subtract_64 -#define atomic_set_acq_long atomic_set_acq_64 -#define atomic_clear_acq_long atomic_clear_acq_64 -#define atomic_add_acq_long atomic_add_acq_64 -#define atomic_subtract_acq_long atomic_subtract_acq_64 -#define atomic_set_rel_long atomic_set_rel_64 -#define atomic_clear_rel_long atomic_clear_rel_64 -#define atomic_add_rel_long atomic_add_rel_64 -#define atomic_subtract_rel_long atomic_subtract_rel_64 - -/* - * Atomically compare the value stored at *p with cmpval and if the - * two values are equal, update the value of *p with newval. Returns - * zero if the compare failed, nonzero otherwise. - */ -static __inline int -atomic_cmpset_acq_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval) -{ - return ia64_cmpxchg_acq_32(p, cmpval, newval) == cmpval; -} - -static __inline int -atomic_cmpset_rel_32(volatile uint32_t* p, uint32_t cmpval, uint32_t newval) -{ - return ia64_cmpxchg_rel_32(p, cmpval, newval) == cmpval; -} - -/* - * Atomically compare the value stored at *p with cmpval and if the - * two values are equal, update the value of *p with newval. Returns - * zero if the compare failed, nonzero otherwise. - */ -static __inline int -atomic_cmpset_acq_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval) -{ - return ia64_cmpxchg_acq_64(p, cmpval, newval) == cmpval; -} - -static __inline int -atomic_cmpset_rel_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval) -{ - return ia64_cmpxchg_rel_64(p, cmpval, newval) == cmpval; -} - -#define atomic_cmpset_32 atomic_cmpset_acq_32 -#define atomic_cmpset_64 atomic_cmpset_acq_64 -#define atomic_cmpset_int atomic_cmpset_32 -#define atomic_cmpset_long atomic_cmpset_64 -#define atomic_cmpset_acq_int atomic_cmpset_acq_32 -#define atomic_cmpset_rel_int atomic_cmpset_rel_32 -#define atomic_cmpset_acq_long atomic_cmpset_acq_64 -#define atomic_cmpset_rel_long atomic_cmpset_rel_64 - -static __inline int -atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src) -{ - return atomic_cmpset_acq_long((volatile u_long *)dst, - (u_long)exp, (u_long)src); -} - -static __inline int -atomic_cmpset_rel_ptr(volatile void *dst, void *exp, void *src) -{ - return atomic_cmpset_rel_long((volatile u_long *)dst, - (u_long)exp, (u_long)src); -} - -#define atomic_cmpset_ptr atomic_cmpset_acq_ptr - -static __inline void * -atomic_load_acq_ptr(volatile void *p) -{ - return (void *)atomic_load_acq_long((volatile u_long *)p); -} - -static __inline void -atomic_store_rel_ptr(volatile void *p, void *v) -{ - atomic_store_rel_long((volatile u_long *)p, (u_long)v); -} - -#define IA64_ATOMIC_PTR(NAME) \ -static __inline void \ -atomic_##NAME##_ptr(volatile void *p, uintptr_t v) \ -{ \ - atomic_##NAME##_long((volatile u_long *)p, v); \ -} \ - \ -static __inline void \ -atomic_##NAME##_acq_ptr(volatile void *p, uintptr_t v) \ -{ \ - atomic_##NAME##_acq_long((volatile u_long *)p, v);\ -} \ - \ -static __inline void \ -atomic_##NAME##_rel_ptr(volatile void *p, uintptr_t v) \ -{ \ - atomic_##NAME##_rel_long((volatile u_long *)p, v);\ -} - -IA64_ATOMIC_PTR(set) -IA64_ATOMIC_PTR(clear) -IA64_ATOMIC_PTR(add) -IA64_ATOMIC_PTR(subtract) - -#undef IA64_ATOMIC_PTR - -static __inline uint32_t -atomic_readandclear_32(volatile uint32_t* p) -{ - uint32_t val; - do { - val = *p; - } while (!atomic_cmpset_32(p, val, 0)); - return val; -} - -static __inline uint64_t -atomic_readandclear_64(volatile uint64_t* p) -{ - uint64_t val; - do { - val = *p; - } while (!atomic_cmpset_64(p, val, 0)); - return val; -} - -#define atomic_readandclear_int atomic_readandclear_32 -#define atomic_readandclear_long atomic_readandclear_64 - - -/* Some bit operations */ - -static inline void -set_bit(int num, volatile void *addr) -{ - uint32_t bit, old, new; - volatile uint32_t *p; - p = (volatile uint32_t *) addr + (num >> 5); - bit = 1 << (num & 31); - do - { - old = *p; - new = old | bit; - } while(ia64_cmpxchg_acq_32(p, old, new) != old); -} - -static __inline__ void -clear_bit(int num, volatile void *addr) -{ - uint32_t mask, old, new; - volatile uint32_t *p; - p = (volatile uint32_t *) addr + (num >> 5); - mask = ~(1 << (num & 31)); - do { - old = *p; - new = old & mask; - } while (ia64_cmpxchg_acq_32(p, old, new) != old); -} - -static __inline__ int -test_bit(int num, const volatile void *addr) -{ - uint32_t val = 1; - return val & (((const volatile uint32_t *) addr)[num >> 5] >> (num & 31)); -} - -/* - * test_and_set_bit - Set a bit and return its old value - * num: Bit to set - * addr: Address to count from - */ -static inline int -test_and_set_bit (int num, volatile void *addr) -{ - uint32_t bit, old, new; - volatile uint32_t *m; - - m = (volatile uint32_t *) addr + (num >> 5); - bit = 1 << (num & 31); - do { - old = *m; - new = old | bit; - } while (ia64_cmpxchg_acq_32(m, old, new) != old); - return (old & bit) != 0; -} - -/* - * test_and_clear_bit - Clear a bit and return its old value - * num: Bit to set - * addr: Address to count from - */ -static -inline int test_and_clear_bit(int num, volatile unsigned long * addr) -{ - uint32_t bit, old, new; - volatile uint32_t* a; - - a = (volatile uint32_t *) addr + (num >> 5); - bit = ~(1 << (num & 31)); - do { - old = *a; - new = old & bit; - } while (ia64_cmpxchg_acq_32(a, old, new) != old); - return (old & ~bit) != 0; -} - - -#endif /* !defined(__ASSEMBLY__) */ - -#endif /* ! _MACHINE_ATOMIC_H_ */ diff --git a/extras/mini-os/include/ia64/efi.h b/extras/mini-os/include/ia64/efi.h deleted file mode 100644 index b70a0a8e24..0000000000 --- a/extras/mini-os/include/ia64/efi.h +++ /dev/null @@ -1,396 +0,0 @@ -/* - * This is a short summary of declarations and definitions from different - * efi header files of Intels' EFI_Toolkit_1.10.14.62 - * used for the minimal implementation in mini-os. - * Changes: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * - **************************************************************************** - * Copyright (C) 2001-2004, Intel Corporation. - * THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO WARRANTIES WHATSOEVER, - * INCLUDING ANY WARRANTY OF MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR - * ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY - * PROPOSAL, SPECIFICATION OR SAMPLE. Except for a limited copyright license - * to copy this specification for internal use only, no license, express or - * implied, by estoppel or otherwise, to any intellectual property rights is - * granted herein. Intel disclaims all liability, including liability for - * infringement of any proprietary rights, relating to implementation of - * information in this specification. Intel does not warrant or represent - * that such implementation(s) will not infringe such rights. Designers must - * not rely on the absence or characteristics of any features or instructions - * marked "reserved" or "undefined." Intel reserves these for future - * definition and shall have no responsibility whatsoever for conflicts or - * incompatibilities arising from future changes to them. - * This document is an intermediate draft for comment only and is subject to - * change without notice. Readers should not design products based on this - * document. - * Intel, the Intel logo, and Itanium are trademarks or registered trademarks - * of Intel Corporation or its subsidiaries in the United States and other - * countries. - * Other names and brands may be claimed as the property of others. - */ - -#ifndef _EFI_H_ -#define _EFI_H_ - -#include <mini-os/types.h> - - -#define EFIWARN(a) (a) -#define EFI_ERROR(a) (((int64_t) a) < 0) - - -#define EFI_SUCCESS 0 -#define EFI_LOAD_ERROR EFIERR(1) -#define EFI_INVALID_PARAMETER EFIERR(2) -#define EFI_UNSUPPORTED EFIERR(3) -#define EFI_BAD_BUFFER_SIZE EFIERR(4) -#define EFI_BUFFER_TOO_SMALL EFIERR(5) -#define EFI_NOT_READY EFIERR(6) -#define EFI_DEVICE_ERROR EFIERR(7) -#define EFI_WRITE_PROTECTED EFIERR(8) -#define EFI_OUT_OF_RESOURCES EFIERR(9) -#define EFI_VOLUME_CORRUPTED EFIERR(10) -#define EFI_VOLUME_FULL EFIERR(11) -#define EFI_NO_MEDIA EFIERR(12) -#define EFI_MEDIA_CHANGED EFIERR(13) -#define EFI_NOT_FOUND EFIERR(14) -#define EFI_ACCESS_DENIED EFIERR(15) -#define EFI_NO_RESPONSE EFIERR(16) -#define EFI_NO_MAPPING EFIERR(17) -#define EFI_TIMEOUT EFIERR(18) -#define EFI_NOT_STARTED EFIERR(19) -#define EFI_ALREADY_STARTED EFIERR(20) -#define EFI_ABORTED EFIERR(21) -#define EFI_ICMP_ERROR EFIERR(22) -#define EFI_TFTP_ERROR EFIERR(23) -#define EFI_PROTOCOL_ERROR EFIERR(24) - -#define EFI_WARN_UNKOWN_GLYPH EFIWARN(1) -#define EFI_WARN_DELETE_FAILURE EFIWARN(2) -#define EFI_WARN_WRITE_FAILURE EFIWARN(3) -#define EFI_WARN_BUFFER_TOO_SMALL EFIWARN(4) - - -typedef uint64_t efi_status_t; -typedef void* efi_handle_t; -typedef void* efi_event_t; -typedef uint16_t efi_char16_t; - - -/* - * Standard EFI table header - */ - -struct efi_table_header -{ - uint64_t Signature; - // Revision of EFI table specification, - // upper 16 bit - major revision number - // lower 16 bit - minor revision number - uint32_t Revision; - uint32_t HeaderSize; - uint32_t CRC32; - uint32_t Reserved; -}; -typedef struct efi_table_header efi_table_header_t; - -/* - * EFI Time - */ -typedef struct -{ - uint16_t Year; /* 1998 - 20XX */ - uint8_t Month; /* 1 - 12 */ - uint8_t Day; /* 1 - 31 */ - uint8_t Hour; /* 0 - 23 */ - uint8_t Minute; /* 0 - 59 */ - uint8_t Second; /* 0 - 59 */ - uint8_t Pad1; - uint32_t Nanosecond; /* 0 - 999,999,999 */ - int16_t TimeZone; /* -1440 to 1440 or 2047 */ - uint8_t Daylight; - uint8_t Pad2; -} efi_time_t; - -/* Bit definitions for efi_time_t.Daylight */ -#define EFI_TIME_ADJUST_DAYLIGHT 0x01 -#define EFI_TIME_IN_DAYLIGHT 0x02 - -/* Value definition for efi_time_t.TimeZone */ -#define EFI_UNSPECIFIED_TIMEZONE 0x07FF - - - -typedef struct -{ - uint32_t Resolution; /* 1e-6 parts per million */ - uint32_t Accuracy; /* hertz */ - uint8_t SetsToZero; /* Set clears sub-second time */ -} efi_time_capabilities_t; - - -typedef efi_status_t (*efi_get_time_t) (efi_time_t*, efi_time_capabilities_t*); -typedef efi_status_t (*efi_set_time_t) (efi_time_t*); -typedef efi_status_t (*efi_get_wakeup_time_t) (uint8_t*, uint8_t*, efi_time_t*); -typedef efi_status_t (*efi_set_wakeup_time_t) (uint8_t, efi_time_t*); - -/* - * Memory - * Preseve the attr on any range supplied. - * ConventialMemory must have WB,SR,SW when supplied. - * When allocating from ConventialMemory always make it WB,SR,SW - * When returning to ConventialMemory always make it WB,SR,SW - * When getting the memory map, or on RT for runtime types - */ - -typedef enum { - EfiReservedMemoryType, /* 0 */ - EfiLoaderCode, - EfiLoaderData, - EfiBootServicesCode, - EfiBootServicesData, - EfiRuntimeServicesCode, - EfiRuntimeServicesData, /* 6 */ - EfiConventionalMemory, /* 7 */ - EfiUnusableMemory, - EfiACPIReclaimMemory, /* 9 */ - EfiACPIMemoryNVS, /* 10, a */ - EfiMemoryMappedIO, - EfiMemoryMappedIOPortSpace, /* 12, c */ - EfiPalCode, /* 13, d */ - EfiMaxMemoryType /* 14, e */ -} efi_memory_type_t; - -/* possible caching types for the memory range */ -#define EFI_MEMORY_UC 0x0000000000000001 -#define EFI_MEMORY_WC 0x0000000000000002 -#define EFI_MEMORY_WT 0x0000000000000004 -#define EFI_MEMORY_WB 0x0000000000000008 -#define EFI_MEMORY_UCE 0x0000000000000010 -/* physical memory protection on range */ -#define EFI_MEMORY_WP 0x0000000000001000 -#define EFI_MEMORY_RP 0x0000000000002000 -#define EFI_MEMORY_XP 0x0000000000004000 -/* range requires a runtime mapping */ -#define EFI_MEMORY_RUNTIME 0x8000000000000000 - -#define EFI_MEMORY_DESCRIPTOR_VERSION 1 - -typedef uint64_t efi_phys_addr_t; -typedef uint64_t efi_virt_addr_t; - -typedef struct -{ - uint32_t Type; /* 32 bit padding */ - efi_phys_addr_t PhysicalStart; - efi_virt_addr_t VirtualStart; - uint64_t NumberOfPages; - uint64_t Attribute; -} efi_memory_descriptor_t; - -#define NextMemoryDescriptor(Ptr,Size) ((efi_memory_descriptor_t*) (((uint8_t*) Ptr) + Size)) - - -typedef efi_status_t (*efi_set_virtual_address_map_t) - ( - uint64_t MemoryMapSize, - uint64_t DescriptorSize, - uint32_t DescriptorVersion, - efi_memory_descriptor_t* VirtualMap - ); - -typedef efi_status_t (*efi_convert_pointer_t) - ( - uint64_t DebugDisposition, - void** Address - ); - -/* - * A GUID - */ - -typedef struct -{ - uint32_t Data1; - uint16_t Data2; - uint16_t Data3; - uint8_t Data4[8]; -} efi_guid_t; - -/* - * EFI Configuration Table and GUID definitions - */ - -#define MPS_TABLE_GUID \ - { 0xeb9d2d2f, 0x2d88, 0x11d3, \ - { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } } - -#define ACPI_TABLE_GUID \ - { 0xeb9d2d30, 0x2d88, 0x11d3, \ - { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } } - -#define ACPI_20_TABLE_GUID \ - { 0x8868e871, 0xe4f1, 0x11d3, \ - { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } - -#define SMBIOS_TABLE_GUID \ - { 0xeb9d2d31, 0x2d88, 0x11d3, \ - { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } } - -#define SAL_SYSTEM_TABLE_GUID \ - { 0xeb9d2d32, 0x2d88, 0x11d3, \ - { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } } - -/* DIG64 Headless Console & Debug Port Table. */ -#define HCDP_TABLE_GUID \ - {0xf951938d, 0x620b, 0x42ef, \ - {0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } } - - -typedef struct efi_configuration_table -{ - efi_guid_t VendorGuid; - void* VendorTable; -} efi_configuration_table_t; - - -/* - * EFI platform variables - */ - -#define EFI_GLOBAL_VARIABLE \ - { 0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, \ - 0xE0, 0x98, 0x03, 0x2B, 0x8C } - -/* Variable attributes */ -#define EFI_VARIABLE_NON_VOLATILE 0x00000001 -#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 -#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 - -/* Variable size limitation */ -#define EFI_MAXIMUM_VARIABLE_SIZE 1024 - -typedef efi_status_t (*efi_get_variable_t) - ( - efi_char16_t* VariableName, - efi_guid_t *VendorGuid, - uint32_t* Attributes, - uint64_t* DataSize, - void* Data - ); - -typedef -efi_status_t (*efi_get_next_variable_name_t) - ( - uint64_t* VariableNameSize, - efi_char16_t* VariableName, - efi_guid_t* VendorGuid - ); - -typedef efi_status_t (*efi_set_variable_t) - ( - efi_char16_t* VariableName, - efi_guid_t* VendorGuid, - uint32_t Attributes, - uint64_t DataSize, - void* Data - ); - -/* - * Misc - */ - -typedef enum -{ - EfiResetCold, - EfiResetWarm, - EfiResetShutdown -} efi_reset_type_t; - - -typedef efi_status_t (*efi_reset_system_t) - ( - efi_reset_type_t ResetType, - efi_status_t ResetStatus, - uint64_t DataSize, - efi_char16_t* ResetData - ); - -typedef efi_status_t (*efi_get_next_high_mono_count_t) (uint32_t* HighCount); - - -/* - * EFI Runtime Serivces Table - */ - -#define EFI_RUNTIME_SERVICES_SIGNATURE 0x5652453544e5552ULL -#define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) \ - | (EFI_SPECIFICATION_MINOR_REVISION)) - -typedef struct -{ - efi_table_header_t Hdr; - /* Time services */ - efi_get_time_t GetTime; - efi_set_time_t SetTime; - efi_get_wakeup_time_t GetWakeupTime; - efi_set_wakeup_time_t SetWakeupTime; - /* Virtual memory services */ - efi_set_virtual_address_map_t SetVirtualAddressMap; - efi_convert_pointer_t ConvertPointer; - /* Variable serviers */ - efi_get_variable_t GetVariable; - efi_get_next_variable_name_t GetNextVariableName; - efi_set_variable_t SetVariable; - /* Misc */ - efi_get_next_high_mono_count_t GetNextHighMonotonicCount; - efi_reset_system_t ResetSystem; - -} efi_runtime_services_t; - - -#define EFI_SPECIFICATION_MAJOR_REVISION 1 -#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249 -#define EFI_SYSTEM_TABLE_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) \ - | (EFI_SPECIFICATION_MINOR_REVISION)) - -struct efi_system_table -{ - efi_table_header_t Hdr; - - uint64_t FirmwareVendor; // phys addr of CHAR16 - uint32_t FirmwareRevision; // Firmware vendor specific - - efi_handle_t ConsoleInHandle; - uint64_t ConIn; - - efi_handle_t ConsoleOutHandle; - uint64_t ConOut; - - efi_handle_t StandardErrorHandle; - uint64_t StdErr; - - uint64_t RuntimeServices; // phys addr - uint64_t BootServices; // phys addr - - uint64_t NumberOfTableEntries; // Number of entries in Config - uint64_t ConfigurationTable; // phys addr of ConfigTable -}; - -typedef struct efi_system_table efi_system_table_t; - - -#define EFI_PAGE_SIZE 4096 -#define EFI_PAGE_MASK 0xFFF -#define EFI_PAGE_SHIFT 12 - -#define EFI_SIZE_TO_PAGES(a) \ - ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) ) - - -void init_efi(void); -int efi_get_time(efi_time_t* tmP); -efi_status_t ia64_call_efi_physical(void *, ...); - - -#endif /* _EFI_H_ */ diff --git a/extras/mini-os/include/ia64/hypercall-ia64.h b/extras/mini-os/include/ia64/hypercall-ia64.h deleted file mode 100644 index 06ddc8c774..0000000000 --- a/extras/mini-os/include/ia64/hypercall-ia64.h +++ /dev/null @@ -1,135 +0,0 @@ -/****************************************************************************** - * hypercall.h - * - * Mini-OS-specific hypervisor handling for ia64. - * - * Copyright (c) 2002-2004, K A Fraser - * Changes: Dietmar Hahn <dietmar.hahn@fujiti-siemens.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation; or, when distributed - * separately from the Linux kernel or incorporated into other - * software packages, subject to the following license: - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this source file (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#ifndef __HYPERCALL_H__ -#define __HYPERCALL_H__ - -#include <xen/event_channel.h> -#include <xen/sched.h> -#include <xen/version.h> - -#ifndef _HYPERVISOR_H_ -# error "please don't include this file directly" -#endif - -// See linux/compiler.h -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) - -extern unsigned long __hypercall(unsigned long a1, unsigned long a2, - unsigned long a3, unsigned long a4, - unsigned long a5, unsigned long cmd); -/* - * Assembler stubs for hyper-calls. - */ - -#define _hypercall0(type, name) \ -({ \ - long __res; \ - __res = __hypercall(0, 0, 0, 0, 0, \ - __HYPERVISOR_##name); \ - (type)__res; \ -}) - -#define _hypercall1(type, name, a1) \ -({ \ - long __res; \ - __res = __hypercall((unsigned long)a1, \ - 0, 0, 0, 0, __HYPERVISOR_##name); \ - (type)__res; \ -}) - -#define _hypercall2(type, name, a1, a2) \ -({ \ - long __res; \ - __res = __hypercall((unsigned long)a1, \ - (unsigned long)a2, \ - 0, 0, 0, __HYPERVISOR_##name); \ - (type)__res; \ -}) - -#define _hypercall3(type, name, a1, a2, a3) \ -({ \ - long __res; \ - __res = __hypercall((unsigned long)a1, \ - (unsigned long)a2, \ - (unsigned long)a3, \ - 0, 0, __HYPERVISOR_##name); \ - (type)__res; \ -}) - -#define _hypercall4(type, name, a1, a2, a3, a4) \ -({ \ - long __res; \ - __res = __hypercall((unsigned long)a1, \ - (unsigned long)a2, \ - (unsigned long)a3, \ - (unsigned long)a4, \ - 0, __HYPERVISOR_##name); \ - (type)__res; \ -}) - -#define _hypercall5(type, name, a1, a2, a3, a4, a5) \ -({ \ - long __res; \ - __res = __hypercall((unsigned long)a1, \ - (unsigned long)a2, \ - (unsigned long)a3, \ - (unsigned long)a4, \ - (unsigned long)a5, \ - __HYPERVISOR_##name); \ - (type)__res; \ -}) - - -int HYPERVISOR_event_channel_op(int cmd, void *arg); - -int HYPERVISOR_xen_version(int cmd, void *arg); - -int HYPERVISOR_console_io(int cmd, int count, char *str); - -int HYPERVISOR_sched_op_compat(int cmd, unsigned long arg); - -int HYPERVISOR_sched_op(int cmd, void *arg); - -int HYPERVISOR_callback_op(int cmd, void *arg); - -int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count); - -int HYPERVISOR_opt_feature(void *arg); - -int HYPERVISOR_suspend(unsigned long srec); - -int HYPERVISOR_shutdown(unsigned int reason); - -#endif /* __HYPERCALL_H__ */ diff --git a/extras/mini-os/include/ia64/ia64_cpu.h b/extras/mini-os/include/ia64/ia64_cpu.h deleted file mode 100644 index 3e2e9147ed..0000000000 --- a/extras/mini-os/include/ia64/ia64_cpu.h +++ /dev/null @@ -1,738 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * This code is mostly taken from FreeBSD. - * - * - **************************************************************************** - * Copyright (c) 2000 Doug Rabson - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - -#ifndef _IA64_CPU_H_ -#define _IA64_CPU_H_ - -#include "ia64_fpu.h" - -/* - * Definition of Region Register bits (RR) - * - * RR bit field positions - */ -#define IA64_RR_VE 0 -#define IA64_RR_MBZ0 1 -#define IA64_RR_PS 2 -#define IA64_RR_PS_LEN 6 -#define IA64_RR_RID 8 -#define IA64_RR_RID_LEN 24 -#define IA64_RR_MBZ1 32 - -#define IA64_RR_IDX_POS 61 - -#define IA64_RR_VAL(size,rid) (((size) << IA64_RR_PS) | ((rid) << IA64_RR_RID)) - -/* - * Define Protection Key Register (PKR) - * - * PKR bit field positions - */ -#define IA64_PKR_V 0 -#define IA64_PKR_WD 1 -#define IA64_PKR_RD 2 -#define IA64_PKR_XD 3 -#define IA64_PKR_MBZ0 4 -#define IA64_PKR_KEY 8 -#define IA64_PKR_KEY_LEN 24 -#define IA64_PKR_MBZ1 32 - -#define IA64_PKR_VALID (1 << IA64_PKR_V) - - -/* - * ITIR bit field positions - */ - -#define IA64_ITIR_MBZ0 0 -#define IA64_ITIR_PS 2 -#define IA64_ITIR_PS_LEN 6 -#define IA64_ITIR_KEY 8 -#define IA64_ITIR_KEY_LEN 24 -#define IA64_ITIR_MBZ1 32 -#define IA64_ITIR_MBZ1_LEN 16 -#define IA64_ITIR_PPN 48 -#define IA64_ITIR_PPN_LEN 15 -#define IA64_ITIR_MBZ2 63 - -/* - * Definition of PSR and IPSR bits. - */ -#define IA64_PSR_BE 0x0000000000000002 -#define IA64_PSR_UP 0x0000000000000004 -#define IA64_PSR_AC 0x0000000000000008 -#define IA64_PSR_MFL 0x0000000000000010 -#define IA64_PSR_MFH_BIT 5 -#define IA64_PSR_MFH (1 << IA64_PSR_MFH_BIT) -#define IA64_PSR_UMASK (IA64_PSR_BE | IA64_PSR_UP | \ - IA64_PSR_AC | IA64_PSR_MFL | \ - IA64_PSR_MFH) -#define IA64_PSR_IC_BIT 13 -#define IA64_PSR_IC (1<<IA64_PSR_IC_BIT) /*0x0000000000002000*/ -#define IA64_PSR_I_BIT 14 -#define IA64_PSR_I (1<<IA64_PSR_I_BIT) /*0x0000000000004000*/ -#define IA64_PSR_PK 0x0000000000008000 -#define IA64_PSR_DT 0x0000000000020000 -#define IA64_PSR_DFL 0x0000000000040000 -#define IA64_PSR_DFH 0x0000000000080000 -#define IA64_PSR_SP 0x0000000000100000 -#define IA64_PSR_PP 0x0000000000200000 -#define IA64_PSR_DI 0x0000000000400000 -#define IA64_PSR_SI 0x0000000000800000 -#define IA64_PSR_DB 0x0000000001000000 -#define IA64_PSR_LP 0x0000000002000000 -#define IA64_PSR_TB 0x0000000004000000 -#define IA64_PSR_RT 0x0000000008000000 -#define IA64_PSR_CPL 0x0000000300000000 -#define IA64_PSR_CPL_KERN 0x0000000000000000 -#define IA64_PSR_CPL_1 0x0000000100000000 -#define IA64_PSR_CPL_2 0x0000000200000000 -#define IA64_PSR_CPL_USER 0x0000000300000000 -#define IA64_PSR_IS 0x0000000400000000 -#define IA64_PSR_MC 0x0000000800000000 -#define IA64_PSR_IT 0x0000001000000000 -#define IA64_PSR_ID 0x0000002000000000 -#define IA64_PSR_DA 0x0000004000000000 -#define IA64_PSR_DD 0x0000008000000000 -#define IA64_PSR_SS 0x0000010000000000 -#define IA64_PSR_RI 0x0000060000000000 -#define IA64_PSR_RI_0 0x0000000000000000 -#define IA64_PSR_RI_1 0x0000020000000000 -#define IA64_PSR_RI_2 0x0000040000000000 -#define IA64_PSR_RI_SHIFT 41 -#define IA64_PSR_ED 0x0000080000000000 -#define IA64_PSR_BN 0x0000100000000000 -#define IA64_PSR_IA 0x0000200000000000 - - -#define STARTUP_PSR (IA64_PSR_IT | IA64_PSR_PK | \ - IA64_PSR_DT | IA64_PSR_RT | \ - IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC) - -#define MOS_SYS_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \ - IA64_PSR_DT | IA64_PSR_RT | \ - IA64_PSR_BN | IA64_PSR_CPL_KERN | IA64_PSR_AC) - -#define MOS_USR_PSR (IA64_PSR_IC | IA64_PSR_I | IA64_PSR_IT | \ - IA64_PSR_DT | IA64_PSR_RT | \ - IA64_PSR_BN | IA64_PSR_CPL_USER | IA64_PSR_AC) - -/* - * Definition of ISR bits. - */ -#define IA64_ISR_CODE 0x000000000000ffff -#define IA64_ISR_VECTOR 0x0000000000ff0000 -#define IA64_ISR_X 0x0000000100000000 -#define IA64_ISR_W 0x0000000200000000 -#define IA64_ISR_R 0x0000000400000000 -#define IA64_ISR_NA 0x0000000800000000 -#define IA64_ISR_SP 0x0000001000000000 -#define IA64_ISR_RS 0x0000002000000000 -#define IA64_ISR_IR 0x0000004000000000 -#define IA64_ISR_NI 0x0000008000000000 -#define IA64_ISR_SO 0x0000010000000000 -#define IA64_ISR_EI 0x0000060000000000 -#define IA64_ISR_EI_0 0x0000000000000000 -#define IA64_ISR_EI_1 0x0000020000000000 -#define IA64_ISR_EI_2 0x0000040000000000 -#define IA64_ISR_ED 0x0000080000000000 - -/* - * DCR bit positions - */ -#define IA64_DCR_PP 0 -#define IA64_DCR_BE 1 -#define IA64_DCR_LC 2 -#define IA64_DCR_MBZ0 4 -#define IA64_DCR_MBZ0_V 0xf -#define IA64_DCR_DM 8 -#define IA64_DCR_DP 9 -#define IA64_DCR_DK 10 -#define IA64_DCR_DX 11 -#define IA64_DCR_DR 12 -#define IA64_DCR_DA 13 -#define IA64_DCR_DD 14 -#define IA64_DCR_DEFER_ALL 0x7f00 -#define IA64_DCR_MBZ1 2 -#define IA64_DCR_MBZ1_V 0xffffffffffffULL - - -#define IA64_DCR_DEFAULT (IA64_DCR_BE) - -/* - * Vector numbers for various ia64 interrupts. - */ -#define IA64_VEC_VHPT 0 -#define IA64_VEC_ITLB 1 -#define IA64_VEC_DTLB 2 -#define IA64_VEC_ALT_ITLB 3 -#define IA64_VEC_ALT_DTLB 4 -#define IA64_VEC_NESTED_DTLB 5 -#define IA64_VEC_IKEY_MISS 6 -#define IA64_VEC_DKEY_MISS 7 -#define IA64_VEC_DIRTY_BIT 8 -#define IA64_VEC_INST_ACCESS 9 -#define IA64_VEC_DATA_ACCESS 10 -#define IA64_VEC_BREAK 11 -#define IA64_VEC_EXT_INTR 12 -#define IA64_VEC_PAGE_NOT_PRESENT 20 -#define IA64_VEC_KEY_PERMISSION 21 -#define IA64_VEC_INST_ACCESS_RIGHTS 22 -#define IA64_VEC_DATA_ACCESS_RIGHTS 23 -#define IA64_VEC_GENERAL_EXCEPTION 24 -#define IA64_VEC_DISABLED_FP 25 -#define IA64_VEC_NAT_CONSUMPTION 26 -#define IA64_VEC_SPECULATION 27 -#define IA64_VEC_DEBUG 29 -#define IA64_VEC_UNALIGNED_REFERENCE 30 -#define IA64_VEC_UNSUPP_DATA_REFERENCE 31 -#define IA64_VEC_FLOATING_POINT_FAULT 32 -#define IA64_VEC_FLOATING_POINT_TRAP 33 -#define IA64_VEC_LOWER_PRIVILEGE_TRANSFER 34 -#define IA64_VEC_TAKEN_BRANCH_TRAP 35 -#define IA64_VEC_SINGLE_STEP_TRAP 36 -#define IA64_VEC_IA32_EXCEPTION 45 -#define IA64_VEC_IA32_INTERCEPT 46 -#define IA64_VEC_IA32_INTERRUPT 47 - -/* - * Define hardware RSE Configuration Register - * - * RS Configuration (RSC) bit field positions - */ - -#define IA64_RSC_MODE 0 -#define IA64_RSC_PL 2 -#define IA64_RSC_BE 4 -#define IA64_RSC_MBZ0 5 -#define IA64_RSC_MBZ0_V 0x3ff -#define IA64_RSC_LOADRS 16 -#define IA64_RSC_LOADRS_LEN 14 -#define IA64_RSC_MBZ1 30 -#define IA64_RSC_MBZ1_V 0x3ffffffffULL - -/* - * RSC modes - */ -#define IA64_RSC_MODE_LY (0x0) /* Lazy */ -#define IA64_RSC_MODE_SI (0x1) /* Store intensive */ -#define IA64_RSC_MODE_LI (0x2) /* Load intensive */ -#define IA64_RSC_MODE_EA (0x3) /* Eager */ - -#define IA64_RSE_EAGER (IA64_RSC_MODE_EA<<IA64_RSC_MODE) -#define IA64_RSE_LAZY (IA64_RSC_MODE_LY<<IA64_RSC_MODE) - - - -#ifndef __ASSEMBLY__ - -/* ia64 function descriptor and global pointer */ -struct ia64_fdesc -{ - uint64_t func; - uint64_t gp; -}; -typedef struct ia64_fdesc ia64_fdesc_t; - -#define FDESC_FUNC(fn) (((struct ia64_fdesc *) fn)->func) -#define FDESC_GP(fn) (((struct ia64_fdesc *) fn)->gp) - - -/* - * Various special ia64 instructions. - */ - -/* - * Memory Fence. - */ -static __inline void -ia64_mf(void) -{ - __asm __volatile("mf" ::: "memory"); -} - -static __inline void -ia64_mf_a(void) -{ - __asm __volatile("mf.a"); -} - -/* - * Flush Cache. - */ -static __inline void -ia64_fc(uint64_t va) -{ - __asm __volatile("fc %0" :: "r"(va)); -} - -/* - * Sync instruction stream. - */ -static __inline void -ia64_sync_i(void) -{ - __asm __volatile("sync.i"); -} - -/* - * Calculate address in VHPT for va. - */ -static __inline uint64_t -ia64_thash(uint64_t va) -{ - uint64_t result; - __asm __volatile("thash %0=%1" : "=r" (result) : "r" (va)); - return result; -} - -/* - * Calculate VHPT tag for va. - */ -static __inline uint64_t -ia64_ttag(uint64_t va) -{ - uint64_t result; - __asm __volatile("ttag %0=%1" : "=r" (result) : "r" (va)); - return result; -} - -/* - * Convert virtual address to physical. - */ -static __inline uint64_t -ia64_tpa(uint64_t va) -{ - uint64_t result; - __asm __volatile("tpa %0=%1" : "=r" (result) : "r" (va)); - return result; -} - -/* - * Generate a ptc.e instruction. - */ -static __inline void -ia64_ptc_e(uint64_t v) -{ - __asm __volatile("ptc.e %0;; srlz.d;;" :: "r"(v)); -} - -/* - * Generate a ptc.g instruction. - */ -static __inline void -ia64_ptc_g(uint64_t va, uint64_t size) -{ - __asm __volatile("ptc.g %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2)); -} - -/* - * Generate a ptc.ga instruction. - */ -static __inline void -ia64_ptc_ga(uint64_t va, uint64_t size) -{ - __asm __volatile("ptc.ga %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2)); -} - -/* - * Generate a ptc.l instruction. - */ -static __inline void -ia64_ptc_l(uint64_t va, uint64_t size) -{ - __asm __volatile("ptc.l %0,%1;; srlz.d;;" :: "r"(va), "r"(size<<2)); -} - -/* - * Read the value of psr. - */ -static __inline uint64_t -ia64_get_psr(void) -{ - uint64_t result; - __asm __volatile("mov %0=psr;;" : "=r" (result)); - return result; -} - -static __inline void -ia64_set_psr(uint64_t v) -{ - __asm __volatile("mov psr.l=%0" :: "r" (v)); -} - -static __inline void -ia64_srlz_d(void) -{ - __asm __volatile("srlz.d;;"); -} - -static __inline void -disable_intr(void) -{ - __asm __volatile ("rsm psr.ic|psr.i"); -} - -static __inline void -enable_intr(void) -{ - __asm __volatile ("ssm psr.ic|psr.i"); -} - -/* - * Define accessors for application registers. - */ - -#define IA64_AR(name) \ - \ -static __inline uint64_t \ -ia64_get_##name(void) \ -{ \ - uint64_t result; \ - __asm __volatile(";;mov %0=ar." #name ";;" : "=r" (result)); \ - return result; \ -} \ - \ -static __inline void \ -ia64_set_##name(uint64_t v) \ -{ \ - __asm __volatile("mov ar." #name "=%0" :: "r" (v)); \ -} - -IA64_AR(k0) -IA64_AR(k1) -IA64_AR(k2) -IA64_AR(k3) -IA64_AR(k4) -IA64_AR(k5) -IA64_AR(k6) -IA64_AR(k7) - -IA64_AR(rsc) -IA64_AR(bsp) -IA64_AR(bspstore) -IA64_AR(rnat) - -IA64_AR(fcr) - -IA64_AR(eflag) -IA64_AR(csd) -IA64_AR(ssd) -IA64_AR(cflg) -IA64_AR(fsr) -IA64_AR(fir) -IA64_AR(fdr) - -IA64_AR(ccv) - -IA64_AR(unat) - -IA64_AR(fpsr) - -IA64_AR(itc) - -IA64_AR(pfs) -IA64_AR(lc) -IA64_AR(ec) - -/* - * Define accessors for control registers. - */ - -#define IA64_CR(name) \ - \ -static __inline uint64_t \ -ia64_get_##name(void) \ -{ \ - uint64_t result; \ - __asm __volatile("mov %0=cr." #name : "=r" (result)); \ - return result; \ -} \ - \ -static __inline void \ -ia64_set_##name(uint64_t v) \ -{ \ - __asm __volatile("mov cr." #name "=%0" :: "r" (v)); \ -} - -IA64_CR(dcr) -IA64_CR(itm) -IA64_CR(iva) - -IA64_CR(pta) - -IA64_CR(ipsr) -IA64_CR(isr) - -IA64_CR(iip) -IA64_CR(ifa) -IA64_CR(itir) -IA64_CR(iipa) -IA64_CR(ifs) -IA64_CR(iim) -IA64_CR(iha) - -IA64_CR(lid) -IA64_CR(ivr) -IA64_CR(tpr) -IA64_CR(eoi) -IA64_CR(irr0) -IA64_CR(irr1) -IA64_CR(irr2) -IA64_CR(irr3) -IA64_CR(itv) -IA64_CR(pmv) -IA64_CR(cmcv) - -IA64_CR(lrr0) -IA64_CR(lrr1) - -#define IA64_GR(name) \ - \ -static __inline uint64_t \ -ia64_get_##name(void) \ -{ \ - uint64_t result; \ - __asm __volatile("mov %0=" #name : "=r" (result)); \ - return result; \ -} \ - \ -static __inline void \ -ia64_set_##name(uint64_t v) \ -{ \ - __asm __volatile("mov " #name "=%0" :: "r" (v)); \ -} - -IA64_GR(sp) -IA64_GR(b0) -IA64_GR(r13) // tp - - -/* - * Write a region register. - */ -static __inline void -ia64_set_rr(uint64_t rrbase, uint64_t v) -{ - __asm __volatile("mov rr[%0]=%1;; srlz.d;;" - :: "r"(rrbase), "r"(v) : "memory"); -} - -/* - * Read a region register. - */ -static __inline uint64_t -ia64_get_rr(uint64_t rrbase) -{ - uint64_t v; - __asm __volatile("mov %1=rr[%0];;" - : "=r" (v) : "r"(rrbase) : "memory"); - return v; -} - - -/* - * Read a CPUID register. - */ -static __inline uint64_t -ia64_get_cpuid(int i) -{ - uint64_t result; - __asm __volatile("mov %0=cpuid[%1]" - : "=r" (result) : "r"(i)); - return result; -} - - -struct trap_frame -{ - uint64_t rsc; - uint64_t ndirty; /* number of dirty regs */ - uint64_t ssd; - uint64_t iip; /* interrupted ip */ - uint64_t ipsr; /* interrupted psr */ - uint64_t ifs; /* interruption func status register */ - - uint16_t trap_num; /* Trap num, index in trap_vec */ - uint64_t cfm; /* current frame marker */ - uint64_t pfs; /* previous function state ar64 */ - uint64_t bsp; /* backing store pointer ar17 */ - uint64_t rnat; /* rse nat collection ar19 */ - uint64_t csd; /* comp and store data reg ar25 */ - uint64_t ccv; /* comp and xchange val reg ar32 */ - uint64_t unat; /* */ - uint64_t fpsr; /* floating point state reg ar40 */ - uint64_t pr; /* predicate regs 0-63 */ - - uint64_t gp; /* the gp pointer */ - uint64_t sp; /* stack pointer */ - uint64_t tp; /* thread pointer */ - - uint64_t r2; /* global reg 2 */ - uint64_t r3; - uint64_t r8; - uint64_t r9; - uint64_t r10; - uint64_t r11; - uint64_t r14; - uint64_t r15; - uint64_t r16; - uint64_t r17; - uint64_t r18; - uint64_t r19; - uint64_t r20; - uint64_t r21; - uint64_t r22; - uint64_t r23; - uint64_t r24; - uint64_t r25; - uint64_t r26; - uint64_t r27; - uint64_t r28; - uint64_t r29; - uint64_t r30; - uint64_t r31; - - uint64_t b0; - uint64_t b6; - uint64_t b7; - - ia64_fpreg_t f6; /* floating point register 6 */ - ia64_fpreg_t f7; - ia64_fpreg_t f8; - ia64_fpreg_t f9; - ia64_fpreg_t f10; - ia64_fpreg_t f11; - - uint64_t ifa; /* interruption faulting address */ - uint64_t isr; /* interruption status register */ - uint64_t iim; /* interruption immediate register */ -}; - -typedef struct trap_frame trap_frame_t; - - -#endif /* __ASSEMBLY__ */ - -/* Page access parameters. */ -#define PTE_P_SHIFT 0 -#define PTE_P 1 - -#define PTE_MA_SHIFT 2 -#define PTE_MA_WB 0 - -#define PTE_A_SHIFT 5 -#define PTE_A 1 -#define PTE_D_SHIFT 6 -#define PTE_D 1 - -#define PTE_AR_SHIFT 9 -#define PTE_AR_R 0 -#define PTE_AR_RX 1 -#define PTE_AR_RW 2 -#define PTE_AR_RWX 3 -#define PTE_AR_R_RW 4 -#define PTE_AR_RX_RWX 5 -#define PTE_AR_RWX_RW 6 -/* privilege level */ -#define PTE_PL_SHIFT 7 -#define PTE_PL_KERN 0 /* used for kernel */ -/* page size */ -#define PTE_PS_4K 12 -#define PTE_PS_8K 13 -#define PTE_PS_16K 14 -#define PTE_PS_64K 16 -#define PTE_PS_256K 18 -#define PTE_PS_1M 20 -#define PTE_PS_4M 22 -#define PTE_PS_16M 24 -#define PTE_PS_64M 26 -#define PTE_PS_256M 28 - - - /* Some offsets for ia64_pte_t. */ -#define PTE_OFF_P 0 -#define PTE_OFF_MA 3 -#define PTE_OFF_A 5 -#define PTE_OFF_D 6 -#define PTE_OFF_PL 7 -#define PTE_OFF_AR 9 -#define PTE_OFF_PPN 12 -#define PTE_OFF_ED 52 - -#if !defined(_ASM) && !defined(__ASSEMBLY__) -/* - * A short-format VHPT entry. Also matches the TLB insertion format. - */ -typedef struct -{ - uint64_t pte_p :1; /* bits 0..0 */ - uint64_t pte_rv1:1; /* bits 1..1 */ - uint64_t pte_ma :3; /* bits 2..4 */ - uint64_t pte_a :1; /* bits 5..5 */ - uint64_t pte_d :1; /* bits 6..6 */ - uint64_t pte_pl :2; /* bits 7..8 */ - uint64_t pte_ar :3; /* bits 9..11 */ - uint64_t pte_ppn:38; /* bits 12..49 */ - uint64_t pte_rv2:2; /* bits 50..51 */ - uint64_t pte_ed :1; /* bits 52..52 */ - uint64_t pte_ig :11; /* bits 53..63 */ -} ia64_pte_t; - - -/* - * A long-format VHPT entry. - */ -typedef struct -{ - uint64_t pte_p :1; /* bits 0..0 */ - uint64_t pte_rv1 :1; /* bits 1..1 */ - uint64_t pte_ma :3; /* bits 2..4 */ - uint64_t pte_a :1; /* bits 5..5 */ - uint64_t pte_d :1; /* bits 6..6 */ - uint64_t pte_pl :2; /* bits 7..8 */ - uint64_t pte_ar :3; /* bits 9..11 */ - uint64_t pte_ppn :38; /* bits 12..49 */ - uint64_t pte_rv2 :2; /* bits 50..51 */ - uint64_t pte_ed :1; /* bits 52..52 */ - uint64_t pte_ig :11; /* bits 53..63 */ - uint64_t pte_rv3 :2; /* bits 0..1 */ - uint64_t pte_ps :6; /* bits 2..7 */ - uint64_t pte_key :24; /* bits 8..31 */ - uint64_t pte_rv4 :32; /* bits 32..63 */ - uint64_t pte_tag; /* includes ti */ - uint64_t pte_chain; /* pa of collision chain */ -} ia64_lpte_t; - -#endif /* __ASSEMBLY__ */ - -#endif /* _IA64_CPU_H_ */ diff --git a/extras/mini-os/include/ia64/ia64_fpu.h b/extras/mini-os/include/ia64/ia64_fpu.h deleted file mode 100644 index 91a17b934a..0000000000 --- a/extras/mini-os/include/ia64/ia64_fpu.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * This code is mostly taken from FreeBSD. - * - **************************************************************************** - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - -#ifndef _IA64_FPU_H_ -#define _IA64_FPU_H_ - -#include "os.h" - -/* - * Floating point status register bits. - */ -#define IA64_FPSR_TRAP_VD UL_CONST(0x0000000000000001) -#define IA64_FPSR_TRAP_DD UL_CONST(0x0000000000000002) -#define IA64_FPSR_TRAP_ZD UL_CONST(0x0000000000000004) -#define IA64_FPSR_TRAP_OD UL_CONST(0x0000000000000008) -#define IA64_FPSR_TRAP_UD UL_CONST(0x0000000000000010) -#define IA64_FPSR_TRAP_ID UL_CONST(0x0000000000000020) -#define IA64_FPSR_SF(i,v) ((v) << ((i)*13+6)) - -#define IA64_SF_FTZ UL_CONST(0x0001) -#define IA64_SF_WRE UL_CONST(0x0002) -#define IA64_SF_PC UL_CONST(0x000c) -#define IA64_SF_PC_0 UL_CONST(0x0000) -#define IA64_SF_PC_1 UL_CONST(0x0004) -#define IA64_SF_PC_2 UL_CONST(0x0008) -#define IA64_SF_PC_3 UL_CONST(0x000c) -#define IA64_SF_RC UL_CONST(0x0030) -#define IA64_SF_RC_NEAREST UL_CONST(0x0000) -#define IA64_SF_RC_NEGINF UL_CONST(0x0010) -#define IA64_SF_RC_POSINF UL_CONST(0x0020) -#define IA64_SF_RC_TRUNC UL_CONST(0x0030) -#define IA64_SF_TD UL_CONST(0x0040) -#define IA64_SF_V UL_CONST(0x0080) -#define IA64_SF_D UL_CONST(0x0100) -#define IA64_SF_Z UL_CONST(0x0200) -#define IA64_SF_O UL_CONST(0x0400) -#define IA64_SF_U UL_CONST(0x0800) -#define IA64_SF_I UL_CONST(0x1000) - -#define IA64_SF_DEFAULT (IA64_SF_PC_3 | IA64_SF_RC_NEAREST) - -#define IA64_FPSR_DEFAULT (IA64_FPSR_TRAP_VD \ - | IA64_FPSR_TRAP_DD \ - | IA64_FPSR_TRAP_ZD \ - | IA64_FPSR_TRAP_OD \ - | IA64_FPSR_TRAP_UD \ - | IA64_FPSR_TRAP_ID \ - | IA64_FPSR_SF(0, IA64_SF_DEFAULT) \ - | IA64_FPSR_SF(1, (IA64_SF_DEFAULT \ - | IA64_SF_TD \ - | IA64_SF_WRE)) \ - | IA64_FPSR_SF(2, (IA64_SF_DEFAULT \ - | IA64_SF_TD)) \ - | IA64_FPSR_SF(3, (IA64_SF_DEFAULT \ - | IA64_SF_TD))) - - -#ifndef __ASSEMBLY__ - - /* This is from sys/cdefs.h in FreeBSD */ -#define __aligned(x) __attribute__((__aligned__(x))) - - /* A single Floating Point register. */ -struct ia64_fpreg -{ - uint8_t fpr_bits[16]; -} __aligned(16); - -typedef struct ia64_fpreg ia64_fpreg_t; - -#endif /* __ASSEMBLY__ */ - -#endif /* _IA64_FPU_H_ */ diff --git a/extras/mini-os/include/ia64/os.h b/extras/mini-os/include/ia64/os.h deleted file mode 100644 index 9a79e9bdc5..0000000000 --- a/extras/mini-os/include/ia64/os.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (C) 2007 - Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * - **************************************************************************** - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -#if !defined(__OS_H__) -#define __OS_H__ - -#if !defined(__ASSEMBLY__) - -#include <mini-os/types.h> -#include "ia64_cpu.h" -#include "atomic.h" -#include "efi.h" -#include "sal.h" -#include "pal.h" -#include <mini-os/hypervisor.h> -#include <mini-os/kernel.h> - - -typedef uint64_t paddr_t; /* Physical address. */ -#ifndef HAVE_LIBC -typedef uint64_t caddr_t; /* rr7/kernel memory address. */ -#endif - -#include "page.h" -#include "mm.h" - - -void arch_init(start_info_t *si); /* in common.c */ -void arch_print_info(void); /* in common.c */ -void arch_fini(void); - - -/* Size of xen_ia64_boot_param.command_line */ -#define COMMAND_LINE_SIZE 512 - -extern struct xen_ia64_boot_param* ia64_boot_paramP; -extern struct xen_ia64_boot_param ia64BootParamG; -extern char boot_cmd_line[]; -extern efi_system_table_t* efiSysTableP; -extern int bootverbose; - -extern void ia64_probe_sapics(void); - - - -/* Contains the needed stuff from efi. */ -struct efi -{ - - efi_system_table_t* efiSysTableP; - efi_set_virtual_address_map_t setVirtAddrMapF; - efi_get_time_t getTimeF; - efi_reset_system_t resetSystemF; - -}; - -struct machine_fw -{ - struct efi efi; - - uint64_t ia64_port_base; /* physical address */ - uint64_t ia64_pal_base; /* virtual rr7 address */ - - sal_system_table_t* ia64_sal_tableP; - sal_entry_t* ia64_sal_entryP; /* SAL_PROC entrypoint */ - - uint64_t ia64_efi_acpi_table; /* physical address */ - uint64_t ia64_efi_acpi20_table; /* physical address */ - - uint64_t mach_mem_start; /* phys start addr of machine memory */ - uint64_t mach_mem_size; /* size of machine memory */ - - uint64_t kernstart; /* virt address of kern text start */ - uint64_t kernend; - uint64_t kernpstart; /* phys address of kern text start */ - uint64_t kernpend; -}; - -extern struct machine_fw machineFwG; - -#define ia64_sal_entry machineFwG.ia64_sal_entryP - -#define smp_processor_id() 0 - -static inline uint64_t -xchg8(uint64_t* ptr, uint64_t x) \ -{ - uint64_t oldVal; - asm volatile ("xchg8 %0=[%1],%2" : "=r" (oldVal) - : "r" (ptr), "r" (x) : "memory"); - return oldVal; -} -#define xchg xchg8 - -// Counts the number of 1-bits in x. -#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# define get_popcnt(x) __builtin_popcountl(x) -#else -# define get_popcnt(x) \ - ({ \ - uint64_t num; \ - asm ("popcnt %0=%1" : "=r" (num) : "r" (x)); \ - num; \ - }) -#endif - -/** - * __ffs - find first bit in word. - * @x: The word to search - * - * Undefined if no bit exists, so code should check against 0 first. - */ -static inline unsigned long -__ffs (unsigned long x) -{ - unsigned long result; - - result = get_popcnt((x-1) & ~x); - return result; -} - - -static inline void -synch_clear_bit(int num, volatile void *addr) -{ - clear_bit(num, addr); -} - -static inline void -synch_set_bit(int num, volatile void *addr) -{ - set_bit(num, addr); -} - -static inline int -synch_test_bit(int nr, const volatile void *addr) -{ - return test_bit(nr, addr); -} - -static inline int -synch_test_and_set_bit(int num, volatile void * addr) -{ - return test_and_set_bit(num, addr); -} - - -#define synch_cmpxchg(ptr, old, new) \ -((__typeof__(*(ptr)))__synch_cmpxchg((ptr),\ - (unsigned long)(old), \ - (unsigned long)(new), \ - sizeof(*(ptr)))) - -static inline unsigned long -__synch_cmpxchg(volatile void *ptr, uint64_t old, uint64_t new, int size) -{ - switch (size) - { - case 1: - return ia64_cmpxchg_acq_8(ptr, old, new); - case 2: - return ia64_cmpxchg_acq_16(ptr, old, new); - case 4: - return ia64_cmpxchg_acq_32(ptr, old, new); - case 8: - return ia64_cmpxchg_acq_64(ptr, old, new); - } - return ia64_cmpxchg_acq_64(ptr, old, new); -} - -extern shared_info_t *HYPERVISOR_shared_info; - - -/* - * This code is from the originally os.h and should be put in a - * common header file! - */ - -/* - * The use of 'barrier' in the following reflects their use as local-lock - * operations. Reentrancy must be prevented (e.g., __cli()) /before/ following - * critical operations are executed. All critical operations must complete - * /before/ reentrancy is permitted (e.g., __sti()). Alpha architecture also - * includes these barriers, for example. - */ - -#define __cli() \ -do { \ - vcpu_info_t *_vcpu; \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ - _vcpu->evtchn_upcall_mask = 1; \ - barrier(); \ -} while (0) - -#define __sti() \ -do { \ - vcpu_info_t *_vcpu; \ - barrier(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ - _vcpu->evtchn_upcall_mask = 0; \ - barrier(); /* unmask then check (avoid races) */ \ - if (unlikely(_vcpu->evtchn_upcall_pending)) \ - force_evtchn_callback(); \ -} while (0) - -#define __save_flags(x) \ -do { \ - vcpu_info_t *_vcpu; \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ - (x) = _vcpu->evtchn_upcall_mask; \ -} while (0) - -#define __restore_flags(x) \ -do { \ - vcpu_info_t *_vcpu; \ - barrier(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ - if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \ - barrier(); /* unmask then check (avoid races) */ \ - if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ - force_evtchn_callback(); \ - }\ -} while (0) - -#define safe_halt() ((void)0) - -#define __save_and_cli(x) \ -do { \ - vcpu_info_t *_vcpu; \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ - (x) = _vcpu->evtchn_upcall_mask; \ - _vcpu->evtchn_upcall_mask = 1; \ - barrier(); \ -} while (0) - -#define local_irq_save(x) __save_and_cli(x) -#define local_irq_restore(x) __restore_flags(x) -#define local_save_flags(x) __save_flags(x) -#define local_irq_disable() __cli() -#define local_irq_enable() __sti() - -#define irqs_disabled() \ - (HYPERVISOR_shared_info->vcpu_info[smp_processor_id()].evtchn_upcall_mask) - -/* This is a barrier for the compiler only, NOT the processor! */ -#define barrier() __asm__ __volatile__("": : :"memory") - -#define mb() ia64_mf() -#define rmb() mb() -#define wmb() mb() - - -#define BUG() \ - { printk("mini-os BUG at %s:%d!\n", __FILE__, __LINE__); do_exit(); } - -#define PRINT_BV(_fmt, _params...) \ - if (bootverbose) \ - printk(_fmt , ## _params) - -#endif /* !defined(__ASSEMBLY__) */ - -#if defined(__ASSEMBLY__) - -#define UL_CONST(x) x -#define UL_TYPE(x) x - -#else /* defined(__ASSEMBLY__) */ - -#define UL_CONST(x) x##UL -#define UL_TYPE(x) ((uint64_t)x) - -#endif /* defined(__ASSEMBLY__) */ - -#endif /* !defined(__OS_H__) */ diff --git a/extras/mini-os/include/ia64/page.h b/extras/mini-os/include/ia64/page.h deleted file mode 100644 index 67be0a555d..0000000000 --- a/extras/mini-os/include/ia64/page.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * Common stuff for memory and page handling. - * Parts are taken from FreeBSD. - * - **************************************************************************** - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -#if !defined(_PAGE_H_) -#define _PAGE_H_ - -#include "os.h" -#include "ia64_cpu.h" - -#define PTE_KERNEL_ATTR ((PTE_P<<PTE_P_SHIFT) |\ - (PTE_MA_WB<<PTE_MA_SHIFT) |\ - (PTE_D<<PTE_D_SHIFT) |\ - (PTE_A<<PTE_A_SHIFT) |\ - (PTE_PL_KERN<<PTE_PL_SHIFT) |\ - (PTE_AR_RWX<<PTE_AR_SHIFT)) - - -/* The kernel tr page size for text and data. */ -#define KERNEL_TR_PAGE_SIZE PTE_PS_1M -/* The efi-pal page size for text and data. */ -#define PAL_TR_PAGE_SIZE PTE_PS_1M - -#include "arch_limits.h" -#define PAGE_SHIFT __PAGE_SHIFT -#define PAGE_SIZE __PAGE_SIZE -#define PAGE_MASK (~(PAGE_SIZE-1)) - -#define KSTACK_PAGES 4 /* 4 pages for the kernel stack + bsp */ - -#define IA64_TR_KERNEL 0 /* itr0, dtr0: maps kernel image (code) */ -#define IA64_TR_PAL 1 /* itr1: maps pal code */ - -/* - * Manipulating region bits of an address. - */ -#define IA64_RR_BASE(n) ((UL_TYPE(n)) << 61) -#define IA64_RR_MASK(x) ((UL_TYPE(x)) & ((1L << 61) - 1)) -#define IA64_RR_EXTR(x) ((x) >> 61) - -#define IA64_PHYS_TO_RR5(x) ((x) | IA64_RR_BASE(5)) -#define IA64_PHYS_TO_RR7(x) ((x) | IA64_RR_BASE(7)) - -#define __pa(x) IA64_RR_MASK(x) -#define __va(x) IA64_PHYS_TO_RR7(x) - -#define roundup_page(x) ((((unsigned long)(x)) + PAGE_SIZE -1) & PAGE_MASK) -#define trunc_page(x) ((unsigned long)(x) & PAGE_MASK) - - -#if !defined(__ASSEMBLY__) - -/* Contains the parts of the physically memory. */ -extern paddr_t phys_avail[]; - -#define page_to_pfn(page) ((uint64_t)(page) >> PAGE_SHIFT) -#define pfn_to_page(pfn) ((uint64_t)pfn << PAGE_SHIFT) -/* Get phyiscal address of page of virtual address. */ -#define virt_to_page(addr) ((uint64_t)__pa(addr) & PAGE_MASK) -#define virt_to_pfn(addr) (page_to_pfn(virt_to_page(addr))) - - -#endif /* __ASSEMBLY__ */ - - -/* For both see minios-ia64.lds. */ -/* This is where the kernel virtually starts. */ -#define KERNEL_START IA64_PHYS_TO_RR5(0x100000000) -/* !!!!! - * For physical start of kernel - * Currently used in arch/ia64/fw.S. - * !!!!! - */ -#define KERNEL_PHYS_START_SHIFT 20 - -/* A region 5 address to physical address */ -#define KERN_VIRT_2_PHYS(x) (((x) - KERNEL_START) + \ - (1 << KERNEL_PHYS_START_SHIFT)) - -/* Some protection keys for region 5 and 7 addresses. */ -#define IA64_KEY_REG7 0x234 /* Region 7 - identity mapped addresses */ -#define IA64_KEY_REG5 0x89a /* Region 5 - kernel addresses */ - -// This is xen specific ! -#define PAGE_SHIFT_XEN_16K 14 // For 16KB page size -#define mfn_to_virt(mfn) ((void*)__va((mfn) << PAGE_SHIFT_XEN_16K)) - -#endif /* !defined(_PAGE_H_) */ diff --git a/extras/mini-os/include/ia64/pal.h b/extras/mini-os/include/ia64/pal.h deleted file mode 100644 index 8eb853d07a..0000000000 --- a/extras/mini-os/include/ia64/pal.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * The code is mostly taken from FreeBSD. - * - **************************************************************************** - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - -#ifndef _PAL_H_ -#define _PAL_H_ - -/* - * Architected static calling convention procedures. - */ -#define PAL_CACHE_FLUSH 1 -#define PAL_CACHE_INFO 2 -#define PAL_CACHE_INIT 3 -#define PAL_CACHE_SUMMARY 4 -#define PAL_MEM_ATTRIB 5 -#define PAL_PTCE_INFO 6 -#define PAL_VM_INFO 7 -#define PAL_VM_SUMMARY 8 -#define PAL_BUS_GET_FEATURES 9 -#define PAL_BUS_SET_FEATURES 10 -#define PAL_DEBUG_INFO 11 -#define PAL_FIXED_ADDR 12 -#define PAL_FREQ_BASE 13 -#define PAL_FREQ_RATIOS 14 -#define PAL_PERF_MON_INFO 15 -#define PAL_PLATFORM_ADDR 16 -#define PAL_PROC_GET_FEATURE 17 -#define PAL_PROC_SET_FEATURE 18 -#define PAL_RSE_INFO 19 -#define PAL_VERSION 20 -#define PAL_MC_CLEAR_LOG 21 -#define PAL_MC_DRAIN 22 -#define PAL_MC_DYNAMIC_STATE 24 -#define PAL_MC_ERROR_INFO 25 -#define PAL_MC_EXPECTED 23 -#define PAL_MC_REGISTER_MEM 27 -#define PAL_MC_RESUME 26 -#define PAL_HALT 28 -#define PAL_HALT_LIGHT 29 -#define PAL_COPY_INFO 30 -#define PAL_CACHE_LINE_INIT 31 -#define PAL_PMI_ENTRYPOINT 32 -#define PAL_ENTER_IA_32_ENV 33 -#define PAL_VM_PAGE_SIZE 34 -#define PAL_MEM_FOR_TEST 37 -#define PAL_CACHE_PROT_INFO 38 -#define PAL_REGISTER_INFO 39 -#define PAL_SHUTDOWN 40 -#define PAL_PREFETCH_VISIBILITY 41 - - -struct ia64_pal_result -{ - int64_t pal_status; - uint64_t pal_result[3]; -}; - -extern struct ia64_pal_result - ia64_call_pal_static(uint64_t proc, uint64_t arg1, - uint64_t arg2, uint64_t arg3); - -#endif /* _PAL_H_ */ diff --git a/extras/mini-os/include/ia64/privop.h b/extras/mini-os/include/ia64/privop.h deleted file mode 100644 index d8cdbae127..0000000000 --- a/extras/mini-os/include/ia64/privop.h +++ /dev/null @@ -1,97 +0,0 @@ - -/* - * Copyright (C) 2005 Hewlett-Packard Co - * Dan Magenheimer <dan.magenheimer@hp.com> - * - * Paravirtualizations of privileged operations for Xen/ia64 - * - */ - -#ifndef _PRIVOP_H_ -#define _PRIVOP_H_ - -#include <xen/arch-ia64.h> - -#define IA64_PARAVIRTUALIZED - -/* At 1 MB, before per-cpu space but still addressable using addl instead - of movl. */ -#define XSI_BASE 0xfffffffffff00000 - -/* Address of mapped regs. */ -#define XMAPPEDREGS_BASE (XSI_BASE + XSI_SIZE) - -#ifdef __ASSEMBLY__ -#define XEN_HYPER_RFI break HYPERPRIVOP_RFI -#define XEN_HYPER_RSM_PSR_DT break HYPERPRIVOP_RSM_DT -#define XEN_HYPER_SSM_PSR_DT break HYPERPRIVOP_SSM_DT -#define XEN_HYPER_COVER break HYPERPRIVOP_COVER -#define XEN_HYPER_ITC_D break HYPERPRIVOP_ITC_D -#define XEN_HYPER_ITC_I break HYPERPRIVOP_ITC_I -#define XEN_HYPER_SSM_I break HYPERPRIVOP_SSM_I -#define XEN_HYPER_GET_IVR break HYPERPRIVOP_GET_IVR -#define XEN_HYPER_GET_TPR break HYPERPRIVOP_GET_TPR -#define XEN_HYPER_SET_TPR break HYPERPRIVOP_SET_TPR -#define XEN_HYPER_EOI break HYPERPRIVOP_EOI -#define XEN_HYPER_SET_ITM break HYPERPRIVOP_SET_ITM -#define XEN_HYPER_THASH break HYPERPRIVOP_THASH -#define XEN_HYPER_PTC_GA break HYPERPRIVOP_PTC_GA -#define XEN_HYPER_ITR_D break HYPERPRIVOP_ITR_D -#define XEN_HYPER_GET_RR break HYPERPRIVOP_GET_RR -#define XEN_HYPER_SET_RR break HYPERPRIVOP_SET_RR -#define XEN_HYPER_SET_KR break HYPERPRIVOP_SET_KR -#define XEN_HYPER_FC break HYPERPRIVOP_FC -#define XEN_HYPER_GET_CPUID break HYPERPRIVOP_GET_CPUID -#define XEN_HYPER_GET_PMD break HYPERPRIVOP_GET_PMD -#define XEN_HYPER_GET_EFLAG break HYPERPRIVOP_GET_EFLAG -#define XEN_HYPER_SET_EFLAG break HYPERPRIVOP_SET_EFLAG -#define XEN_HYPER_RSM_BE break HYPERPRIVOP_RSM_BE -#define XEN_HYPER_GET_PSR break HYPERPRIVOP_GET_PSR - -#define XSI_IFS (XSI_BASE + XSI_IFS_OFS) -#define XSI_PRECOVER_IFS (XSI_BASE + XSI_PRECOVER_IFS_OFS) -#define XSI_INCOMPL_REGFR (XSI_BASE + XSI_INCOMPL_REGFR_OFS) -#define XSI_IFA (XSI_BASE + XSI_IFA_OFS) -#define XSI_ISR (XSI_BASE + XSI_ISR_OFS) -#define XSI_IIM (XSI_BASE + XSI_IIM_OFS) -#define XSI_ITIR (XSI_BASE + XSI_ITIR_OFS) -#define XSI_PSR_I_ADDR (XSI_BASE + XSI_PSR_I_ADDR_OFS) -#define XSI_PSR_IC (XSI_BASE + XSI_PSR_IC_OFS) -#define XSI_IPSR (XSI_BASE + XSI_IPSR_OFS) -#define XSI_IIP (XSI_BASE + XSI_IIP_OFS) -#define XSI_BANK1_R16 (XSI_BASE + XSI_BANK1_R16_OFS) -#define XSI_BANKNUM (XSI_BASE + XSI_BANKNUM_OFS) -#define XSI_IHA (XSI_BASE + XSI_IHA_OFS) -#endif - -#ifndef __ASSEMBLY__ -#define XEN_HYPER_SSM_I asm("break %0" : : "i" (HYPERPRIVOP_SSM_I)) -#define XEN_HYPER_GET_IVR asm("break %0" : : "i" (HYPERPRIVOP_GET_IVR)) - -/************************************************/ -/* Instructions paravirtualized for performance */ -/************************************************/ - -/* Xen uses memory-mapped virtual privileged registers for access to many - * performance-sensitive privileged registers. Some, like the processor - * status register (psr), are broken up into multiple memory locations. - * Others, like "pend", are abstractions based on privileged registers. - * "Pend" is guaranteed to be set if reading cr.ivr would return a - * (non-spurious) interrupt. */ -#define XEN_MAPPEDREGS ((struct mapped_regs *)XMAPPEDREGS_BASE) -#define XSI_PSR_I \ - (*XEN_MAPPEDREGS->interrupt_mask_addr) -#define xen_get_virtual_psr_i() \ - (!XSI_PSR_I) -#define xen_set_virtual_psr_i(_val) \ - ({ XSI_PSR_I = (uint8_t)(_val) ? 0 : 1; }) -#define xen_get_virtual_psr_ic() \ - ( XEN_MAPPEDREGS->interrupt_collection_enabled ) -#define xen_set_virtual_psr_ic(_val) \ - ({ XEN_MAPPEDREGS->interrupt_collection_enabled = _val ? 1 : 0; }) -#define xen_get_virtual_pend() (XEN_MAPPEDREGS->pending_interruption) - -#endif /* __ASSEMBLY__ */ - -#endif /* _PRIVOP_H_ */ - diff --git a/extras/mini-os/include/ia64/sal.h b/extras/mini-os/include/ia64/sal.h deleted file mode 100644 index c0271c771a..0000000000 --- a/extras/mini-os/include/ia64/sal.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * The code is mostly taken from FreeBSD. - * - **************************************************************************** - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - - -/* - * The SAL System Table starts with a header which is described in - * sal_system_table_t. - * Table header will be followed by a variable number of variable length - * entries. The first byte of each entry will identify the entry type and - * the entries shall be in ascending order by the entry type. Each entry - * type will have a known fixed length. The total length of this table - * depends upon the configuration of the system. Operating system software - * must step through each entry until it reaches the ENTRY_COUNT. The entries - * are sorted on entry type in ascending order. - * Unless otherwise stated, there is one entry per entry type. - */ - -#ifndef _SAL_H_ -#define _SAL_H_ - -typedef uint64_t u_int64_t; -typedef uint32_t u_int32_t; -typedef uint16_t u_int16_t; -typedef uint8_t u_int8_t; - -struct sal_system_table { - char sal_signature[4]; -#define SAL_SIGNATURE "SST_" - uint32_t sal_length; - uint8_t sal_rev[2]; /* Byte 8 - Minor, Byte 0 - Major */ - uint16_t sal_entry_count; // num entries in var part - uint8_t sal_checksum; - uint8_t sal_reserved1[7]; - uint8_t sal_a_version[2]; // like sal_rev - uint8_t sal_b_version[2]; // like sal_rev - char sal_oem_id[32]; // Ascii - manufacturer of HW - char sal_product_id[32]; // ascii - identification - uint8_t sal_reserved2[8]; -}; - -typedef struct sal_system_table sal_system_table_t; - -#define SAL_DESC_ENTRYPOINT 0 -#define SAL_DESC_ENTRYPOINT_LENGTH 48 -#define SAL_DESC_MEMORY 1 -#define SAL_DESC_MEMORY_LENGTH 32 -#define SAL_DESC_PLATFORM 2 -#define SAL_DESC_PLATFORM_LENGT 16 -#define SAL_DESC_TR_REG 3 -#define SAL_DESC_TR_REG_LENGTH 32 -#define SAL_DESC_PURGE_TR_CACHE 4 -#define SAL_DESC_PURGE_TR_CACHE_LENGTH 16 -#define SAL_DESC_AP_WAKEUP 5 -#define SAL_DESC_AP_WAKEUP_LENGTH 16 - - -struct sal_entrypoint_descriptor -{ - uint8_t sale_type; /* == 0 */ - uint8_t sale_reserved1[7]; - uint64_t sale_pal_proc; /* PAL_PROC entry point */ - uint64_t sale_sal_proc; /* SAL_PROC entry point */ - uint64_t sale_sal_gp; /* gp for SAL_PROC, PAL_PROC */ - uint8_t sale_reserved2[16]; -}; - -struct sal_memory_descriptor -{ - uint8_t sale_type; /* == 1 */ - uint8_t sale_need_virtual; - uint8_t sale_current_attribute; - uint8_t sale_access_rights; - uint8_t sale_supported_attributes; - uint8_t sale_reserved1; - uint8_t sale_memory_type[2]; - uint64_t sale_physical_address; - uint32_t sale_length; - uint8_t sale_reserved2[12]; -}; - -struct sal_platform_descriptor -{ - uint8_t sale_type; /* == 2 */ - uint8_t sale_features; - uint8_t sale_reserved[14]; -}; - -struct sal_tr_descriptor -{ - u_int8_t sale_type; /* == 3 */ - u_int8_t sale_register_type; - u_int8_t sale_register_number; - u_int8_t sale_reserved1[5]; - u_int64_t sale_virtual_address; - u_int64_t sale_page_size; - u_int8_t sale_reserved2[8]; -}; - -struct sal_ptc_cache_descriptor -{ - uint8_t sale_type; /* == 4 */ - uint8_t sale_reserved[3]; - uint32_t sale_domains; - uint64_t sale_address; -}; - -struct sal_ap_wakeup_descriptor -{ - uint8_t sale_type; /* == 5 */ - uint8_t sale_mechanism; - uint8_t sale_reserved[6]; - uint64_t sale_vector; -}; - -/* - * SAL Procedure numbers. - */ - -#define SAL_SET_VECTORS 0x01000000 -#define SAL_GET_STATE_INFO 0x01000001 -#define SAL_GET_STATE_INFO_SIZE 0x01000002 -#define SAL_CLEAR_STATE_INFO 0x01000003 -#define SAL_MC_RENDEZ 0x01000004 -#define SAL_MC_SET_PARAMS 0x01000005 -#define SAL_REGISTER_PHYSICAL_ADDR 0x01000006 -#define SAL_CACHE_FLUSH 0x01000008 -#define SAL_CACHE_INIT 0x01000009 -#define SAL_PCI_CONFIG_READ 0x01000010 -#define SAL_PCI_CONFIG_WRITE 0x01000011 -#define SAL_FREQ_BASE 0x01000012 -#define SAL_UPDATE_PAL 0x01000020 - -/* SAL_SET_VECTORS event handler types */ -#define SAL_OS_MCA 0 -#define SAL_OS_INIT 1 -#define SAL_OS_BOOT_RENDEZ 2 - -/* SAL_GET_STATE_INFO, SAL_GET_STATE_INFO_SIZE types */ -#define SAL_INFO_MCA 0 -#define SAL_INFO_INIT 1 -#define SAL_INFO_CMC 2 -#define SAL_INFO_CPE 3 -#define SAL_INFO_TYPES 4 /* number of types we know about */ - -struct ia64_sal_result -{ - int64_t sal_status; - uint64_t sal_result[3]; -}; -typedef struct ia64_sal_result ia64_sal_result_t; - -typedef ia64_sal_result_t sal_entry_t - ( uint64_t, uint64_t, uint64_t, uint64_t, - uint64_t, uint64_t, uint64_t, uint64_t - ); - -extern ia64_sal_result_t ia64_sal_call(uint64_t, uint64_t, uint64_t, uint64_t, - uint64_t, uint64_t, uint64_t, uint64_t); - -extern void ia64_sal_init(sal_system_table_t *saltab); - -#endif /* _SAL_H_ */ diff --git a/extras/mini-os/include/ia64/traps.h b/extras/mini-os/include/ia64/traps.h deleted file mode 100644 index cd5589c31d..0000000000 --- a/extras/mini-os/include/ia64/traps.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Done by Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * - **************************************************************************** - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#if !defined(_TRAPS_H_) -#define _TRAPS_H_ - -#if !defined(__ASSEMBLY__) - -/* See ia64_cpu.h */ -struct trap_frame; - -#define pt_regs trap_frame - -/* - * A dummy function, which is currently not supported. - */ -inline static void trap_init(void) -{ - //printk("trap_init() until now not needed!\n"); -} -inline static void trap_fini(void) -{ - //printk("trap_fini() until now not needed!\n"); -} - - -#endif /* !defined(__ASSEMBLY__) */ - -#include "ia64_cpu.h" - -void stack_walk(void); - -#endif /* !defined(_TRAPS_H_) */ - diff --git a/extras/mini-os/include/mm.h b/extras/mini-os/include/mm.h index 2fd43f30b2..a94cd6de46 100644 --- a/extras/mini-os/include/mm.h +++ b/extras/mini-os/include/mm.h @@ -29,8 +29,6 @@ #include <xen/arch-x86_32.h> #elif defined(__x86_64__) #include <xen/arch-x86_64.h> -#elif defined(__ia64__) -#include <xen/arch-ia64.h> #else #error "Unsupported architecture" #endif diff --git a/extras/mini-os/include/posix/limits.h b/extras/mini-os/include/posix/limits.h index b8e168a54f..5d2b8643c8 100644 --- a/extras/mini-os/include/posix/limits.h +++ b/extras/mini-os/include/posix/limits.h @@ -25,7 +25,7 @@ #define SHRT_MAX 0x7fff #define USHRT_MAX 0xffff -#if defined(__x86_64__) || defined(__ia64__) +#if defined(__x86_64__) # define LONG_MAX 0x7fffffffffffffffL # define ULONG_MAX 0xffffffffffffffffUL #else diff --git a/extras/mini-os/include/sched.h b/extras/mini-os/include/sched.h index ea3239d602..3d99d7d845 100644 --- a/extras/mini-os/include/sched.h +++ b/extras/mini-os/include/sched.h @@ -12,13 +12,9 @@ struct thread { char *name; char *stack; -#if !defined(__ia64__) /* keep in that order */ unsigned long sp; /* Stack pointer */ unsigned long ip; /* Instruction pointer */ -#else /* !defined(__ia64__) */ - thread_regs_t regs; -#endif /* !defined(__ia64__) */ MINIOS_TAILQ_ENTRY(struct thread) thread_list; uint32_t flags; s_time_t wakeup_time; diff --git a/extras/mini-os/include/types.h b/extras/mini-os/include/types.h index 456e21ac06..6640ede52b 100644 --- a/extras/mini-os/include/types.h +++ b/extras/mini-os/include/types.h @@ -33,7 +33,7 @@ typedef unsigned long long u_quad_t; typedef struct { unsigned long pte_low, pte_high; } pte_t; -#elif defined(__x86_64__) || defined(__ia64__) +#elif defined(__x86_64__) typedef long quad_t; typedef unsigned long u_quad_t; @@ -54,7 +54,7 @@ typedef struct { unsigned long pte; } pte_t; #ifdef __i386__ typedef unsigned int uintptr_t; typedef int intptr_t; -#elif defined(__x86_64__) || defined(__ia64__) +#elif defined(__x86_64__) typedef unsigned long uintptr_t; typedef long intptr_t; #endif /* __i386__ || __x86_64__ */ @@ -67,7 +67,7 @@ typedef signed int int32_t; #ifdef __i386__ typedef signed long long int64_t; typedef unsigned long long uint64_t; -#elif defined(__x86_64__) || defined(__ia64__) +#elif defined(__x86_64__) typedef signed long int64_t; typedef unsigned long uint64_t; #endif |