K 10 svn:author V 3 ian K 8 svn:date V 27 2017-12-31T22:43:24.939934Z K 7 svn:log V 654 Add a validbcd() routine that uses the bcd2bin_data[] array and returns a bool indicating whether the input value represents a valid BCD byte. The existing bcd2bin() routine will KASSERT if asked to convert a bad value, but sometimes the kernel has to handle BCD data from untrusted sources, so this will provide a mechanism to validate data before attempting conversion. This would be have easier/cleaner if the bcd2bin_data[] array contained an out-of-range value (such as 0xff) in the infill locations that aren't valid, but it's a global symbol that might be referenced by out-of-tree code relying on the current scheme, so I'm leaving that alone. END