git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4555 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
| @@ -36,6 +36,10 @@ John Emmas | |||||
| Jackdmp changes log | Jackdmp changes log | ||||
| --------------------------- | --------------------------- | ||||
| 2011-10-28 Stephane Letz <letz@grame.fr> | |||||
| * John Emmas POST_PACKED_STRUCTURE patch. | |||||
| 2011-10-27 Stephane Letz <letz@grame.fr> | 2011-10-27 Stephane Letz <letz@grame.fr> | ||||
| * Gabriel Beddingfield patch (r4541) reverted. | * Gabriel Beddingfield patch (r4541) reverted. | ||||
| @@ -33,6 +33,7 @@ struct JackClientControl; | |||||
| \brief Client activation counter. | \brief Client activation counter. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| class JackActivationCount | class JackActivationCount | ||||
| { | { | ||||
| @@ -30,7 +30,7 @@ namespace Jack | |||||
| /*! | /*! | ||||
| \brief Counter for CAS | \brief Counter for CAS | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct AtomicArrayCounter | struct AtomicArrayCounter | ||||
| { | { | ||||
| union { | union { | ||||
| @@ -109,6 +109,7 @@ Requirement: | |||||
| // CHECK livelock | // CHECK livelock | ||||
| PRE_PACKED_STRUCTURE | |||||
| template <class T> | template <class T> | ||||
| class JackAtomicArrayState | class JackAtomicArrayState | ||||
| { | { | ||||
| @@ -31,6 +31,7 @@ namespace Jack | |||||
| \brief Counter for CAS | \brief Counter for CAS | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct AtomicCounter | struct AtomicCounter | ||||
| { | { | ||||
| union { | union { | ||||
| @@ -84,6 +85,7 @@ struct AtomicCounter | |||||
| // CHECK livelock | // CHECK livelock | ||||
| PRE_PACKED_STRUCTURE | |||||
| template <class T> | template <class T> | ||||
| class JackAtomicState | class JackAtomicState | ||||
| { | { | ||||
| @@ -34,6 +34,7 @@ namespace Jack | |||||
| \brief Client control possibly in shared memory. | \brief Client control possibly in shared memory. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct JackClientControl : public JackShmMemAble | struct JackClientControl : public JackShmMemAble | ||||
| { | { | ||||
| char fName[JACK_CLIENT_NAME_SIZE + 1]; | char fName[JACK_CLIENT_NAME_SIZE + 1]; | ||||
| @@ -36,6 +36,7 @@ struct JackClientControl; | |||||
| \brief Utility class. | \brief Utility class. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| template <int SIZE> | template <int SIZE> | ||||
| class JackFixedArray | class JackFixedArray | ||||
| { | { | ||||
| @@ -122,6 +123,7 @@ class JackFixedArray | |||||
| \brief Utility class. | \brief Utility class. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| template <int SIZE> | template <int SIZE> | ||||
| class JackFixedArray1 : public JackFixedArray<SIZE> | class JackFixedArray1 : public JackFixedArray<SIZE> | ||||
| { | { | ||||
| @@ -158,6 +160,7 @@ class JackFixedArray1 : public JackFixedArray<SIZE> | |||||
| \brief Utility class. | \brief Utility class. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| template <int SIZE> | template <int SIZE> | ||||
| class JackFixedMatrix | class JackFixedMatrix | ||||
| { | { | ||||
| @@ -253,6 +256,7 @@ class JackFixedMatrix | |||||
| \brief Utility class. | \brief Utility class. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| template <int SIZE> | template <int SIZE> | ||||
| class JackLoopFeedback | class JackLoopFeedback | ||||
| { | { | ||||
| @@ -366,6 +370,7 @@ class JackLoopFeedback | |||||
| \brief For client timing measurements. | \brief For client timing measurements. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct JackClientTiming | struct JackClientTiming | ||||
| { | { | ||||
| jack_time_t fSignaledAt; | jack_time_t fSignaledAt; | ||||
| @@ -402,6 +407,7 @@ struct JackClientTiming | |||||
| </UL> | </UL> | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| class SERVER_EXPORT JackConnectionManager | class SERVER_EXPORT JackConnectionManager | ||||
| { | { | ||||
| @@ -45,6 +45,7 @@ class JackGraphManager; | |||||
| \brief Engine control in shared memory. | \brief Engine control in shared memory. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct SERVER_EXPORT JackEngineControl : public JackShmMem | struct SERVER_EXPORT JackEngineControl : public JackShmMem | ||||
| { | { | ||||
| // Shared state | // Shared state | ||||
| @@ -37,6 +37,7 @@ namespace Jack | |||||
| \brief Timing stucture for a client. | \brief Timing stucture for a client. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct JackTimingMeasureClient | struct JackTimingMeasureClient | ||||
| { | { | ||||
| int fRefNum; | int fRefNum; | ||||
| @@ -59,6 +60,7 @@ struct JackTimingMeasureClient | |||||
| \brief Timing interval in the global table for a given client | \brief Timing interval in the global table for a given client | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct JackTimingClientInterval | struct JackTimingClientInterval | ||||
| { | { | ||||
| int fRefNum; | int fRefNum; | ||||
| @@ -78,6 +80,7 @@ struct JackTimingClientInterval | |||||
| \brief Timing stucture for a table of clients. | \brief Timing stucture for a table of clients. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| struct JackTimingMeasure | struct JackTimingMeasure | ||||
| { | { | ||||
| unsigned int fAudioCycle; | unsigned int fAudioCycle; | ||||
| @@ -102,6 +105,7 @@ struct JackTimingMeasure | |||||
| class JackClientInterface; | class JackClientInterface; | ||||
| class JackGraphManager; | class JackGraphManager; | ||||
| PRE_PACKED_STRUCTURE | |||||
| class SERVER_EXPORT JackEngineProfiling | class SERVER_EXPORT JackEngineProfiling | ||||
| { | { | ||||
| @@ -38,7 +38,8 @@ namespace Jack | |||||
| #define MAX_SIZE 64 | #define MAX_SIZE 64 | ||||
| struct JackFilter | |||||
| PRE_PACKED_STRUCTURE | |||||
| struct JackFilter | |||||
| { | { | ||||
| jack_time_t fTable[MAX_SIZE]; | jack_time_t fTable[MAX_SIZE]; | ||||
| @@ -65,6 +66,7 @@ namespace Jack | |||||
| } POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
| PRE_PACKED_STRUCTURE | |||||
| class JackDelayLockedLoop | class JackDelayLockedLoop | ||||
| { | { | ||||
| @@ -147,6 +149,7 @@ namespace Jack | |||||
| } POST_PACKED_STRUCTURE; | } POST_PACKED_STRUCTURE; | ||||
| PRE_PACKED_STRUCTURE | |||||
| class JackAtomicDelayLockedLoop : public JackAtomicState<JackDelayLockedLoop> | class JackAtomicDelayLockedLoop : public JackAtomicState<JackDelayLockedLoop> | ||||
| { | { | ||||
| public: | public: | ||||
| @@ -32,6 +32,7 @@ namespace Jack | |||||
| \brief A structure used for time management. | \brief A structure used for time management. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| class SERVER_EXPORT JackTimer | class SERVER_EXPORT JackTimer | ||||
| { | { | ||||
| @@ -73,6 +74,7 @@ class SERVER_EXPORT JackTimer | |||||
| \brief A class using the JackAtomicState to manage jack time. | \brief A class using the JackAtomicState to manage jack time. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| class SERVER_EXPORT JackFrameTimer : public JackAtomicState<JackTimer> | class SERVER_EXPORT JackFrameTimer : public JackAtomicState<JackTimer> | ||||
| { | { | ||||
| @@ -36,6 +36,7 @@ namespace Jack | |||||
| \brief Graph manager: contains the connection manager and the port array. | \brief Graph manager: contains the connection manager and the port array. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| class SERVER_EXPORT JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectionManager> | class SERVER_EXPORT JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectionManager> | ||||
| { | { | ||||
| @@ -35,6 +35,7 @@ namespace Jack | |||||
| \brief Base class for port. | \brief Base class for port. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| class SERVER_EXPORT JackPort | class SERVER_EXPORT JackPort | ||||
| { | { | ||||
| @@ -89,6 +89,7 @@ We have: | |||||
| class JackClientInterface; | class JackClientInterface; | ||||
| PRE_PACKED_STRUCTURE | |||||
| class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState<jack_position_t> | class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState<jack_position_t> | ||||
| { | { | ||||
| @@ -116,6 +116,7 @@ extern "C" | |||||
| * attached to the address space. | * attached to the address space. | ||||
| */ | */ | ||||
| PRE_PACKED_STRUCTURE | |||||
| typedef struct _jack_shm_info { | typedef struct _jack_shm_info { | ||||
| jack_shm_registry_index_t index; /* offset into the registry */ | jack_shm_registry_index_t index; /* offset into the registry */ | ||||
| uint32_t size; | uint32_t size; | ||||
| @@ -124,9 +125,13 @@ extern "C" | |||||
| char ptr_size[8]; | char ptr_size[8]; | ||||
| } ptr; /* a "pointer" that has the same 8 bytes size when compling in 32 or 64 bits */ | } ptr; /* a "pointer" that has the same 8 bytes size when compling in 32 or 64 bits */ | ||||
| } | } | ||||
| #ifdef _MSC_VER | |||||
| jack_shm_info_t; POST_PACKED_STRUCTURE | |||||
| #else | |||||
| POST_PACKED_STRUCTURE jack_shm_info_t; | POST_PACKED_STRUCTURE jack_shm_info_t; | ||||
| #endif | |||||
| /* utility functions used only within JACK */ | |||||
| /* utility functions used only within JACK */ | |||||
| void jack_shm_copy_from_registry (jack_shm_info_t*, | void jack_shm_copy_from_registry (jack_shm_info_t*, | ||||
| jack_shm_registry_index_t); | jack_shm_registry_index_t); | ||||
| @@ -23,6 +23,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #include "JackConstants.h" | #include "JackConstants.h" | ||||
| #if __GNUC__ | #if __GNUC__ | ||||
| #define PRE_PACKED_STRUCTURE | |||||
| #ifndef POST_PACKED_STRUCTURE | #ifndef POST_PACKED_STRUCTURE | ||||
| /* POST_PACKED_STRUCTURE needs to be a macro which | /* POST_PACKED_STRUCTURE needs to be a macro which | ||||
| expands into a compiler directive. The directive must | expands into a compiler directive. The directive must | ||||
| @@ -48,7 +50,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #define MEM_ALIGN(x,y) x | #define MEM_ALIGN(x,y) x | ||||
| #define LIB_EXPORT | #define LIB_EXPORT | ||||
| #define SERVER_EXPORT | #define SERVER_EXPORT | ||||
| /* Add other things here for non-gcc platforms for POST_PACKED_STRUCTURE */ | |||||
| /* Add other things here for non-gcc platforms for PRE and POST_PACKED_STRUCTURE */ | |||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| @@ -23,7 +23,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #include "JackConstants.h" | #include "JackConstants.h" | ||||
| #if __GNUC__ | #if __GNUC__ | ||||
| #ifndef POST_PACKED_STRUCTURE | |||||
| #define PRE_PACKED_STRUCTURE | |||||
| #ifndef POST_PACKED_STRUCTURE | |||||
| /* POST_PACKED_STRUCTURE needs to be a macro which | /* POST_PACKED_STRUCTURE needs to be a macro which | ||||
| expands into a compiler directive. The directive must | expands into a compiler directive. The directive must | ||||
| tell the compiler to arrange the preceding structure | tell the compiler to arrange the preceding structure | ||||
| @@ -54,7 +56,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #define MEM_ALIGN(x,y) x | #define MEM_ALIGN(x,y) x | ||||
| #define LIB_EXPORT | #define LIB_EXPORT | ||||
| #define SERVER_EXPORT | #define SERVER_EXPORT | ||||
| /* Add other things here for non-gcc platforms for POST_PACKED_STRUCTURE */ | |||||
| /* Add other things here for non-gcc platforms for PRE and POST_PACKED_STRUCTURE */ | |||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| @@ -22,6 +22,8 @@ | |||||
| #define __JackCompilerDeps_WIN32__ | #define __JackCompilerDeps_WIN32__ | ||||
| #if __GNUC__ | #if __GNUC__ | ||||
| #define PRE_PACKED_STRUCTURE | |||||
| #ifndef POST_PACKED_STRUCTURE | #ifndef POST_PACKED_STRUCTURE | ||||
| /* POST_PACKED_STRUCTURE needs to be a macro which | /* POST_PACKED_STRUCTURE needs to be a macro which | ||||
| expands into a compiler directive. The directive must | expands into a compiler directive. The directive must | ||||
| @@ -46,13 +48,37 @@ | |||||
| #define SERVER_EXPORT | #define SERVER_EXPORT | ||||
| #endif | #endif | ||||
| #else | #else | ||||
| #define MEM_ALIGN(x,y) x | |||||
| #define LIB_EXPORT __declspec(dllexport) | |||||
| #define MEM_ALIGN(x,y) x | |||||
| #define LIB_EXPORT __declspec(dllexport) | |||||
| #ifdef SERVER_SIDE | #ifdef SERVER_SIDE | ||||
| #define SERVER_EXPORT __declspec(dllexport) | #define SERVER_EXPORT __declspec(dllexport) | ||||
| #else | #else | ||||
| #define SERVER_EXPORT | #define SERVER_EXPORT | ||||
| #endif | #endif | ||||
| #ifdef _MSC_VER | |||||
| #if defined(JACK_32_64) | |||||
| #define PRE_PACKED_STRUCTURE1 __pragma(pack(push,1)) | |||||
| #define PRE_PACKED_STRUCTURE PRE_PACKED_STRUCTURE1 | |||||
| /* PRE_PACKED_STRUCTURE needs to be a macro which | |||||
| expands into a compiler directive. The directive must | |||||
| tell the compiler to arrange the following structure | |||||
| declaration so that it is packed on byte-boundaries rather | |||||
| than use the natural alignment of the processor and/or | |||||
| compiler. | |||||
| */ | |||||
| #define POST_PACKED_STRUCTURE ;__pragma(pack(pop)) | |||||
| /* and POST_PACKED_STRUCTURE needs to be a macro which | |||||
| restores the packing to its previous setting */ | |||||
| #else | |||||
| #define PRE_PACKED_STRUCTURE | |||||
| #define POST_PACKED_STRUCTURE | |||||
| #endif | |||||
| #else | |||||
| /* Other Windows compilers to go here */ | |||||
| #define PRE_PACKED_STRUCTURE | |||||
| #define POST_PACKED_STRUCTURE | |||||
| #endif | |||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| @@ -252,7 +252,7 @@ static bool GetEXEName(DWORD dwProcessID, char* name) | |||||
| HMODULE hMod; | HMODULE hMod; | ||||
| DWORD cbNeeded; | DWORD cbNeeded; | ||||
| if(EnumProcessModules(hProcess, &hMod, | |||||
| if (EnumProcessModules(hProcess, &hMod, | |||||
| sizeof(hMod), &cbNeeded)) { | sizeof(hMod), &cbNeeded)) { | ||||
| //Get the name of the exe file | //Get the name of the exe file | ||||
| GetModuleBaseName(hProcess, hMod, szEXEName, | GetModuleBaseName(hProcess, hMod, szEXEName, | ||||