Module: xenomai-forge Branch: next Commit: 7d088315968067354c840b47067f131555d44544 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=7d088315968067354c840b47067f131555d44544
Author: Philippe Gerum <r...@xenomai.org> Date: Thu Jul 3 15:25:18 2014 +0200 copperplate: drop duplicate service --- lib/copperplate/heapobj-pshared.c | 4 ++-- lib/copperplate/init.c | 4 ++-- lib/copperplate/internal.c | 10 ---------- lib/copperplate/internal.h | 2 -- lib/copperplate/threadobj.c | 4 ++-- lib/copperplate/timerobj.c | 2 +- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/lib/copperplate/heapobj-pshared.c b/lib/copperplate/heapobj-pshared.c index 8272695..c4d4045 100644 --- a/lib/copperplate/heapobj-pshared.c +++ b/lib/copperplate/heapobj-pshared.c @@ -201,7 +201,7 @@ static int init_main_heap(struct session_heap *m_heap, void *mem, size_t size) if (ret) return __bt(ret); - m_heap->cpid = copperplate_get_tid(); + m_heap->cpid = get_thread_pid(); pthread_mutexattr_init(&mattr); pthread_mutexattr_settype(&mattr, mutex_type_attribute); @@ -869,7 +869,7 @@ void heapobj_destroy(struct heapobj *hobj) cpid = main_heap.cpid; munmap(&main_heap, main_heap.maplen); - if (cpid == copperplate_get_tid() || (cpid && kill(cpid, 0))) + if (cpid == get_thread_pid() || (cpid && kill(cpid, 0))) shm_unlink(hobj->fsname); } diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c index 547ba29..6d7e722 100644 --- a/lib/copperplate/init.c +++ b/lib/copperplate/init.c @@ -464,7 +464,7 @@ void copperplate_bootstrap_minimal(const char *arg0, char *mountpt) boilerplate_init(); - __node_id = copperplate_get_tid(); + __node_id = get_thread_pid(); ret = debug_init(); if (ret) { @@ -513,7 +513,7 @@ void copperplate_init(int *argcp, char *const **argvp) threadobj_init_key(); /* Our node id. is the tid of the main thread. */ - __node_id = copperplate_get_tid(); + __node_id = get_thread_pid(); /* No ifs, no buts: we must be called over the main thread. */ assert(getpid() == __node_id); diff --git a/lib/copperplate/internal.c b/lib/copperplate/internal.c index 8a3ef2a..ce1902e 100644 --- a/lib/copperplate/internal.c +++ b/lib/copperplate/internal.c @@ -38,16 +38,6 @@ static int thread_spawn_epilogue(struct corethread_attributes *cta); static void *thread_trampoline(void *arg); -pid_t copperplate_get_tid(void) -{ - /* - * The nucleus maintains a hash table indexed on - * task_pid_vnr() values for mapped shadows. This is what - * __NR_gettid retrieves as well in Cobalt mode. - */ - return syscall(__NR_gettid); -} - #ifdef CONFIG_XENO_COBALT #include "cobalt/internal.h" diff --git a/lib/copperplate/internal.h b/lib/copperplate/internal.h index 48f3fda..b4a49e2 100644 --- a/lib/copperplate/internal.h +++ b/lib/copperplate/internal.h @@ -94,8 +94,6 @@ static inline void copperplate_set_silent(void) extern "C" { #endif -pid_t copperplate_get_tid(void); - int copperplate_kill_tid(pid_t tid, int sig); int copperplate_create_thread(struct corethread_attributes *cta, diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c index 33f2d9f..96bd6ac 100644 --- a/lib/copperplate/threadobj.c +++ b/lib/copperplate/threadobj.c @@ -124,7 +124,7 @@ static inline void agent_init_corespec(const char *name) static int agent_prologue(void *arg) { - agent_pid = copperplate_get_tid(); + agent_pid = get_thread_pid(); agent_init_corespec("remote-agent"); threadobj_set_current(THREADOBJ_IRQCONTEXT); @@ -1169,7 +1169,7 @@ int threadobj_prologue(struct threadobj *thobj, const char *name) *thobj->name = '\0'; thobj->ptid = pthread_self(); - thobj->pid = copperplate_get_tid(); + thobj->pid = get_thread_pid(); thobj->errno_pointer = &errno; threadobj_set_agent(thobj); backtrace_init_context(&thobj->btd, name); diff --git a/lib/copperplate/timerobj.c b/lib/copperplate/timerobj.c index 0d185bc..fffd1cb 100644 --- a/lib/copperplate/timerobj.c +++ b/lib/copperplate/timerobj.c @@ -95,7 +95,7 @@ static void timerobj_enqueue(struct timerobj *tmobj) static int server_prologue(void *arg) { - svpid = copperplate_get_tid(); + svpid = get_thread_pid(); timersv_init_corespec("timer-internal"); threadobj_set_current(THREADOBJ_IRQCONTEXT); _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git