/* Copyright (C) 2008 The Android Open Source Project
**
** This software is licensed under the terms of the GNU General Public
** License version 2, as published by the Free Software Foundation, and
** may be copied, distributed, and modified under those terms.
**
** This program 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.
*/
#ifndef _ANDROID_VM_HW_CONFIG_H
#define _ANDROID_VM_HW_CONFIG_H

#include <stdint.h>

typedef char      hw_bool_t;
typedef int       hw_int_t;
typedef int64_t   hw_disksize_t;
typedef char*     hw_string_t;
typedef double    hw_double_t;

/* these macros are used to define the fields of AndroidHwConfig
 * declared below
 */
#define   HWCFG_BOOL(n,s,d,a,t)       hw_bool_t      n;
#define   HWCFG_INT(n,s,d,a,t)        hw_int_t       n;
#define   HWCFG_STRING(n,s,d,a,t)     hw_string_t    n;
#define   HWCFG_DOUBLE(n,s,d,a,t)     hw_double_t    n;
#define   HWCFG_DISKSIZE(n,s,d,a,t)   hw_disksize_t  n;

typedef struct {
#include "android/vm/hw-config-defs.h"
} AndroidHwConfig;

/* the global hardware configuration for the device */
extern AndroidHwConfig   androidHwConfig;

/* reads a hardware configuration file from disk.
 * returns -1 if the file could not be read, or 0 in case of success */
int  android_readHwConfig(const char*       deviceConfigFile,
                          AndroidHwConfig*  config);

#endif /* _ANDROID_VM_HW_CONFIG_H */
