コード例 #1
0
ファイル: accmisc.c プロジェクト: Ukusbobra/open-watcom-v2
trap_retval ReqGet_sys_config( void )
{
    unsigned_8          fpu;
    get_sys_config_ret  *ret;

    ret = GetOutPtr( 0 );

    ret->sys.os = OS_WINDOWS;
    ret->sys.osmajor = _osmajor;
    ret->sys.osminor = _osminor;

    if( WindowsFlags & WF_CPU086 ) {
        ret->sys.cpu = X86_86;
        fpu = X86_87;
    } else if( WindowsFlags & WF_CPU186 ) {
        ret->sys.cpu = X86_186;
        fpu = X86_87;
    } else if( WindowsFlags & WF_CPU286 ) {
        ret->sys.cpu = X86_286;
        fpu = X86_287;
    } else {
        ret->sys.cpu = X86CPUType();
        fpu = ret->sys.cpu & X86_CPU_MASK;
    }

    if( WindowsFlags & WF_80x87 ) {
        FPUType = fpu;
    } else {
        FPUType = X86_NO;
    }
    ret->sys.fpu = FPUType;
    ret->sys.mad = MAD_X86;
    ret->sys.huge_shift = 3;
    return( sizeof( *ret ) );
}
コード例 #2
0
trap_version TRAPENTRY TrapInit( char *parm, char *err, bool remote )
{
    trap_version ver;

out( "in TrapInit\r\n" );
out( "    checking environment:\r\n" );
    CPUType = X86CPUType();
    Flags.Is386 = ( CPUType >= X86_386 );
    if( parm[0] == 'D' || parm[0] == 'd' ) {
        Flags.DRsOn = FALSE;
        ++parm;
    } else if( out0( "    CPU type\r\n" ) || ( Flags.Is386 == 0 ) ) {
        Flags.DRsOn = FALSE;
    } else if( out0( "    WinEnh\r\n" ) || ( EnhancedWinCheck() & 0x7f ) ) {
        /* Enhanced Windows 3.0 VM kernel messes up handling of debug regs */
        Flags.DRsOn = FALSE;
    } else if( out0( "    DOSEMU\r\n" ) || DOSEMUCheck() ) {
        /* no fiddling with debug regs in Linux DOSEMU either */
        Flags.DRsOn = FALSE;
    } else {
        Flags.DRsOn = TRUE;
    }
    if( parm[0] == 'O' || parm[0] == 'o' ) {
        Flags.NoOvlMgr = TRUE;
    }
out( "    done checking environment\r\n" );
    err[0] = '\0'; /* all ok */

    Flags.IsMMX = ( ( CPUType & X86_MMX ) != 0 );
    Flags.IsXMM = ( ( CPUType & X86_XMM ) != 0 );

    /* NPXType initializes '87, so check for it before a program
       starts using the thing */
    RealNPXType = NPXType();
    InitVectors();
    if( DOS_major >= 20 ) {
        /* In an OS/2 2.0 DOS box. It doesn't let us fiddle the debug
        registers. The check is done here because InitVectors is the
        routine that sets up DOS_major */
        Flags.DRsOn = FALSE;
    }
    Null87Emu();
    NullOvlHdlr();
    TrapTypeInit();
    RedirectInit();
    ExceptNum = -1;
    WatchCount = 0;
    ver.major = TRAP_MAJOR_VERSION;
    ver.minor = TRAP_MINOR_VERSION;
    ver.remote = FALSE;
out( "done TrapInit\r\n" );
    return( ver );
}
コード例 #3
0
trap_retval ReqGet_sys_config( void )
{
    get_sys_config_ret  *ret;

                                                                          _DBG1(( "AccGetConfig" ));
    ret = GetOutPtr(0);
    ret->sys.os = MAD_OS_AUTOCAD;
    ret->sys.osmajor = _osmajor;
    ret->sys.osminor = _osminor;
    ret->sys.cpu = X86CPUType();
    ret->sys.huge_shift = 12;
    ret->sys.fpu = RealNPXType;
    ret->sys.mad = MAD_X86;
    return( sizeof( *ret ) );
}
コード例 #4
0
ファイル: cwacc.c プロジェクト: ABratovic/open-watcom-v2
trap_retval ReqGet_sys_config( void )
/********************************/
{
    get_sys_config_ret  *ret;

    _DBG( "AccGetConfig\r\n" );
    ret = GetOutPtr( 0 );
    ret->sys.os = MAD_OS_RATIONAL;      // Pretend we're DOS/4G
    ret->sys.osmajor = _osmajor;
    ret->sys.osminor = _osminor;
    ret->sys.cpu = X86CPUType();
    ret->sys.huge_shift = 12;
    ret->sys.fpu = NPXType();       //RealNPXType;
    ret->sys.mad = MAD_X86;
    _DBG( "os = %d, cpu=%d, fpu=%d, osmajor=%d, osminor=%d\r\n",
        ret->sys.os, ret->sys.cpu, ret->sys.fpu, ret->sys.osmajor, ret->sys.osminor );
    return( sizeof( *ret ) );
}
コード例 #5
0
unsigned ReqGet_sys_config()
{
    get_sys_config_ret  *ret;

    _DBG1(( "AccGetConfig\n" ));

    ret = GetOutPtr(0);
    ret->sys.os = OS_RATIONAL;
    ret->sys.osmajor = _osmajor;
    ret->sys.osminor = _osminor;
    ret->sys.cpu = X86CPUType();
    ret->sys.huge_shift = 12;
    if( !AtEnd && HAVE_EMU ) {
        ret->sys.fpu = X86_EMU;
    } else {
        ret->sys.fpu = RealNPXType;
    }
    ret->sys.mad = MAD_X86;
    return( sizeof( *ret ) );
}
コード例 #6
0
trap_retval ReqGet_sys_config( void )
{
    get_sys_config_ret  *ret;

    ret = GetOutPtr( 0 );
    ret->sys.os = MAD_OS_LINUX;

    // TODO: Detect OS version (kernel version?)!
    ret->sys.osmajor = 1;
    ret->sys.osminor = 0;

    ret->sys.cpu = X86CPUType();
    if( HAVE_EMU ) {
        ret->sys.fpu = X86_EMU;
    } else {
        ret->sys.fpu = ret->sys.cpu & X86_CPU_MASK;
    }
    ret->sys.huge_shift = 3;
    ret->sys.mad = MAD_X86;
    return( sizeof( *ret ) );
}
コード例 #7
0
unsigned ReqGet_sys_config()
{
    get_sys_config_ret  *ret;

    _DBG(("AccGetConfig\r\n"));
    ret = GetOutPtr(0);
    ret->sys.os = OS_PHARLAP;
    ret->sys.osmajor = _osmajor;
    ret->sys.osminor = _osminor;
    ret->sys.cpu = X86CPUType();
    ret->sys.huge_shift = 12;
    if( HavePSP && !AtEnd ) {
        if( Mach.msb_cr0 & MSW_EM ) {
            ret->sys.fpu = X86_EMU;
        } else {
            ret->sys.fpu = RealNPXType;
        }
    } else {
        ret->sys.fpu = RealNPXType;
    }
    ret->sys.mad = MAD_X86;
    return( sizeof( *ret ) );
}
コード例 #8
0
trap_retval ReqGet_sys_config( void )
{
    get_sys_config_ret  *ret;
    SYSTEM_INFO         info;

    ret = GetOutPtr( 0 );
    ret->sys.os = MAD_OS_NT;
#if defined( __WATCOMC__ )
    ret->sys.osmajor = _osmajor;
    ret->sys.osminor = _osminor;
#else
#endif
    ret->sys.huge_shift = 3;

    GetSystemInfo( &info );
#if defined( MD_x86 )
    ret->sys.cpu = X86CPUType();
    ret->sys.fpu = ret->sys.cpu & X86_CPU_MASK;
    if( IsWOW ) {
        ret->sys.os = MAD_OS_WINDOWS;
    }
    ret->sys.mad = MAD_X86;
#elif defined( MD_x64 )
    ret->sys.cpu = X86_P4 | X86_MMX | X86_XMM;
    ret->sys.fpu = ret->sys.cpu & X86_CPU_MASK;
//    ret->sys.cpu = X64_CPU1;
//    ret->sys.fpu = X64_FPU1;
    if( !IsWOW ) {
//        ret->sys.os = MAD_OS_NT64;
    }
//    ret->sys.mad = MAD_X64;
    ret->sys.mad = MAD_X86;
#elif defined( MD_axp )
    switch( info.dwProcessorType ) {
    case PROCESSOR_ALPHA_21064:
        ret->sys.cpu = AXP_21064;
        break;
    case 21164: /* guessing that this is the constant */
        ret->sys.cpu = AXP_21164;
        break;
    default:
        ret->sys.cpu = AXP_DUNNO;
        break;
    }
    ret->sys.fpu = 0;
    ret->sys.mad = MAD_AXP;
#elif defined( MD_ppc )
    switch( info.dwProcessorType ) {
    case PROCESSOR_PPC_601:
        ret->sys.cpu = PPC_601;
        break;
    case PROCESSOR_PPC_603:
        ret->sys.cpu = PPC_603;
        break;
    case PROCESSOR_PPC_604:
        ret->sys.cpu = PPC_604;
        break;
    case PROCESSOR_PPC_620:
        ret->sys.cpu = PPC_620;
        break;
    default:
        ret->sys.cpu = AXP_DUNNO;
        break;
    }
    ret->sys.fpu = 0;
    ret->sys.mad = MAD_PPC;
#else
    #error ReqGet_sys_config not configured
#endif
    return( sizeof( *ret ) );
}