cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

bcd.c (297B)


      1// SPDX-License-Identifier: GPL-2.0
      2#include <linux/bcd.h>
      3#include <linux/export.h>
      4
      5unsigned _bcd2bin(unsigned char val)
      6{
      7	return (val & 0x0f) + (val >> 4) * 10;
      8}
      9EXPORT_SYMBOL(_bcd2bin);
     10
     11unsigned char _bin2bcd(unsigned val)
     12{
     13	return ((val / 10) << 4) + val % 10;
     14}
     15EXPORT_SYMBOL(_bin2bcd);