From: Scott Wood Date: Wed, 4 Jul 2007 01:33:58 +0000 (-0500) Subject: Merge branch 'origin' X-Git-Url: http://git.buserror.net/cgi-bin/gitweb.cgi?p=polintos%2Fscott%2Fpriv.git;a=commitdiff_plain;h=15d9baeca05f30f8564785c255fed765ede457ff;hp=162bcbe20500026d447471ea289485cc94fcef05 Merge branch 'origin' Conflicts: lib/c++/orb.cc --- diff --git a/doc/abi/x86 b/doc/abi/x86 index 805eb76..7f3de36 100644 --- a/doc/abi/x86 +++ b/doc/abi/x86 @@ -40,9 +40,9 @@ Object registration: eax: pointer to exception, or NULL if none edx: length of exception segment, if any -GUID hash retrieval: +GUID SHA-1 hash retrieval: eax: object id - edx: 16-byte buffer + edx: 20-byte buffer Call the 32-bit address stored at 0x7fff000c. diff --git a/doc/orb/marshalling b/doc/orb/marshalling index ab429bb..e56e350 100644 --- a/doc/orb/marshalling +++ b/doc/orb/marshalling @@ -37,6 +37,26 @@ for 32-bit architectures and 32 for 64-bit architectures. Object references are encoded as pointer-sized offsets into the objlist array. +Virtual structs are prefaced with a header, which consists of +the following, in order: +1. 128-bit GUID of the most derived vstruct type +2. 160-bit SHA-1 of the vstruct type info +3. 32-bit objlist-offset of an introspection object +4. 32-bit length of vstruct, including header, and all referenced +data chunks, which must be contiguously appended to the vstruct body +5. 32-bit reserved field + +The requirement for all referenced data chunks to be contiguous with +the vstruct means that scatter-gather and zero-copy cannot be done; +however, it prevents the loss of derived-type data when only a base +type is known at unmarshalling time (the derived-type data could +later be accessed through introspection, or be passed to another +process that does know the derived type). For this reason, vstructs +should generally not be used to pass large chunks of data. + +The introspection object reference may be NULL; in this case, the +SHA-1 field is ignored. + Op1: Get Interface List ----------------------- diff --git a/doc/orb/newobject b/doc/orb/newobject index 7b1c4c5..6140c6c 100644 --- a/doc/orb/newobject +++ b/doc/orb/newobject @@ -1,5 +1,5 @@ struct NewObject { - u32 guid_hash[4]; // Interface GUID checksum + u32 guid_hash[5]; // SHA-1 hash of Interface GUIDs u32 id; // Filled in by ORB u32 reserved[3]; // must be zero }; diff --git a/include/c++/util/assert.h b/include/c++/util/assert.h index fdff3b3..43e80b9 100644 --- a/include/c++/util/assert.h +++ b/include/c++/util/assert.h @@ -1,6 +1,10 @@ #ifndef _UTIL_ASSERT_H #define _UTIL_ASSERT_H +#ifndef _UTIL_ASSERT_LEVEL +#define _UTIL_ASSERT_LEVEL 1 +#endif + namespace Assert { enum { Always = 0, diff --git a/include/c++/util/radix.h b/include/c++/util/radix.h index c3ab842..be982a5 100644 --- a/include/c++/util/radix.h +++ b/include/c++/util/radix.h @@ -13,7 +13,6 @@ #include #include - #include namespace Util { diff --git a/lib/c++/orb.cc b/lib/c++/orb.cc index 31f5cf3..a6158bf 100644 --- a/lib/c++/orb.cc +++ b/lib/c++/orb.cc @@ -7,7 +7,6 @@ namespace RunTime { // This function could be made to do a binary search if we can // manage to somehow sort the IFaceTables... - uintptr_t downcast(::System::_i_Object *obj, const unsigned long *new_guid) { @@ -49,7 +48,6 @@ namespace RunTime { return ptr; }; - namespace Priv { typedef void (*MethodEntry)(ParamInfoBlock *pib); @@ -59,7 +57,7 @@ namespace RunTime { void *ptr; // pointer to the class interface }; - typedef Util::RadixTree ObjTable; + typedef ::Util::RadixTree ObjTable; ObjTable objtable; unsigned long get_pc() @@ -69,9 +67,7 @@ namespace RunTime { void exception_to_array(::System::VStruct *ex, Array *ar) { - // FIXME -// ar->ptr = reinterpret_cast(ex); -// ar->count = ex->_infoptr->structlen; + // FIXME: marshall struct } void handle_message(ParamInfoBlock *pib) @@ -84,9 +80,7 @@ namespace RunTime { throw_idl(ShortMessage, 0, pib->segments[0].len, sizeof(InvokeMethod)); - // ID obj = pib->objlist[0]; - - +// ID obj = pib->objlist[0]; break; } @@ -106,8 +100,8 @@ extern "C" void handle_message(::System::RunTime::ParamInfoBlock *pib, ::System::RunTime::Priv::handle_message(pib); } - catch (::System::Exceptions::Exception *ex) { - ::System::RunTime::Priv::exception_to_array(ex, ex_arr); + catch (::System::Exceptions::Exception &ex) { + ::System::RunTime::Priv::exception_to_array(&ex, ex_arr); } catch (...) {