2 * Copyright (C) 2011 The Chromium OS Authors
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef _DRIVERS_PLATFORM_CHROMEOS_H
19 #define _DRIVERS_PLATFORM_CHROMEOS_H
21 #define MAX_VBOOT_CONTEXT_BUFFER_SIZE 64 /* Should be enough for anything. */
23 #ifdef CONFIG_ACPI_CHROMEOS
24 extern int chromeos_legacy_set_need_recovery(void);
26 static inline int chromeos_legacy_set_need_recovery(void) { return -ENODEV; }
31 * Read vboot context to buffer
33 * @param buf Pointer to buffer for storing vboot context
34 * @param count Size of buffer
35 * @return on success, the number of bytes read is returned and
36 * on error, -err is returned.
38 ssize_t (*read)(void *buf, size_t count);
41 * Write vboot context from buffer
43 * @param buf Pointer to buffer of new vboot context content
44 * @param count Size of buffer
45 * @return on success, the number of bytes written is returned and
46 * on error, -err is returned.
48 ssize_t (*write)(const void *buf, size_t count);
54 * Register chromeos_vbc callbacks.
56 * @param chromeos_vbc Pointer to struct holding callbacks
57 * @return on success, return 0, on error, -err is returned.
59 int chromeos_vbc_register(struct chromeos_vbc *chromeos_vbc);
61 #endif /* _DRIVERS_PLATFORM_CHROMEOS_H */