Changeset b9a2725 in mainline
- Timestamp:
- 2018-11-09T22:03:24Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c222816
- Parents:
- c0ea739
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-09 20:54:46)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-09 22:03:24)
- Location:
- kernel/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/ipc.h
rc0ea739 rb9a2725 47 47 struct answerbox; 48 48 struct task; 49 struct call; 49 50 50 51 typedef enum { … … 67 68 struct task *caller; 68 69 struct answerbox *callee; 70 /* A call prepared for hangup ahead of time, so that it cannot fail. */ 71 struct call *hangup_call; 69 72 ipc_phone_state_t state; 70 73 atomic_t active_calls; … … 172 175 173 176 extern call_t *ipc_call_alloc(unsigned int); 174 extern void ipc_call_free(call_t *);175 extern void ipc_call_hold(call_t *);176 extern void ipc_call_release(call_t *);177 177 178 178 extern errno_t ipc_call_sync(phone_t *, call_t *); -
kernel/generic/src/ipc/ipc.c
rc0ea739 rb9a2725 116 116 call_t *ipc_call_alloc(unsigned int flags) 117 117 { 118 // TODO: Allocate call and kobject in single allocation 119 118 120 call_t *call = slab_alloc(call_cache, flags); 119 121 if (!call) … … 483 485 kobject_put(phone->kobject); 484 486 485 call_t *call = ipc_call_alloc(0); 487 call_t *call = phone->hangup_call; 488 phone->hangup_call = NULL; 489 assert(call); 490 486 491 IPC_SET_IMETHOD(call->data, IPC_M_PHONE_HUNGUP); 487 492 call->request_method = IPC_M_PHONE_HUNGUP; … … 685 690 * to exist as soon as we release it. 686 691 */ 687 call_t *call = ipc_call_alloc(0); 692 call_t *call = phone->hangup_call; 693 phone->hangup_call = NULL; 694 assert(call); 695 688 696 IPC_SET_IMETHOD(call->data, IPC_M_PHONE_HUNGUP); 689 697 call->request_method = IPC_M_PHONE_HUNGUP; -
kernel/generic/src/ipc/ipcrsc.c
rc0ea739 rb9a2725 46 46 { 47 47 phone_t *phone = (phone_t *) arg; 48 if (phone->hangup_call) 49 kobject_put(phone->hangup_call->kobject); 48 50 slab_free(phone_cache, phone); 49 51 } … … 79 81 return ENOMEM; 80 82 } 83 call_t *hcall = ipc_call_alloc(FRAME_ATOMIC); 84 if (!hcall) { 85 cap_free(TASK, handle); 86 slab_free(phone_cache, phone); 87 free(kobj); 88 return ENOMEM; 89 } 81 90 82 91 ipc_phone_init(phone, task); 83 92 phone->state = IPC_PHONE_CONNECTING; 93 phone->hangup_call = hcall; 84 94 85 95 kobject_initialize(kobj, KOBJECT_TYPE_PHONE, phone,
Note:
See TracChangeset
for help on using the changeset viewer.