Changeset d681c17 in mainline for uspace


Ignore:
Timestamp:
2006-09-05T14:52:11Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5035eeb7
Parents:
2def788
Message:

sparc64 work.

  • the syscall wrapper needs to use the "memory" clobber specifier to prevent over-optimization.
  • on sparc64, the user address space spans the whole 64-bit space and therefore the macro USER_ADDRESS_SPACE_SIZE_ARCH, as it was defined, overflows to 0
  • stop using USER_ADDRESS_SPACE_SIZE_ARCH and define MAX_HEAP_SIZE instead
  • in our situation when kernel and user address spaces are separate, the G (global) bit cannot be used (there is no point in it anymore)
  • add the DEBUG() macro to stdio.h; DEBUG() uses SYS_IO and is a good debugging tool for getting early userspace to work
Location:
uspace/libc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/libc/arch/sparc64/include/syscall.h

    r2def788 rd681c17  
    5151                : "=r" (a1)
    5252                : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "i" (id)
     53                : "memory"
    5354        );
    5455       
  • uspace/libc/generic/as.c

    r2def788 rd681c17  
    3737#include <unistd.h>
    3838#include <align.h>
     39#include <types.h>
     40
     41/**
     42 * Either 4*256M on 32-bit architecures or 16*256M on 64-bit architectures.
     43 */
     44#define MAX_HEAP_SIZE   (sizeof(uintptr_t)<<28)
    3945
    4046/** Create address space area.
     
    142148        /* Set heapsize to some meaningful value */
    143149        if (maxheapsize == -1)
    144                 set_maxheapsize(ALIGN_UP(USER_ADDRESS_SPACE_SIZE_ARCH >> 1, PAGE_SIZE));
     150                set_maxheapsize(MAX_HEAP_SIZE);
    145151       
    146152        if (!last_allocated)
  • uspace/libc/generic/psthread.c

    r2def788 rd681c17  
    6262static int threads_in_manager;
    6363
    64 /** Setup PSthread information into TCB structure */
     64/** Setup psthread information into TCB structure */
    6565psthread_data_t * psthread_setup()
    6666{
     
    9090}
    9191
    92 /** Function that is called on entry to new uspace thread */
     92/** Function that is called on entry to new pseudo thread */
    9393void psthread_main(void)
    9494{
     
    210210}
    211211
    212 /**
    213  * Create a userspace thread
     212/** Create a userspace pseudo thread.
    214213 *
    215214 * @param func Pseudo thread function.
  • uspace/libc/include/as.h

    r2def788 rd681c17  
    4141#include <kernel/mm/as.h>
    4242
    43 #define USER_ADDRESS_SPACE_SIZE_ARCH (USER_ADDRESS_SPACE_END_ARCH-USER_ADDRESS_SPACE_START_ARCH+1)
    44 
    4543extern void *as_area_create(void *address, size_t size, int flags);
    4644extern int as_area_resize(void *address, size_t size, int flags);
  • uspace/libc/include/stdio.h

    r2def788 rd681c17  
    4141#define EOF (-1)
    4242
     43#include <string.h>
    4344#include <io/stream.h>
     45
     46#define DEBUG(fmt, ...) \
     47{ \
     48        char buf[256]; \
     49        int n; \
     50        n = snprintf(buf, sizeof(buf), fmt, ##__VA_ARGS__); \
     51        if (n > 0) \
     52                (void) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, strlen(buf)); \
     53}
    4454
    4555extern int getchar(void);
Note: See TracChangeset for help on using the changeset viewer.