/trunk/kernel/arch/sparc64/include/arch.h |
---|
29,7 → 29,9 |
/** @addtogroup sparc64 |
* @{ |
*/ |
/** @file |
/** |
* @file |
* @brief Various sparc64-specific macros. |
*/ |
#ifndef __sparc64_ARCH_H__ |
38,8 → 40,9 |
#define ASI_AIUP 0x10 /** Access to primary context with user privileges. */ |
#define ASI_AIUS 0x11 /** Access to secondary context with user privileges. */ |
#define NWINDOW 8 /** Number of register window sets. */ |
#endif |
/** @} |
*/ |
/trunk/kernel/arch/sparc64/include/proc/thread.h |
---|
26,22 → 26,24 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup sparc64proc |
/** @addtogroup sparc64proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __sparc64_THREAD_H__ |
#define __sparc64_THREAD_H__ |
#ifndef KERN_sparc64_THREAD_H_ |
#define KERN_sparc64_THREAD_H_ |
#include <arch/types.h> |
#include <arch/arch.h> |
typedef struct { |
/** Buffer for register windows with userspace content. */ |
uint8_t *uspace_window_buffer; |
} thread_arch_t; |
#define thread_create_arch(t) |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/sparc64/include/trap/regwin.h |
---|
50,8 → 50,6 |
#define SPILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
#define FILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
#define NWINDOW 8 |
/* Window Save Area offsets. */ |
#define L0_OFFSET 0 |
#define L1_OFFSET 8 |
249,4 → 247,3 |
/** @} |
*/ |
/trunk/kernel/arch/sparc64/include/barrier.h |
---|
51,10 → 51,14 |
/* |
* The FLUSH instruction takes address parameter. |
* As such, it may trap if the address is not found in DTLB. |
* However, JPS1 implementations are free to ignore the trap. |
* |
* The entire kernel text is mapped by a locked ITLB and |
* DTLB entries. Therefore, when this function is called, |
* the %o7 register will always be in the range mapped by |
* DTLB. |
*/ |
__asm__ volatile ("flush %0\n" :: "r" (0x400000)); |
__asm__ volatile ("flush %o7\n"); |
} |
/** Memory Barrier instruction. */ |
/trunk/kernel/arch/sparc64/Makefile.inc |
---|
94,6 → 94,7 |
arch/$(ARCH)/src/sparc64.c \ |
arch/$(ARCH)/src/start.S \ |
arch/$(ARCH)/src/proc/scheduler.c \ |
arch/$(ARCH)/src/proc/thread.c \ |
arch/$(ARCH)/src/trap/trap_table.S \ |
arch/$(ARCH)/src/trap/trap.c \ |
arch/$(ARCH)/src/trap/exception.c \ |
/trunk/kernel/arch/sparc64/src/proc/thread.c |
---|
0,0 → 1,65 |
/* |
* Copyright (C) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - 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. |
*/ |
/** @addtogroup sparc64proc |
* @{ |
*/ |
/** @file |
*/ |
#include <proc/thread.h> |
#include <arch/proc/thread.h> |
#include <mm/frame.h> |
void thr_constructor_arch(thread_t *t) |
{ |
/* |
* Allocate memory for uspace_window_buffer. |
*/ |
t->arch.uspace_window_buffer = NULL; |
} |
void thr_destructor_arch(thread_t *t) |
{ |
if (t->arch.uspace_window_buffer) |
frame_free((uintptr_t) t->arch.uspace_window_buffer); |
} |
void thread_create_arch(thread_t *t) |
{ |
if ((t->flags & THREAD_FLAG_USPACE) && (!t->arch.uspace_window_buffer)) { |
/* |
* The thread needs userspace window buffer and the object |
* returned from the slab allocator doesn't have any. |
*/ |
t->arch.uspace_window_buffer = frame_alloc(ONE_FRAME, 0); |
} |
} |
/** @} |
*/ |
/trunk/kernel/arch/ia64/include/proc/thread.h |
---|
26,22 → 26,23 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ia64proc |
/** @addtogroup ia64proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ia64_THREAD_H__ |
#define __ia64_THREAD_H__ |
#ifndef KERN_ia64_THREAD_H_ |
#define KERN_ia64_THREAD_H_ |
typedef struct { |
} thread_arch_t; |
#define thr_constructor_arch(t) |
#define thr_destructor_arch(t) |
#define thread_create_arch(t) |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/ppc32/include/proc/thread.h |
---|
26,22 → 26,23 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ppc32proc |
/** @addtogroup ppc32proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ppc32_THREAD_H__ |
#define __ppc32_THREAD_H__ |
#ifndef KERN_ppc32_THREAD_H_ |
#define KERN_ppc32_THREAD_H_ |
typedef struct { |
} thread_arch_t; |
#define thr_constructor_arch(t) |
#define thr_destructor_arch(t) |
#define thread_create_arch(t) |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/amd64/include/proc/task.h |
---|
26,14 → 26,14 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup amd64proc |
/** @addtogroup amd64proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __amd64_TASK_H__ |
#define __amd64_TASK_H__ |
#ifndef KERN_amd64_TASK_H_ |
#define KERN_amd64_TASK_H_ |
#include <typedefs.h> |
#include <arch/types.h> |
46,6 → 46,5 |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/amd64/include/proc/thread.h |
---|
26,14 → 26,14 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup amd64proc |
/** @addtogroup amd64proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __amd64_THREAD_H__ |
#define __amd64_THREAD_H__ |
#ifndef KERN_amd64_THREAD_H_ |
#define KERN_amd64_THREAD_H_ |
#include <arch/types.h> |
41,8 → 41,10 |
unative_t tls; |
} thread_arch_t; |
#define thr_constructor_arch(t) |
#define thr_destructor_arch(t) |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/amd64/src/proc/thread.c |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup amd64proc |
/** @addtogroup amd64proc |
* @{ |
*/ |
/** @file |
43,6 → 43,5 |
t->arch.tls = 0; |
} |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/ppc64/include/proc/thread.h |
---|
26,22 → 26,24 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ppc64proc |
/** @addtogroup ppc64proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ppc64_THREAD_H__ |
#define __ppc64_THREAD_H__ |
#ifndef KERN_ppc64_THREAD_H_ |
#define KERN_ppc64_THREAD_H_ |
typedef struct { |
} thread_arch_t; |
#define thr_constructor_arch(t) |
#define thr_destructor_arch(t) |
#define thread_create_arch(t) |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/mips32/include/proc/thread.h |
---|
26,22 → 26,24 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup mips32proc |
/** @addtogroup mips32proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __mips32_THREAD_H__ |
#define __mips32_THREAD_H__ |
#ifndef KERN_mips32_THREAD_H_ |
#define KERN_mips32_THREAD_H_ |
typedef struct { |
} thread_arch_t; |
#define thr_constructor_arch(t) |
#define thr_destructor_arch(t) |
#define thread_create_arch(t) |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/ia32/include/proc/task.h |
---|
26,14 → 26,14 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ia32proc |
/** @addtogroup ia32proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ia32_TASK_H__ |
#define __ia32_TASK_H__ |
#ifndef KERN_ia32_TASK_H_ |
#define KERN_ia32_TASK_H_ |
#include <typedefs.h> |
#include <arch/types.h> |
46,6 → 46,5 |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/ia32/include/proc/thread.h |
---|
26,14 → 26,14 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ia32proc |
/** @addtogroup ia32proc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ia32_THREAD_H__ |
#define __ia32_THREAD_H__ |
#ifndef KERN_ia32_THREAD_H_ |
#define KERN_ia32_THREAD_H_ |
#include <arch/types.h> |
41,8 → 41,10 |
unative_t tls; |
} thread_arch_t; |
#define thr_constructor_arch(t) |
#define thr_destructor_arch(t) |
#endif |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/ia32/src/proc/scheduler.c |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ia32proc |
/** @addtogroup ia32proc |
* @{ |
*/ |
/** @file |
77,6 → 77,5 |
{ |
} |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/ia32/src/proc/task.c |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ia32proc |
/** @addtogroup ia32proc |
* @{ |
*/ |
/** @file |
57,6 → 57,5 |
free(t->arch.iomap.map); |
} |
/** @} |
/** @} |
*/ |
/trunk/kernel/arch/ia32/src/proc/thread.c |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup ia32proc |
/** @addtogroup ia32proc |
* @{ |
*/ |
/** @file |
43,6 → 43,6 |
t->arch.tls = 0; |
} |
/** @} |
/** @} |
*/ |