Cyril Bur | 314929b | 2016-10-14 15:55:16 +1100 | [diff] [blame] | 1 | /* Copyright 2016 IBM |
| 2 | * |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | * |
| 15 | */ |
| 16 | |
| 17 | #ifndef PREFIX |
| 18 | #define PREFIX "" |
| 19 | #endif |
| 20 | |
| 21 | enum { |
| 22 | MBOX_LOG_NONE = 0, |
| 23 | MBOX_LOG_VERBOSE = 1, |
| 24 | MBOX_LOG_DEBUG = 2 |
| 25 | } verbosity; |
| 26 | |
| 27 | void (*mbox_vlog)(int p, const char *fmt, va_list args); |
| 28 | |
| 29 | void mbox_log_console(int p, const char *fmt, va_list args); |
| 30 | |
| 31 | __attribute__((format(printf, 2, 3))) |
| 32 | void mbox_log(int p, const char *fmt, ...); |
| 33 | |
| 34 | uint16_t get_u16(uint8_t *ptr); |
| 35 | |
| 36 | void put_u16(uint8_t *ptr, uint16_t val); |
| 37 | |
| 38 | uint32_t get_u32(uint8_t *ptr); |
| 39 | |
| 40 | void put_u32(uint8_t *ptr, uint32_t val); |
| 41 | |
| 42 | char *get_dev_mtd(void); |