summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-03-18 17:50:45 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-03-18 17:50:45 +0400
commitd09dac8205a668cc9778689b89b18514cc76392f (patch)
tree97da23e9f8af476ca8cc46ddbc4a11a7857efe73 /extra
parentea176a3ab6d5af6e14e7e035f9e75f2668b453c9 (diff)
downloadbdwgc-d09dac8205a668cc9778689b89b18514cc76392f.tar.gz
Move Symbian cpp files to 'extra' folder;
add GC prefix to init_global_static_roots Symbian-special API function.
Diffstat (limited to 'extra')
-rw-r--r--extra/global_end.cpp16
-rw-r--r--extra/global_start.cpp16
-rw-r--r--extra/init_global_static_roots.cpp33
-rw-r--r--extra/symbian.cpp55
4 files changed, 120 insertions, 0 deletions
diff --git a/extra/global_end.cpp b/extra/global_end.cpp
new file mode 100644
index 00000000..3e2e6d59
--- /dev/null
+++ b/extra/global_end.cpp
@@ -0,0 +1,16 @@
+// Symbian-specific file.
+
+// INCLUDE FILES
+#include "private/gcconfig.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int winscw_data_end;
+
+#ifdef __cplusplus
+ }
+#endif
+
+// End Of File
diff --git a/extra/global_start.cpp b/extra/global_start.cpp
new file mode 100644
index 00000000..c6d67c3c
--- /dev/null
+++ b/extra/global_start.cpp
@@ -0,0 +1,16 @@
+// Symbian-specific file.
+
+// INCLUDE FILES
+#include "private/gcconfig.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int winscw_data_start;
+
+#ifdef __cplusplus
+ }
+#endif
+
+// End Of File
diff --git a/extra/init_global_static_roots.cpp b/extra/init_global_static_roots.cpp
new file mode 100644
index 00000000..092d3415
--- /dev/null
+++ b/extra/init_global_static_roots.cpp
@@ -0,0 +1,33 @@
+// Symbian-specific file.
+
+// INCLUDE FILES
+#include <e32def.h>
+
+#include "private/gcconfig.h"
+#include "gc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void GC_init_global_static_roots()
+{
+ ptr_t dataStart = NULL;
+ ptr_t dataEnd = NULL;
+# if defined (__WINS__)
+ extern int winscw_data_start, winscw_data_end;
+ dataStart = ((ptr_t)&winscw_data_start);
+ dataEnd = ((ptr_t)&winscw_data_end);
+# else
+ extern int Image$$RW$$Limit[], Image$$RW$$Base[];
+ dataStart = ((ptr_t)Image$$RW$$Base);
+ dataEnd = ((ptr_t)Image$$RW$$Limit);
+# endif
+
+ GC_add_roots(dataStart, dataEnd);
+
+}
+
+#ifdef __cplusplus
+ }
+#endif
diff --git a/extra/symbian.cpp b/extra/symbian.cpp
new file mode 100644
index 00000000..29a960d8
--- /dev/null
+++ b/extra/symbian.cpp
@@ -0,0 +1,55 @@
+
+#include <e32cmn.h>
+#include <e32std.h>
+#include <f32file.h>
+#include <aknutils.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int GC_get_main_symbian_stack_base()
+ {
+ TThreadStackInfo aInfo;
+ TInt err = RThread().StackInfo(aInfo);
+ if ( !err )
+ {
+ return aInfo.iBase;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+char* GC_get_private_path_and_zero_file()
+ {
+ // always on c: drive
+ RFs fs;
+ fs.Connect();
+ fs.CreatePrivatePath( EDriveC );
+ TFileName path;
+ fs.PrivatePath( path );
+ fs.Close();
+ _LIT( KCDrive, "c:" );
+ path.Insert( 0, KCDrive );
+
+
+ //convert to char*, assume ascii
+ TBuf8<KMaxFileName> path8;
+ path8.Copy( path );
+ _LIT8( KZero8, "zero" );
+ path8.Append( KZero8 );
+
+ size_t size = path8.Length() + 1;
+ char* copyChar = (char*) malloc( size );
+ memcpy( copyChar, path8.PtrZ(), size );
+
+ return copyChar; // ownership passed
+ }
+
+#ifdef __cplusplus
+ }
+#endif