]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Move lock of uart frontend to uart backend
authorSHENG-YI HONG <aokblast@FreeBSD.org>
Wed, 1 May 2024 15:09:31 +0000 (15:09 +0000)
committerMark Johnston <markj@FreeBSD.org>
Wed, 1 May 2024 15:09:31 +0000 (11:09 -0400)
commite10b9d6602dfd876a47f85d8866cabb5a26b8482
tree52c7106a66240c1ef0629dbe247dd20e1734b995
parentaa34b1d20e44141749ffdecf16908fc1e5db4db6
bhyve: Move lock of uart frontend to uart backend

Currently, lock of uart in bhyve is placed in frontend. There are some
problems about it:

1. If every frontend should has a lock, why not move it inside backend
   as they all have same uart_softc.
2. If backend needs to modify the information of uart after initialize,
   it will be impossible as backend cannot use lock. For example, if we
   want implement a telnet support for uart in backend, It should wait
   for connection when initialize. After some remote process connect it,
   it needs to modify rfd and wfd in backend.

So I decide to move it to backend.

Reviewed by: corvink, jhb, markj
Differential Revision: https://reviews.freebsd.org/D44947
usr.sbin/bhyve/uart_backend.c
usr.sbin/bhyve/uart_backend.h
usr.sbin/bhyve/uart_emul.c
usr.sbin/bhyve/uart_pl011.c