/*
* 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/>.
*/
#ifndef GRUB_CMOS_H
#if !defined (__powerpc__) && !defined (__sparc__)
#endif
#define GRUB_CMOS_INDEX_SECOND 0
static inline grub_uint8_t
{
return ((a >> 4) * 10 + (a & 0xF));
}
static inline grub_uint8_t
{
return (((a / 10) << 4) + (a % 10));
}
#if !defined (__powerpc__) && !defined (__sparc__)
static inline grub_err_t
{
return GRUB_ERR_NONE;
}
static inline grub_err_t
{
return GRUB_ERR_NONE;
}
#else
grub_err_t grub_cmos_find_port (void);
extern volatile grub_uint8_t *grub_cmos_port;
static inline grub_err_t
{
if (!grub_cmos_port)
{
err = grub_cmos_find_port ();
if (err)
return err;
}
grub_cmos_port[0] = index;
return GRUB_ERR_NONE;
}
static inline grub_err_t
{
if (!grub_cmos_port)
{
err = grub_cmos_find_port ();
if (err)
return err;
}
grub_cmos_port[0] = index;
return GRUB_ERR_NONE;
}
#endif
#endif /* GRUB_CMOS_H */