/* kern/cmos_datetime.c - CMOS datetime function.
*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/datetime.h>
GRUB_MOD_LICENSE ("GPLv3+");
#if !defined (__powerpc__) && !defined (__sparc__)
#endif
{
if (err)
return err;
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_12hour)
{
value &= 0x7F;
value--;
}
if (is_bcd)
if (is_12hour)
value += 12;
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_bcd)
return 0;
}
{
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_12hour)
{
value++;
if (value > 12)
value -= 12;
else
is_12hour = 0;
}
if (is_bcd)
if (is_12hour)
value |= 0x80;
if (err)
return err;
if (is_bcd)
if (err)
return err;
if (is_bcd)
if (err)
return err;
return 0;
}