Aaron Durbin | 580d11f | 2013-05-24 13:40:51 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the libpayload project. |
| 3 | * |
| 4 | * Copyright (C) 2013 Google, Inc. |
| 5 | * |
| 6 | * This file is dual-licensed. You can choose between: |
| 7 | * - The GNU GPL, version 2, as published by the Free Software Foundation |
| 8 | * - The revised BSD license (without advertising clause) |
| 9 | * |
| 10 | * --------------------------------------------------------------------------- |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; version 2 of the License. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
Aaron Durbin | 580d11f | 2013-05-24 13:40:51 -0500 | [diff] [blame] | 19 | * --------------------------------------------------------------------------- |
| 20 | * Redistribution and use in source and binary forms, with or without |
| 21 | * modification, are permitted provided that the following conditions |
| 22 | * are met: |
| 23 | * 1. Redistributions of source code must retain the above copyright |
| 24 | * notice, this list of conditions and the following disclaimer. |
| 25 | * 2. Redistributions in binary form must reproduce the above copyright |
| 26 | * notice, this list of conditions and the following disclaimer in the |
| 27 | * documentation and/or other materials provided with the distribution. |
| 28 | * 3. The name of the author may not be used to endorse or promote products |
| 29 | * derived from this software without specific prior written permission. |
| 30 | * |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 32 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 33 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 34 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 35 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 39 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 40 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 41 | * SUCH DAMAGE. |
| 42 | * --------------------------------------------------------------------------- |
| 43 | */ |
| 44 | |
| 45 | #ifndef _CBFS_RAM_H_ |
| 46 | #define _CBFS_RAM_H_ |
| 47 | |
| 48 | #include <stdint.h> |
| 49 | |
| 50 | struct cbfs_media; |
| 51 | |
| 52 | /* The following functions return 0 for success. None-zero on error. */ |
| 53 | int init_cbfs_ram_media(struct cbfs_media *media, void *start, size_t size); |
| 54 | int setup_cbfs_from_ram(void *start, uint32_t size); |
| 55 | int setup_cbfs_from_flash(void); |
| 56 | |
| 57 | #endif /* _CBFS_RAM_H_ */ |