Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm Track waiter...
details: https://anonhg.NetBSD.org/src/rev/11746cacf7df
branches: trunk
changeset: 790111:11746cacf7df
user: skrll <skrll%NetBSD.org@localhost>
date: Thu Sep 19 15:13:43 2013 +0000
description:
Track waiters/clients via lwp pointer and not pid.
diffstat:
sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c | 21 ++++-----
sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c | 16 +++---
2 files changed, 18 insertions(+), 19 deletions(-)
diffs (139 lines):
diff -r 9fa9375a242b -r 11746cacf7df sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c Thu Sep 19 14:43:39 2013 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c Thu Sep 19 15:13:43 2013 +0000
@@ -119,7 +119,7 @@
struct bulk_waiter_node {
struct bulk_waiter bulk_waiter;
- int pid;
+ struct lwp *l;
struct list_head list;
};
@@ -134,7 +134,7 @@
int connected;
int closing;
- int pid;
+ struct lwp *l;
int mark;
struct list_head bulk_waiter_list;
@@ -508,7 +508,7 @@
if (pargs->is_open) {
status = vchiq_open_service_internal
- (service, instance->pid);
+ (service, (uintptr_t)instance->l);
if (status != VCHIQ_SUCCESS) {
vchiq_remove_service(service->handle);
service = NULL;
@@ -643,7 +643,7 @@
lmutex_lock(&instance->bulk_waiter_list_mutex);
list_for_each(pos, &instance->bulk_waiter_list) {
if (list_entry(pos, struct bulk_waiter_node,
- list)->pid == current->l_proc->p_pid) {
+ list)->l == current) {
waiter = list_entry(pos,
struct bulk_waiter_node,
list);
@@ -687,7 +687,7 @@
} else {
const VCHIQ_BULK_MODE_T mode_waiting =
VCHIQ_BULK_MODE_WAITING;
- waiter->pid = current->l_proc->p_pid;
+ waiter->l = current;
lmutex_lock(&instance->bulk_waiter_list_mutex);
list_add(&waiter->list, &instance->bulk_waiter_list);
lmutex_unlock(&instance->bulk_waiter_list_mutex);
@@ -1050,8 +1050,7 @@
}
instance->state = state;
- /* XXXBSD: PID or thread ID? */
- instance->pid = l->l_proc->p_pid;
+ instance->l = l;
#ifdef notyet
ret = vchiq_proc_add_instance(instance);
@@ -1195,8 +1194,8 @@
list_del(pos);
vchiq_log_info(vchiq_arm_log_level,
"bulk_waiter - cleaned up %x "
- "for pid %d",
- (unsigned int)waiter, waiter->pid);
+ "for lwp %p",
+ (unsigned int)waiter, waiter->l);
_sema_destroy(&waiter->bulk_waiter.event);
kfree(waiter);
}
@@ -1291,9 +1290,9 @@
instance = service->instance;
if (instance && !instance->mark) {
len = snprintf(buf, sizeof(buf),
- "Instance %x: pid %d,%s completions "
+ "Instance %x: lwp %p,%s completions "
"%d/%d",
- (unsigned int)instance, instance->pid,
+ (unsigned int)instance, instance->l,
instance->connected ? " connected, " :
"",
instance->completion_insert -
diff -r 9fa9375a242b -r 11746cacf7df sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c Thu Sep 19 14:43:39 2013 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c Thu Sep 19 15:13:43 2013 +0000
@@ -42,7 +42,7 @@
struct bulk_waiter_node {
struct bulk_waiter bulk_waiter;
- int pid;
+ struct lwp *l;
struct list_head list;
};
@@ -151,8 +151,8 @@
list_del(pos);
vchiq_log_info(vchiq_arm_log_level,
"bulk_waiter - cleaned up %x "
- "for pid %d",
- (unsigned int)waiter, waiter->pid);
+ "for lwp %p",
+ (unsigned int)waiter, waiter->l);
_sema_destroy(&waiter->bulk_waiter.event);
kfree(waiter);
@@ -287,7 +287,7 @@
if (service) {
status = vchiq_open_service_internal(service,
- current->l_proc->p_pid);
+ (uintptr_t)current);
if (status == VCHIQ_SUCCESS)
*phandle = service->handle;
else
@@ -393,7 +393,7 @@
lmutex_lock(&instance->bulk_waiter_list_mutex);
list_for_each(pos, &instance->bulk_waiter_list) {
if (list_entry(pos, struct bulk_waiter_node,
- list)->pid == current->l_proc->p_pid) {
+ list)->l == current) {
waiter = list_entry(pos,
struct bulk_waiter_node,
list);
@@ -445,13 +445,13 @@
kfree(waiter);
} else {
- waiter->pid = current->l_proc->p_pid;
+ waiter->l = current;
lmutex_lock(&instance->bulk_waiter_list_mutex);
list_add(&waiter->list, &instance->bulk_waiter_list);
lmutex_unlock(&instance->bulk_waiter_list_mutex);
vchiq_log_info(vchiq_arm_log_level,
- "saved bulk_waiter %x for pid %d",
- (unsigned int)waiter, current->l_proc->p_pid);
+ "saved bulk_waiter %x for lwp %p",
+ (unsigned int)waiter, current);
}
return status;
Home |
Main Index |
Thread Index |
Old Index