diff options
Diffstat (limited to 'mdk-stage1/slang/slang.c')
-rw-r--r-- | mdk-stage1/slang/slang.c | 5547 |
1 files changed, 0 insertions, 5547 deletions
diff --git a/mdk-stage1/slang/slang.c b/mdk-stage1/slang/slang.c deleted file mode 100644 index 6edc7df37..000000000 --- a/mdk-stage1/slang/slang.c +++ /dev/null @@ -1,5547 +0,0 @@ -/* -*- mode: C; mode: fold; -*- */ -/* slang.c --- guts of S-Lang interpreter */ -/* Copyright (c) 1992, 1999, 2001 John E. Davis - * This file is part of the S-Lang library. - * - * You may distribute under the terms of either the GNU General Public - * License or the Perl Artistic License. - */ - -#include "slinclud.h" - -#if SLANG_HAS_FLOAT -# include <math.h> -#endif - -#include "slang.h" -#include "_slang.h" - -#define USE_COMBINED_BYTECODES 0 - -struct _SLBlock_Type; - -typedef struct -{ - struct _SLBlock_Type *body; - unsigned int num_refs; -} -_SLBlock_Header_Type; - -typedef struct -{ - char *name; - SLang_Name_Type *next; - char name_type; - - union - { - _SLBlock_Header_Type *header; /* body of function */ - char *autoload_filename; - } - v; -#if _SLANG_HAS_DEBUG_CODE - char *file; -#endif -#define SLANG_MAX_LOCAL_VARIABLES 254 -#define AUTOLOAD_NUM_LOCALS (SLANG_MAX_LOCAL_VARIABLES + 1) - unsigned char nlocals; /* number of local variables */ - unsigned char nargs; /* number of arguments */ -} -_SLang_Function_Type; - -typedef struct -{ - char *name; - SLang_Name_Type *next; - char name_type; - - SLang_Object_Type obj; -} -SLang_Global_Var_Type; - -typedef struct -{ - char *name; - SLang_Name_Type *next; - char name_type; - - int local_var_number; -} -SLang_Local_Var_Type; - -typedef struct _SLBlock_Type -{ - unsigned char bc_main_type; - unsigned char bc_sub_type; - union - { - struct _SLBlock_Type *blk; - int i_blk; - - SLang_Name_Type *nt_blk; - SLang_App_Unary_Type *nt_unary_blk; - SLang_Intrin_Var_Type *nt_ivar_blk; - SLang_Intrin_Fun_Type *nt_ifun_blk; - SLang_Global_Var_Type *nt_gvar_blk; - SLang_IConstant_Type *iconst_blk; - SLang_DConstant_Type *dconst_blk; - _SLang_Function_Type *nt_fun_blk; - - VOID_STAR ptr_blk; - char *s_blk; - SLang_BString_Type *bs_blk; - -#if SLANG_HAS_FLOAT - double *double_blk; /*literal double is a pointer */ -#endif - float float_blk; - long l_blk; - struct _SLang_Struct_Type *struct_blk; - int (*call_function)(void); - } - b; -} -SLBlock_Type; - -/* Debugging and tracing variables */ - -void (*SLang_Enter_Function)(char *) = NULL; -void (*SLang_Exit_Function)(char *) = NULL; -/* If non null, these call C functions before and after a slang function. */ - -int _SLang_Trace = 0; -/* If _SLang_Trace = -1, do not trace intrinsics */ -static int Trace_Mode = 0; - -static char *Trace_Function; /* function to be traced */ -int SLang_Traceback = 0; -/* non zero means do traceback. If less than 0, do not show local variables */ - -/* These variables handle _NARGS processing by the parser */ -int SLang_Num_Function_Args; -static int *Num_Args_Stack; -static unsigned int Recursion_Depth; -static SLang_Object_Type *Frame_Pointer; -static int Next_Function_Num_Args; -static unsigned int Frame_Pointer_Depth; -static unsigned int *Frame_Pointer_Stack; - -static int Lang_Break_Condition = 0; -/* true if any one below is true. This keeps us from testing 3 variables. - * I know this can be perfomed with a bitmapped variable, but... - */ -static int Lang_Break = 0; -static int Lang_Return = 0; -/* static int Lang_Continue = 0; */ - -SLang_Object_Type *_SLRun_Stack; -SLang_Object_Type *_SLStack_Pointer; -static SLang_Object_Type *_SLStack_Pointer_Max; - -/* Might want to increase this. */ -static SLang_Object_Type Local_Variable_Stack[SLANG_MAX_LOCAL_STACK]; -static SLang_Object_Type *Local_Variable_Frame = Local_Variable_Stack; - -static void free_function_header (_SLBlock_Header_Type *); - -void (*SLang_Dump_Routine)(char *); - -static void call_dump_routine (char *fmt, ...) -{ - char buf[1024]; - va_list ap; - - va_start (ap, fmt); - if (SLang_Dump_Routine != NULL) - { - (void) _SLvsnprintf (buf, sizeof (buf), fmt, ap); - (*SLang_Dump_Routine) (buf); - } - else - { - vfprintf (stderr, fmt, ap); - fflush (stderr); - } - va_end (ap); -} - -static void do_traceback (char *, unsigned int, char *); -static int init_interpreter (void); - -/*{{{ push/pop/etc stack manipulation functions */ - -/* This routine is assumed to work even in the presence of a SLang_Error. */ -_INLINE_ -int SLang_pop (SLang_Object_Type *x) -{ - register SLang_Object_Type *y; - - y = _SLStack_Pointer; - if (y == _SLRun_Stack) - { - if (SLang_Error == 0) SLang_Error = SL_STACK_UNDERFLOW; - x->data_type = 0; - return -1; - } - y--; - *x = *y; - - _SLStack_Pointer = y; - return 0; -} - -static int pop_ctrl_integer (int *i) -{ - int type; - SLang_Class_Type *cl; -#if _SLANG_OPTIMIZE_FOR_SPEED - register SLang_Object_Type *y; - - /* Most of the time, either an integer or a char will be on the stack. - * Optimize these cases. - */ - y = _SLStack_Pointer; - if (y == _SLRun_Stack) - { - if (SLang_Error == 0) SLang_Error = SL_STACK_UNDERFLOW; - return -1; - } - y--; - - type = y->data_type; - if (type == SLANG_INT_TYPE) - { - _SLStack_Pointer = y; - *i = y->v.int_val; - return 0; - } - if (type == SLANG_CHAR_TYPE) - { - _SLStack_Pointer = y; - *i = y->v.char_val; - return 0; - } -#else - if (-1 == (type = SLang_peek_at_stack ())) - return -1; -#endif - - cl = _SLclass_get_class ((unsigned char) type); - if (cl->cl_to_bool == NULL) - { - SLang_verror (SL_TYPE_MISMATCH, - "%s cannot be used in a boolean context", - cl->cl_name); - return -1;# dmidecode 2.8 (=> Type: laptop)
SMBIOS 2.3 present.
42 structures occupying 1071 bytes.
Table at 0x000D8010.
Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
Vendor: Phoenix
Version: V1.09
Release Date: 10/26/2004
Address: 0xE43C0
Runtime Size: 113728 bytes
ROM Size: 512 kB
Characteristics:
ISA is supported
PCI is supported
PC Card (PCMCIA) is supported
PNP is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
USB legacy is supported
Smart battery is supported
BIOS boot specification is supported
Handle 0x0001, DMI type 1, 25 bytes
System Information
Manufacturer: Acer
Product Name: Aspire 1520
Version: -1
Serial Number: LXA4105039449C1C47M000
UUID: 106CE0C0-449F-11D9-BF44-EAE28FE25B4B
Wake-up Type: Power Switch
Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
Manufacturer: Acer
Product Name: Aspire 1520
Version: Rev.A
Serial Number: LXA4105039449C1C47M000
Handle 0x0003, DMI type 3, 17 bytes
Chassis Information
Manufacturer: N/A
Type: Other
Lock: Not Present
Version: N/A
Serial Number: None
Asset Tag:
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Safe
Security Status: None
OEM Information: 0x00001234
Handle 0x0004, DMI type 4, 32 bytes
Processor Information
Socket Designation: Socket 754
Type: Central Processor
Family: Athlon 64
Manufacturer: AMD
ID: 4A 0F 00 00 FF FB 8B 07
Signature: Extended Family 0, Model 4, Stepping A
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
Version: C0
Voltage: 3.3 V
External Clock: 800 MHz
Max Speed: 2500 MHz
Current Speed: 2200 MHz
Status: Populated, Enabled
Upgrade: Socket 754
L1 Cache Handle: 0x0008
L2 Cache Handle: 0x0009
L3 Cache Handle: Not Provided
Handle 0x0005, DMI type 5, 20 bytes
Memory Controller Information
Error Detecting Method: 64-bit ECC
Error Correcting Capabilities:
Other
Supported Interleave: Two-way Interleave
Current Interleave: Two-way Interleave
Maximum Memory Module Size: 2048 MB
Maximum Total Memory Size: 4096 MB
Supported Speeds:
70 ns
60 ns
Supported Memory Types:
Standard
DIMM
SDRAM
Memory Module Voltage: 3.3 V
Associated Memory Slots: 2
0x0001
0x0002
Enabled Error Correcting Capabilities:
None
Handle 0x0006, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM 1
Bank Connections: 0 1
Current Speed: 60 ns
Type: DIMM SDRAM
Installed Size: 1024 MB (Double-bank Connection)
Enabled Size: 1024 MB (Double-bank Connection)
Error Status: OK
Handle 0x0007, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: DIMM 2
Bank Connections: 2 3
Current Speed: 60 ns
Type: DIMM SDRAM
Installed Size: 256 MB (Double-bank Connection)
Enabled Size: 256 MB (Double-bank Connection)
Error Status: OK
Handle 0x0008, DMI type 7, 19 bytes
Cache Information
Socket Designation: L1 Cache
Configuration: Enabled, Socketed, Level 1
Operational Mode: Write Back
Location: Internal
Installed Size: 64 KB
Maximum Size: 64 KB
Supported SRAM Types:
Burst
Pipeline Burst
Asynchronous
Installed SRAM Type: Asynchronous
Speed: Unknown
Error Correction Type: Unknown
System Type: Unknown
Associativity: Unknown
Handle 0x0009, DMI type 7, 19 bytes
Cache Information
Socket Designation: L2 Cache
Configuration: Enabled, Socketed, Level 2
Operational Mode: Write Through
Location: External
Installed Size: 1024 KB
Maximum Size: 1024 KB
Supported SRAM Types:
Burst
Pipeline Burst
Synchronous
Installed SRAM Type: Synchronous
Speed: Unknown
Error Correction Type: Unknown
System Type: Unknown
Associativity: Unknown
Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Primary IDE
Internal Connector Type: On Board IDE
External Reference Designator: Not Specified
External Connector Type: None
Port Type: Other
Handle 0x000B, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Secondary IDE
Internal Connector Type: On Board IDE
External Reference Designator: Not Specified
External Connector Type: None
Port Type: Other
Handle 0x000C, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: FLOPPY
Internal Connector Type: On Board Floppy
External Reference Designator: Not Specified
External Connector Type: None
Port Type: Other
Handle 0x000D, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: COM1
External Connector Type: DB-9 male
Port Type: Serial Port XT/AT Compatible
Handle 0x000E, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: COM2
External Connector Type: DB-9 male
Port Type: Serial Port XT/AT Compatible
Handle 0x000F, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: Printer
External Connector Type: DB-25 female
Port Type: Parallel Port ECP/EPP
Handle 0x0010, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: KBD
External Connector Type: PS/2
Port Type: Keyboard Port
Handle 0x0011, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: Mouse
External Connector Type: PS/2
Port Type: Mouse Port
Handle 0x0012, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: CD_IN
Internal Connector Type: On Board Sound Input From CD-ROM
External Reference Designator: Not Specified
External Connector Type: None
Port Type: Other
Handle 0x0013, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: Game Port
External Connector Type: DB-15 female
Port Type: Joystick Port
Handle 0x0014, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: MIC_IN
External Connector Type: RJ-11
Port Type: MIDI Port
Handle 0x0015, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: LINE_IN
External Connector Type: RJ-11
Port Type: MIDI Port
Handle 0x0016, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: Not Specified
Internal Connector Type: None
External Reference Designator: LINE_OUT
External Connector Type: RJ-11
Port Type: MIDI Port
Handle 0x0017, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: FC
Internal Connector Type: Other
External Reference Designator: Not Specified
External Connector Type: None
Port Type: MIDI Port
Handle 0x0018, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: USB1
Internal Connector Type: Other
External Reference Designator: Not Specified
External Connector Type: None
Port Type: USB
Handle 0x0019, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: USB2
Internal Connector Type: Other
External Reference Designator: Not Specified
External Connector Type: None
Port Type: USB
Handle 0x001A, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: USB3
Internal Connector Type: Other
External Reference Designator: Not Specified
External Connector Type: None
Port Type: USB
Handle 0x001B, DMI type 9, 13 bytes
System Slot Information
Designation: PCI Slot 1
Type: 32-bit PCI
Current Usage: Available
Length: Long
ID: 1
Characteristics:
5.0 V is provided
PME signal is supported
Handle 0x001C, DMI type 9, 13 bytes
System Slot Information
Designation: PCI Slot 2
Type: 32-bit PCI
Current Usage: Available
Length: Long
ID: 2
Characteristics:
5.0 V is provided
PME signal is supported
Handle 0x001D, DMI type 9, 13 bytes
System Slot Information
Designation: PCI Slot 3
Type: 32-bit PCI
Current Usage: In Use
Length: Long
ID: 3
Characteristics:
5.0 V is provided
PME signal is supported
Handle 0x001E, DMI type 9, 13 bytes
System Slot Information
Designation: PCI Slot 4
Type: 32-bit PCI
Current Usage: In Use
Length: Long
ID: 3
Characteristics:
5.0 V is provided
PME signal is supported
Handle 0x001F, DMI type 10, 6 bytes
On Board Device Information
Type: Sound
Status: Disabled
Description: VIA 8235 Sound
Handle 0x0020, DMI type 11, 5 bytes
OEM Strings
String 1: VIA
String 2: www.via.com.tw
String 3: w3.via.com.tw
Handle 0x0021, DMI type 16, 15 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 4 GB
Error Information Handle: Not Provided
Number Of Devices: 2
Handle 0x0022, DMI type 17, 23 bytes
Memory Device
Array Handle: 0x0021
Error Information Handle: No Error
Total Width: 32 bits
Data Width: 32 bits
Size: 1024 MB
Form Factor: DIMM
Set: 1
Locator: S1
Bank Locator: Bank 1
Type: DRAM
Type Detail: Synchronous
Speed: Unknown
Handle 0x0023, DMI type 17, 23 bytes
Memory Device
Array Handle: 0x0021
Error Information Handle: No Error
Total Width: 32 bits
Data Width: 32 bits
Size: 256 MB
Form Factor: DIMM
Set: 2
Locator: S2
Bank Locator: Bank 2
Type: DRAM
Type Detail: Synchronous
Speed: Unknown
Handle 0x0024, DMI type 19, 15 bytes
Memory Array Mapped Address
Starting Address: 0x00000000000
Ending Address: 0x0004FFFFFFF
Range Size: 1280 MB
Physical Array Handle: 0x0021
Partition Width: 0
Handle 0x0025, DMI type 20, 19 bytes
Memory Device Mapped Address
Starting Address: 0x00000000000
Ending Address: 0x0003FFFFFFF
Range Size: 1 GB
Physical Device Handle: 0x0022
Memory Array Mapped Address Handle: 0x0001
Partition Row Position: 1
Handle 0x0026, DMI type 23, 13 bytes
System Reset
Status: Enabled
Watchdog Timer: Present
Boot Option: Do Not Reboot
Boot Option On Limit: Do Not Reboot
Reset Count: Unknown
Reset Limit: Unknown
Timer Interval: Unknown
Timeout: Unknown
Handle 0x0027, DMI type 24, 5 bytes
Hardware Security
Power-On Password Status: Disabled
Keyboard Password Status: Unknown
Administrator Password Status: Enabled
Front Panel Reset Status: Unknown
Handle 0x0028, DMI type 32, 20 bytes
System Boot Information
Status: <OUT OF SPEC>
Handle 0x0029, DMI type 127, 4 bytes
End Of Table
|