1548ada00SBjoern A. Zeeb /*-
2548ada00SBjoern A. Zeeb * SPDX-License-Identifier: BSD-2-Clause
3548ada00SBjoern A. Zeeb *
4548ada00SBjoern A. Zeeb * Copyright (c) 2021 Bjoern A. Zeeb
5548ada00SBjoern A. Zeeb *
6548ada00SBjoern A. Zeeb * Redistribution and use in source and binary forms, with or without
7548ada00SBjoern A. Zeeb * modification, are permitted provided that the following conditions
8548ada00SBjoern A. Zeeb * are met:
9548ada00SBjoern A. Zeeb * 1. Redistributions of source code must retain the above copyright
10548ada00SBjoern A. Zeeb * notice, this list of conditions and the following disclaimer.
11548ada00SBjoern A. Zeeb * 2. Redistributions in binary form must reproduce the above copyright
12548ada00SBjoern A. Zeeb * notice, this list of conditions and the following disclaimer in the
13548ada00SBjoern A. Zeeb * documentation and/or other materials provided with the distribution.
14548ada00SBjoern A. Zeeb *
15548ada00SBjoern A. Zeeb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16548ada00SBjoern A. Zeeb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17548ada00SBjoern A. Zeeb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18548ada00SBjoern A. Zeeb * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19548ada00SBjoern A. Zeeb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20548ada00SBjoern A. Zeeb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21548ada00SBjoern A. Zeeb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22548ada00SBjoern A. Zeeb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23548ada00SBjoern A. Zeeb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24548ada00SBjoern A. Zeeb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25548ada00SBjoern A. Zeeb * SUCH DAMAGE.
26548ada00SBjoern A. Zeeb */
27548ada00SBjoern A. Zeeb
28548ada00SBjoern A. Zeeb #ifndef _LINUXKPI_LINUX_BCD_H
29548ada00SBjoern A. Zeeb #define _LINUXKPI_LINUX_BCD_H
30548ada00SBjoern A. Zeeb
31548ada00SBjoern A. Zeeb #include <sys/types.h>
32*ae2268efSBjoern A. Zeeb #include <sys/libkern.h>
33548ada00SBjoern A. Zeeb
34*ae2268efSBjoern A. Zeeb /* Compared to the libkern version this one truncates the argument. */
linuxkpi_bcd2bin(uint8_t x)35548ada00SBjoern A. Zeeb static inline uint8_t linuxkpi_bcd2bin(uint8_t x)
36548ada00SBjoern A. Zeeb {
37548ada00SBjoern A. Zeeb
38*ae2268efSBjoern A. Zeeb return (bcd2bin(x));
39548ada00SBjoern A. Zeeb }
40548ada00SBjoern A. Zeeb
41548ada00SBjoern A. Zeeb #define bcd2bin(_x) linuxkpi_bcd2bin(_x)
42548ada00SBjoern A. Zeeb
43548ada00SBjoern A. Zeeb #endif /* _LINUXKPI_LINUX_BCD_H */
44