/trunk/kernel/generic/include/mm/as.h |
---|
62,8 → 62,6 |
#define USER_ADDRESS_SPACE_START USER_ADDRESS_SPACE_START_ARCH |
#define USER_ADDRESS_SPACE_END USER_ADDRESS_SPACE_END_ARCH |
#define IS_KA(addr) ((addr)>=KERNEL_ADDRESS_SPACE_START && (addr)<=KERNEL_ADDRESS_SPACE_END) |
#define USTACK_ADDRESS USTACK_ADDRESS_ARCH |
#define FLAG_AS_KERNEL (1 << 0) /**< Kernel address space. */ |
/trunk/kernel/arch/sparc64/src/mm/tlb.c |
---|
103,7 → 103,7 |
data.cv = cacheable; |
data.p = true; |
data.w = true; |
data.g = true; |
data.g = false; |
dtlb_data_in_write(data.value); |
} |
/trunk/kernel/arch/sparc64/src/start.S |
---|
125,11 → 125,28 |
or %r1, %r2, %r1; |
! write DTLB data and install the kernel mapping |
SET_TLB_DATA(g1, g2, TTE_G) |
SET_TLB_DATA(g1, g2, 0) ! use non-global mapping |
stxa %g1, [%g0] ASI_DTLB_DATA_IN_REG |
membar #Sync |
/* |
* Because we cannot use global mappings (because we want to |
* have separate 64-bit address spaces for both the kernel |
* and the userspace), we prepare the identity mapping also in |
* context 1. This step is required by the |
* code installing the ITLB mapping. |
*/ |
! write DTLB tag of context 1 (i.e. MEM_CONTEXT_TEMP) |
SET_TLB_TAG(g1, MEM_CONTEXT_TEMP) |
stxa %g1, [VA_DMMU_TAG_ACCESS] %asi |
membar #Sync |
! write DTLB data and install the kernel mapping in context 1 |
SET_TLB_DATA(g1, g2, 0) ! use non-global mapping |
stxa %g1, [%g0] ASI_DTLB_DATA_IN_REG |
membar #Sync |
/* |
* Now is time to take over the IMMU. |
* Unfortunatelly, it cannot be done as easily as the DMMU, |
* because the IMMU is mapping the code it executes. |
/trunk/uspace/libc/include/as.h |
---|
40,8 → 40,6 |
#include <kernel/arch/mm/as.h> |
#include <kernel/mm/as.h> |
#define USER_ADDRESS_SPACE_SIZE_ARCH (USER_ADDRESS_SPACE_END_ARCH-USER_ADDRESS_SPACE_START_ARCH+1) |
extern void *as_area_create(void *address, size_t size, int flags); |
extern int as_area_resize(void *address, size_t size, int flags); |
extern int as_area_destroy(void *address); |
/trunk/uspace/libc/include/stdio.h |
---|
40,8 → 40,18 |
#define EOF (-1) |
#include <string.h> |
#include <io/stream.h> |
#define DEBUG(fmt, ...) \ |
{ \ |
char buf[256]; \ |
int n; \ |
n = snprintf(buf, sizeof(buf), fmt, ##__VA_ARGS__); \ |
if (n > 0) \ |
(void) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, strlen(buf)); \ |
} |
extern int getchar(void); |
extern int puts(const char * str); |
/trunk/uspace/libc/generic/as.c |
---|
36,7 → 36,13 |
#include <libc.h> |
#include <unistd.h> |
#include <align.h> |
#include <types.h> |
/** |
* Either 4*256M on 32-bit architecures or 16*256M on 64-bit architectures. |
*/ |
#define MAX_HEAP_SIZE (sizeof(uintptr_t)<<28) |
/** Create address space area. |
* |
* @param address Virtual address where to place new address space area. |
141,7 → 147,7 |
/* Set heapsize to some meaningful value */ |
if (maxheapsize == -1) |
set_maxheapsize(ALIGN_UP(USER_ADDRESS_SPACE_SIZE_ARCH >> 1, PAGE_SIZE)); |
set_maxheapsize(MAX_HEAP_SIZE); |
if (!last_allocated) |
last_allocated = (void *) ALIGN_UP((void *) &_heap + maxheapsize, PAGE_SIZE); |
/trunk/uspace/libc/generic/psthread.c |
---|
61,7 → 61,7 |
/** Counter of threads residing in async_manager */ |
static int threads_in_manager; |
/** Setup PSthread information into TCB structure */ |
/** Setup psthread information into TCB structure */ |
psthread_data_t * psthread_setup() |
{ |
psthread_data_t *pt; |
89,7 → 89,7 |
free(pt); |
} |
/** Function that is called on entry to new uspace thread */ |
/** Function that is called on entry to new pseudo thread */ |
void psthread_main(void) |
{ |
psthread_data_t *pt = __tcb_get()->pst_data; |
209,8 → 209,7 |
return retval; |
} |
/** |
* Create a userspace thread |
/** Create a userspace pseudo thread. |
* |
* @param func Pseudo thread function. |
* @param arg Argument to pass to func. |
/trunk/uspace/libc/arch/sparc64/include/syscall.h |
---|
50,6 → 50,7 |
"ta %5\n" |
: "=r" (a1) |
: "r" (a1), "r" (a2), "r" (a3), "r" (a4), "i" (id) |
: "memory" |
); |
return a1; |