HomeFreeBSD

MFC r361450, r361452, r361550-r361551

Description

MFC r361450, r361452, r361550-r361551

r361450:
linuxkpi: Add refcount.h

Implement some refcount functions needed by drm.
Just use the atomic_t struct and functions from linuxkpi for simplicity.

Sponsored-by: The FreeBSD Foundation

Reviewed by: hselsasky
Differential Revision: https://reviews.freebsd.org/D24985

r361452:
linuxkpi: Fix mod_timer and del_timer_sync

mod_timer is supposed to return 1 if the modified timer was pending, which
is exactly what callout_reset does so return the value after checking
that it's a correct one in case the api change.
del_timer_sync returns int so add a function and handle that.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24983

r361550:
linuxkpi: Add rcu_swap_protected

This macros swap an rcu pointer with a normal pointer.
The condition only seems to be used for debug/warning under linux, ignore
for now.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24954

r361551:
linuxkpi: Add kstrtou16

This function convert a char * to a u16.
Simply use strtoul and cast to compare for ERANGE

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24996

Details

Provenance
manuAuthored on
Reviewer
hselasky
Differential Revision
D24985: linuxkpi: Add refcount.h
Parents
rS364671: MFC r361247, r361343, r361418-r361419, r361422, r361449
Branches
Unknown
Tags
Unknown