VirtualBox

儲存庫 kStuff 的更動 24


忽略:
時間撮記:
2009-2-8 下午01:58:54 (16 年 以前)
作者:
bird
訊息:

darwin porting.

位置:
trunk
檔案:
新增 2 筆資料
修改 6 筆資料

圖例:

未更動
新增
刪除
  • trunk/Config.kmk

    r8 r24  
    55
    66#
    7 # Copyright (c) 2006-2007 knut st. osmundsen <[email protected]>
     7# Copyright (c) 2006-2008 knut st. osmundsen <[email protected]>
    88#
    99# This file is part of kStuff.
     
    3434#
    3535TEMPLATE_kStuff = kStuff Template
    36 TEMPLATE_kStuff_TOOL             = GCC3
    37 TEMPLATE_kStuff_TOOL.darwin      = GCC4MACHO
    38 TEMPLATE_kStuff_TOOL.os2         = GCC3OMF
    39 TEMPLATE_kStuff_TOOL.solaris     = GCC3PLAIN
     36TEMPLATE_kStuff_TOOL             = GXX3
     37TEMPLATE_kStuff_TOOL.darwin      = GXX4MACHO
     38TEMPLATE_kStuff_TOOL.os2         = GXX3OMF
     39TEMPLATE_kStuff_TOOL.solaris     = GXX3PLAIN
    4040TEMPLATE_kStuff_TOOL.win.x86     = VCC70
    4141TEMPLATE_kStuff_TOOL.win.amd64   = VCC80AMD64
     
    8282endif
    8383
    84 TEMPLATE_kStuff_CXXFLAGS.darwin  = -g -fno-common
    85 TEMPLATE_kStuff_CXXFLAGS.freebsd = -g
    86 TEMPLATE_kStuff_CXXFLAGS.linux   = -g
    87 TEMPLATE_kStuff_CXXFLAGS.os2     = -g
     84TEMPLATE_kStuff_CXXFLAGS.darwin  = -g -fno-exceptions -fno-common
     85TEMPLATE_kStuff_CXXFLAGS.freebsd = -g -fno-exceptions
     86TEMPLATE_kStuff_CXXFLAGS.linux   = -g -fno-exceptions
     87TEMPLATE_kStuff_CXXFLAGS.os2     = -g -fno-exceptions
    8888TEMPLATE_kStuff_CXXFLAGS.win     = -Zi -Zl -W3 -GF -GR-
    8989TEMPLATE_kStuff_CXXFLAGS.win.x86 = -MD
  • trunk/Makefile.kmk

    r5 r24  
    3434
    3535include $(PATH_SUB_CURRENT)/kHlp/Makefile.kmk
    36 include $(PATH_SUB_CURRENT)/kProfiler2/Makefile.kmk
     36ifn1of ($(KBUILD_TARGET), darwin)
     37 include $(PATH_SUB_CURRENT)/kProfiler2/Makefile.kmk
     38endif
    3739
    3840LIBRARIES += kStuffStatic
  • trunk/kHlp/Bare/kHlpBareThread.c

    r2 r24  
    3737
    3838#if K_OS == K_OS_DARWIN
     39# include <mach/mach_time.h>
    3940
    4041#elif K_OS == K_OS_LINUX
     
    5960{
    6061#if K_OS == K_OS_DARWIN
    61     /** @todo mach_wait_until, see gen/nanosleep.c. */
    62     usleep(cMillies * 1000);
     62    static struct mach_timebase_info   s_Info;
     63    static KBOOL                s_fNanoseconds = K_UNKNOWN;
     64    KU64 uNow = mach_absolute_time();
     65    KU64 uDeadline;
     66    KU64 uPeriod;
     67
     68    if (s_fNanoseconds == K_UNKNOWN)
     69    {
     70        if (mach_timebase_info(&s_Info))
     71            s_fNanoseconds = K_TRUE; /* the easy way out */
     72        else if (s_Info.denom == s_Info.numer)
     73            s_fNanoseconds = K_TRUE;
     74        else
     75            s_fNanoseconds = K_FALSE;
     76    }
     77
     78    uPeriod = (KU64)cMillies * 1000 * 1000;
     79    if (!s_fNanoseconds)
     80        uPeriod = (double)uPeriod * s_Info.denom / s_Info.numer; /* Use double to avoid 32-bit trouble. */
     81    uDeadline = uNow + uPeriod;
     82    mach_wait_until(uDeadline);
    6383
    6484#elif K_OS == K_OS_LINUX
  • trunk/kHlp/Makefile.kmk

    r5 r24  
    6565        Generic/kHlpInt2Ascii.c \
    6666        \
    67     Generic/kHlpGetEnvUZ.c \
     67        Generic/kHlpGetEnvUZ.c \
    6868        \
    6969        Generic/kHlpGetExt.c \
     
    7878        Bare/kHlpBareProcess.c \
    7979        Bare/kHlpBareThread.c \
     80
     81kHlpBareStatic_SOURCES.darwin = \
     82        Bare/kHlpSys-darwin.c
    8083
    8184#
     
    99102        Generic/kHlpInt2Ascii.c \
    100103        \
    101     Generic/kHlpGetEnvUZ.c \
     104        Generic/kHlpGetEnvUZ.c \
    102105        \
    103106        Generic/kHlpGetExt.c \
     
    111114        CRT/kHlpCRTString.cpp \
    112115
     116kHlpCRTStatic_SOURCES.darwin = \
     117        Bare/kHlpSys-darwin.c
     118
    113119
    114120# Generate the rules
  • trunk/kLdr/kLdrDyldSem.c

    r2 r24  
    4040#if K_OS == K_OS_DARWIN
    4141# include <mach/mach.h>
     42# undef mach_task_self  /* don't use the macro (if we're using bare helpers ) */
    4243
    4344#elif K_OS == K_OS_OS2
  • trunk/kLdr/kLdrModLX.c

    r2 r24  
    339339
    340340    pModLX->offHdr = offNewHdr >= 0 ? offNewHdr : 0;
    341     pModLX->Hdr = Hdr;
     341    kHlpMemCopy(&pModLX->Hdr, &Hdr, sizeof(Hdr));
    342342
    343343    pModLX->pbLoaderSection = K_ALIGN_P(pMod->pszFilename + pMod->cchFilename + 1, 16);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette