Commit Graph

1288 Commits

Author SHA1 Message Date
8a92304b25 better ARRAY_SIZE macro that refuses to compile when passed a pointer.
this prevents bugs along the lines of the recently reported
StringStripper issue.

This was SVN commit r5381.
2007-10-01 19:12:59 +00:00
89bf2e609a Fix crash bug in CPU detection (used sizeof pointer instead of strlen)
This was SVN commit r5380.
2007-09-29 17:09:13 +00:00
ea65a2ad8e Picking up the pieces (part 1)
This was SVN commit r5376.
2007-09-26 05:30:57 +00:00
82ef7fe089 cleanup
- malloc+error checking -> new
- better callback parameter name consistency (ctx -> cbData)

file_io: replace another manual malloc+free with shared_ptr
wclipboard: robustify _get as well

This was SVN commit r5372.
2007-09-25 10:43:11 +00:00
f997c03028 add cppdoc documentation for compression
ucsize -> usize etc.

This was SVN commit r5371.
2007-09-25 10:06:02 +00:00
f4adce44bf cleanup:
- callbacks now have a uintptr_t "cbData" parameter (instead of
haphazard void*/uintptr_t, cb/ctx/data)
- resource loading code now more uniformly deals with u8* pointers
instead of void*

allocators: add support for page_aligned_alloc via boost::shared_ptr.
add evil hack to avoid the need for default ctor and ensure alignment in
SingleAllocator
archive: improve Decompressor
compression:
. near complete rewrite (previous code was a poorly factored mess)
. fix bug related to buffer allocation
. no longer provide get_output API (prone to abuse)
. add call to get max. size of output buffer (for preallocation)

