Merge branch 'noreclaimers'
commit67f11a04d9b9007cff6be59c182bd35c4f3ee076
authorJakub Jermar <jakub@jermar.eu>
Thu, 15 Mar 2018 17:25:56 +0000 (15 18:25 +0100)
committerJakub Jermar <jakub@jermar.eu>
Thu, 15 Mar 2018 17:40:20 +0000 (15 18:40 +0100)
tree5edcd53ffd00bcf281e9e4d4725247c09e9412a4
parent30f1a25ef3be685966ce1377e11888810d47aab9
parenta36f442f65e73855e5458bee41c9c2f4e8b56e4a
Merge branch 'noreclaimers'

This commit removes the left-over from the original IPC phone life-cycle
management in which phones were freed lazily during an attempt to
allocate a new phone when the allocator found a hung-up phone with zero
active calls. This mechanism is the reason why kernel objects had to
have the reclaim method. This commit changes the behavior in that phones
are deallocated with their last reference. At the same time it makes
sure that each active call has its own reference on the phone.

This change also makes sure that each connected phone has a capability
via which it can be hung up by the user or cleaned up in ipc_cleanup().
A special mode for phone_alloc() was introduced that allows calls such
as IPC_M_CONNECT_ME_TO and IPC_M_CONNECT_TO_ME to allocate an
unpublished capability and publish it only when the phone is
successfully connected. This fixes a nasty race condition when the user
destroys the capability before the phone is connected and then this
phone becomes essentially invisible for ipc_cleanup().

Last but not least, ipc_cleanup() was slightly streamlined in that it
now knows for how many calls it has to wait from the answerbox's active
call count.