From cfb236999fd9316695422e84b1d5e1dcd6cf19e5 Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Fri, 27 Feb 2015 12:36:39 -0500 Subject: Adjustments for type and value changes made at VxWorks 6.9. --- ACE/ace/OS_NS_Thread.cpp | 56 ++++++++++++++++++++++++------------------------ ACE/ace/OS_NS_Thread.h | 4 ++-- ACE/ace/config-vxworks.h | 8 +++++-- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/ACE/ace/OS_NS_Thread.cpp b/ACE/ace/OS_NS_Thread.cpp index a8efe375527..b760a9a07a4 100644 --- a/ACE/ace/OS_NS_Thread.cpp +++ b/ACE/ace/OS_NS_Thread.cpp @@ -4472,7 +4472,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func, } # endif /* 0 */ - if (tid == TASK_ID_ERROR) + if (tid == ACE_VX_TASK_ID_ERROR) return -1; else { @@ -5180,14 +5180,14 @@ spa (FUNCPTR entry, ...) // The hard-coded options are what ::sp () uses, except for the // larger stack size (instead of ::sp ()'s 20000). - TASK_ID const ret = ::taskSpawn (argv[0], // task name - 100, // task priority - VX_FP_TASK, // task options - ACE_NEEDS_HUGE_THREAD_STACKSIZE, // stack size - entry, // entry point - argc, // first argument to main () - (ACE_VX_USR_ARG_T) argv, // second argument to main () - 0, 0, 0, 0, 0, 0, 0, 0); + ACE_VX_TASK_ID const ret = ::taskSpawn (argv[0], // task name + 100, // task priority + VX_FP_TASK, // task options + ACE_NEEDS_HUGE_THREAD_STACKSIZE, // stack size + entry, // entry point + argc, // first argument to main () + (ACE_VX_USR_ARG_T) argv, // second argument to main () + 0, 0, 0, 0, 0, 0, 0, 0); va_end (pvar); // ::taskSpawn () returns the taskID on success: return 0 instead if @@ -5298,14 +5298,14 @@ spae (FUNCPTR entry, ...) // The hard-coded options are what ::sp () uses, except for the // larger stack size (instead of ::sp ()'s 20000). - TASK_ID const ret = ::taskSpawn (argv[0], // task name - 100, // task priority - VX_FP_TASK, // task options - ACE_NEEDS_HUGE_THREAD_STACKSIZE, // stack size - entry, // entry point - argc, // first argument to main () - (ACE_VX_USR_ARG_T) argv, // second argument to main () - 0, 0, 0, 0, 0, 0, 0, 0); + ACE_VX_TASK_ID const ret = ::taskSpawn (argv[0], // task name + 100, // task priority + VX_FP_TASK, // task options + ACE_NEEDS_HUGE_THREAD_STACKSIZE, // stack size + entry, // entry point + argc, // first argument to main () + (ACE_VX_USR_ARG_T) argv, // second argument to main () + 0, 0, 0, 0, 0, 0, 0, 0); va_end (pvar); // ::taskSpawn () returns the taskID on success: return 0 instead if @@ -5396,17 +5396,17 @@ vx_execae (FUNCPTR entry, char* arg, int prio, int opt, size_t stacksz, ...) // The hard-coded options are what ::sp () uses, except for the // larger stack size (instead of ::sp ()'s 20000). - TASK_ID const ret = ::taskSpawn (argv[0], // task name - prio==0 ? 100 : prio, // task priority - opt==0 ? VX_FP_TASK : opt, // task options - stacksz==0 ? ACE_NEEDS_HUGE_THREAD_STACKSIZE : stacksz, // stack size - (FUNCPTR)_vx_call_entry, // entrypoint caller - (ACE_VX_USR_ARG_T)entry, // entry point - argc, // first argument to main () - (ACE_VX_USR_ARG_T) argv, // second argument to main () - 0, 0, 0, 0, 0, 0, 0); - - if (ret == TASK_ID_ERROR) + ACE_VX_TASK_ID const ret = ::taskSpawn (argv[0], // task name + prio==0 ? 100 : prio, // task priority + opt==0 ? VX_FP_TASK : opt, // task options + stacksz==0 ? ACE_NEEDS_HUGE_THREAD_STACKSIZE : stacksz, // stack size + (FUNCPTR)_vx_call_entry, // entrypoint caller + (ACE_VX_USR_ARG_T)entry, // entry point + argc, // first argument to main () + (ACE_VX_USR_ARG_T) argv, // second argument to main () + 0, 0, 0, 0, 0, 0, 0); + + if (ret == ACE_VX_TASK_ID_ERROR) return 255; while( ret > 0 && ::taskIdVerify (ret) != ERROR ) diff --git a/ACE/ace/OS_NS_Thread.h b/ACE/ace/OS_NS_Thread.h index f3176c82396..ce79d69198d 100644 --- a/ACE/ace/OS_NS_Thread.h +++ b/ACE/ace/OS_NS_Thread.h @@ -229,8 +229,8 @@ typedef struct char *name_; } ACE_sema_t; # endif /* !ACE_HAS_POSIX_SEM */ -typedef TASK_ID ACE_thread_t; -typedef TASK_ID ACE_hthread_t; +typedef ACE_VX_TASK_ID ACE_thread_t; +typedef ACE_VX_TASK_ID ACE_hthread_t; // Key type: the ACE TSS emulation requires the key type be unsigned, // for efficiency. (Current POSIX and Solaris TSS implementations also // use u_int, so the ACE TSS emulation is compatible with them.) diff --git a/ACE/ace/config-vxworks.h b/ACE/ace/config-vxworks.h index e45e05ec0f4..4be30a027a8 100644 --- a/ACE/ace/config-vxworks.h +++ b/ACE/ace/config-vxworks.h @@ -56,15 +56,19 @@ // Adapt to system argument changes added at VxWorks 6.9 and 64-bit. #if (ACE_VXWORKS < 0x690) -typedef int ACE_VX_USR_ARG_T; + typedef int ACE_VX_USR_ARG_T; + typedef int ACE_VX_TASK_ID # define ACE_VX_ARG_FORMAT "%x" +# define ACE_VX_TASK_ID_ERROR ERROR #else -typedef _Vx_usr_arg_t ACE_VX_USR_ARG_T; + typedef _Vx_usr_arg_t ACE_VX_USR_ARG_T; + typedef TASK_ID ACE_VX_TASK_ID # ifdef _WRS_CONFIG_LP64 # define ACE_VX_ARG_FORMAT "%lx" # else # define ACE_VX_ARG_FORMAT "%x" # endif +# define ACE_VX_TASK_ID_ERROR TASK_ID_ERROR #endif #include /**/ "ace/post.h" -- cgit v1.2.1