This was SVN commit r5370.
2007-09-25 09:39:20 +00:00
3f9b020169 hopefully bring linux and MacOS X into line with the newly refactored sysdep interface.
This was SVN commit r5367.
2007-09-23 16:15:46 +00:00
7a5655edde # major refactoring of system-dependent code (simplifies build system)
cpu.cpp: avoided the need for wrapper functions by calling the
OS-specific function directly (declared in central header, implemented
in the platform's cpp file)

avoid the need for init in cpu and ia32 via if(!init) Init() pattern.

optimized memcpy now requires SSE support

remove error-prone CAS macro; replace with cpu_CAS
config: no longer require inline asm for float->int conversions
lib_error: remove special-case in CHECK_ERR for windows (no longer
needed)

This was SVN commit r5365.
2007-09-23 15:36:29 +00:00
56bd5b59b4 sysdep cleanup:
- factor cursor and clipboard out of sysdep.h
- remove empty sysdep.cpp
- wcpu: remove profiler code (it's in wprofiler.cpp if we ever need it)
- robustify clipboard code
- wsysdep: move code to determine app window into wutil; it's now used
by the clipboard code

This was SVN commit r5364.
2007-09-23 10:15:28 +00:00
b776e58c67 use (newly added) cpu_PageSize instead of sysconf (avoids a critical order dependency on windows)
refactored sysdep code:
- avoid many #if OS_xxx.
- remove bsd.cpp, merge its contents with osx
- move linux-specific parts of unix/ into linux/

This was SVN commit r5363.
2007-09-23 08:05:38 +00:00
3f58951808 arg parsing code: wasn't properly handling "
This was SVN commit r5337.
2007-09-08 08:37:30 +00:00
5383eff15c implement the previously mentioned cmdline params
qpc: refactor IsSafe

This was SVN commit r5336.
2007-09-08 08:09:32 +00:00
f039e1ce76 fix error path for acpi/mahaf failures (attempt#2)
prevent using mahaf if it's going to fail anyway
module_init: add ModuleIsError (allows acpi and mahaf init routines to
pass failure notification on to their second and later callers)

counter: safer memory management

This was SVN commit r5333.
2007-09-07 20:17:57 +00:00
94456a218a # bugfix for ACPI init on Win2k
mahaf: add API to check whether physical memory mapping ought to work
acpi: no longer consider itself initialized if the above is not true
(fixes undue warning in PMT and possibly HPET about invalid ACPI table
on Win2k)

cpu: remove redundant include

This was SVN commit r5329.
2007-09-05 21:29:33 +00:00
efd08a21f9 Use #if instead of #ifdef to detect HAVE_X.
This was SVN commit r5323.
2007-09-03 23:32:16 +00:00
264f394f17 Moved X11 stuff out of unix/ folder, added osx/ sysdep folder, corresponding premake.lua changes, and a few misc other Mac OS X-related changes
This was SVN commit r5320.
2007-09-03 12:56:45 +00:00
f5a2a141dc Fixed non-PCH compiles.
Removed a few global variables from Atlas.
Added call to srand(time).
Restored NotebookEvent in wxJS.
Fixed CPU-detection in Valgrind.

This was SVN commit r5318.
2007-09-02 23:38:58 +00:00
22e4d2fd98 # win/macosx compat, add hooks to disable OpenGL feature usage
config: add 2 parameters to allow disabling s3tc/auto mipmap gen
wpthread: add support for named semaphores (required for macosx compat)
openal, ogghack: remove direct use of __APPLE__ macro (replace with
OS_MACOSX)
GraphicsSetupHandlers.cpp: fix incorrect usage of OS_ macros (they're
always defined, so the test should be if their value is != 0)

This was SVN commit r5316.
2007-09-02 21:44:56 +00:00
a22e73406a Fixed Linux build
This was SVN commit r5314.
2007-09-02 17:18:45 +00:00
08d3ff2952 Updates for OS X and gcc 4.0 compatibility.
- Fixed some invalid member function references in wxJS code that gcc
4.0 didn't like.
- Some conversion changes.
- Don't try to construct wxSound from memory in OS X (it's not
available).
- Added dependency on zlib in AtlasUI (something there uses _compress).
- Added Mac code for finding current executable's path.
- Added dummy code for getting display size that does not use X.
- Fixed dir_get_changed_file stub to return ERR::AGAIN (end of files)
instead of INFO::OK.

This was SVN commit r5312.
2007-09-02 16:50:20 +00:00
bdd1d93c8f whrt: made asserts a tad bit more numerically robust, for what it's worth.
Erik had reported that the PMT counter indicates a resolution > 2ms; i
cannot see a legitimate reason for this happening :S (compiler bug?
debugger bug? bad memory?)

This was SVN commit r5301.
2007-08-25 16:38:36 +00:00
84e4e5aa12 POSIX doesn't really specify _SC_NPROCESSORS_CONF, so add a sysdep routine for that. ia32 now uses it, which is one more step towards unbreaking macosx. thanks to ali for the report :)
This was SVN commit r5300.
2007-08-25 16:32:00 +00:00
Seth
7da9830ebe Modified line 92 to
if ! OS_UNIX || OS_MACOSX since, the previous OS_UNIX check only did not
work

This was SVN commit r5289.
2007-08-09 16:12:46 +00:00
4ac699d021 # fix: ACPI code now safely handles concurrent memory accesses
This was SVN commit r5273.
2007-07-25 19:16:00 +00:00
805736cb8f # system detect fixes
simplify detect code by adding support for WMI (the "proper" way to do
things)
wutsname: fix incorrect reporting of windows version

ps/Util: add note on exception that is raised on Wow64 (Windows bug)

This was SVN commit r5213.
2007-06-24 13:24:40 +00:00
12ac1deebd wposix: add sysconf support for number of "processors"
ia32: add note on when ia32_ApicId fails; support detecting/guessing
processor topology from number of "processors" (hopefully fixes warning
on Philip's PIII system)

This was SVN commit r5209.
2007-06-23 12:59:21 +00:00
dc40e831d4 profile: bugfix (cpu.h atomic functions require intptr_t)
slight improvements to aken (declare code segment as pageable)

This was SVN commit r5202.
2007-06-17 10:29:28 +00:00
63732eda21 wsdl: redirect stdout to file during early init as requested by philip (now possible, and prevents losing printfs that come before SDL_Init)
This was SVN commit r5182.
2007-06-15 21:58:24 +00:00
529727d02b slight improvement to aken: retry mapping if someone has mapped the same page with unexpected cacheable attributes
This was SVN commit r5181.
2007-06-15 21:36:55 +00:00
016f0fcba4 remove bugchecks (happens during normal operation on win2k)
This was SVN commit r5178.
2007-06-14 21:33:43 +00:00
15dd322107 check for invalid fade values (trying to track down AL_CHECK in vsrc_latch, called from snd_fade, which is most likely due to invalid gain)
This was SVN commit r5171.
2007-06-13 07:04:25 +00:00
f331b7313d fix very very insidious bug with mapping physical memory (TLB corruption). fix weirdness reported by michael (underlying cause: using cpu_ClockFrequency instead of wcpu_*; that made the timer run at freq=0)
mahaf: now disabled on Win2k because we can't prevent the TLB bug there.
removed the CopyPhysical API.
wutil: allow querying windows version via number

View: fix warning

This was SVN commit r5169.
2007-06-12 23:29:27 +00:00
3e874c54cf manual build.
aken: add provision for copying physical memory (safer than mapping)
acpi uses that to avoid problems due to nonaligned ACPI tables (bonus:
wastes less memory)

wdbg: remove unnecessary headers
wseh: add comments
wstartup: fix return type (since we're now called by _initterm_e)

This was SVN commit r5159.
2007-06-10 13:25:09 +00:00
a3c21bdfa4 Implemented ucpu_CallByEachCPU
This was SVN commit r5158.
2007-06-09 22:45:50 +00:00
ec9b5c982e Replaced Windows SpiderMonkey library with a threadsafe build of version 1.6.
Fixed linking with wxWidgets.
Enabled RTTI for non-engine packages.
Fixed wxJS for Windows.
Fixed failure to load on Windows 2000 due to IsWow64Process import.
Fixed trivial warnings.

This was SVN commit r5155.
2007-06-09 02:40:48 +00:00
53bcba3368 Atlas: Updated wxJS to latest SVN version. Made the JS runtime have a greater lifetime than all the wx windows, to avoid garbage collection problems.
IGUIObject: Cache the JSObject*, to prevent some frequent allocation
while running GUI scripts.
JSInterface_IGUIObject: Fixed garbage collection issues.
JSInterface_IGUIObject, ScriptGlue: Changed to the JS_THREADSAFE form of
JS_GetClass.
Util: Avoid startup warnings on Linux caused by using unimplemented
cpu_* functions that aren't needed for anything important yet.
sysdep/unix: Changed to native line endings.

This was SVN commit r5154.
2007-06-08 22:56:01 +00:00
4fbaea3780 # fix for exceptions when not running in debugger
move exception-specific stuff into wseh. it now grabs the entry point
and wraps it in a __try block (but only for the main EXE).
this works around issues with the previous SEH registration code
(exceptions weren't caught in release mode when not running in debugger)

This was SVN commit r5151.
2007-06-08 17:44:24 +00:00
163e294eb7 winit: section names should start with .
wposix: raise exception instead of quietly exiting
wstartup: add note on what needs to be done on vc7

This was SVN commit r5148.
2007-06-07 19:15:45 +00:00
0db787bf58 wsock: fix init problem (if getnameinfo et al were the first function called from winsock - as happens when using quickstart - ws2_32 wasn't loaded first)
This was SVN commit r5142.
2007-06-04 23:55:29 +00:00
d802b73d94 winit: rename register macros for more clarity
wdbg: cleanup, improve exception catcher (previously potentially failed
if __try block came in non-main thread). required since wstartup no
longer commandeers the entry point.
winit, wstartup: update documentation

This was SVN commit r5141.
2007-06-04 22:59:14 +00:00
db189468a9 (update-workspace required)
found another means of doing startup/shutdown that doesn't require
hooking and allows init callbacks to use CRT functions (avoiding
problems similar to the recent rash of pre-libc bugs). also, callback
registration no longer needs ugly #pragma syntax.

remove 'Detours' (evil and no longer needed)

This was SVN commit r5137.
2007-06-04 00:00:57 +00:00
48ae626a31 fix warnings
This was SVN commit r5131.
2007-06-02 21:33:35 +00:00
c1d0a25b55 # Work around FAM problem on Linux
Avoid the hang caused by filling up FAM's event buffer when mounting
lots of directories

This was SVN commit r5130.
2007-06-02 17:04:05 +00:00
33c3a8ed97 Fix unbalanced #endif
This was SVN commit r5128.
2007-06-02 15:45:14 +00:00
cf89464e64 # autobuilder fix
detours is configured as a static lib, which would require using the
same compiler, but we have several in action.
fix: include a stripped down version of its code in the main source tree

This was SVN commit r5126.
2007-06-02 12:43:42 +00:00
6b6b6198f9 # Linux ICC compatibility.
Don't disable PCH in AtlasUI for non-GCC builds.
Prevented some excessive warnings ("implicitly-signed bit field of
length 1").
Removed (wcs|str)nlen functions on OS_UNIX, since they were already
removed from the .h.

This was SVN commit r5125.
2007-06-01 00:34:36 +00:00
bd0d0c0026 # finalize WHRT implementation
cpu: avoid measuring cpu freq if possible
ia32: cleanup, fix #cores detection on AMD (they're incompatible,
*sigh*), add ia32_Generation
wcpu: remove IsThrottling code (clunky and not necessary - we rely on
ia32's feature bit detection instead)
counter: move whrt's counter create code here
qpc: update comment
tsc: finalize IsSafe implementation, remove per-thread stuff (since it
cannot be made to work)
whrt: cleanup, remove calibration code (no longer needed)

This was SVN commit r5121.
2007-05-31 00:11:38 +00:00
cba876b246 bugfixes+cleanup
aken: clean up debug strings
mahaf: use checked/free version of aken depending on config. refactor to
eliminate goto.
hpet: avoid undefined unmap if HPET not found
whrt/*: make sure all counter class data is initialized
whrt: prefer QPC over PMT (it's much faster?!)
winit: add some instrumentation
wutil: win_exe_dir and win_sys_dir shouldn't end in slash. fixed.

This was SVN commit r5116.
2007-05-29 22:39:36 +00:00
fba692c8b5 # Fixed some warnings and potentially misleading code
* Removed ToJSVal<jsval> because it's treated as ToJSVal<long> and
causes minor confusion and/or compiler errors.
   Changed script interface functions to return either C++ types or a
jsval_t wrapper.
 * Replaced some C casts with static_cast to avoid significant confusion
and to cause compiler errors instead.
 * Removed some redundant argument-checking code. Simplified some
string-generating code.
 * Fixed some "dereferencing type-punned pointer will break
strict-aliasing rules" warnings (from `g++ -O3`).

This was SVN commit r5115.
2007-05-29 19:01:21 +00:00
5919fc7877 fixes, documentation and cleanup.
. allocators: add static_calloc. also: documention was duplicated in
header; merge it.
. wdir_watch: fix last remaining static object init issues
. add rationale and explanations to lib_errors, wsdl, qpc, whrt.
. cpu/ia32: remove throttling detection (hacky); will be taken care of
by tsc.
. ia32: expose vendor
. wdbg_sym: add its own critical section (safer, less contention)

This was SVN commit r5114.
2007-05-29 16:28:34 +00:00