Andrew Jeffery | 4fe996c | 2018-02-27 12:16:48 +1030 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 */ |
| 2 | /* Copyright (C) 2018 IBM Corp. */ |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 3 | |
| 4 | #ifndef MBOXD_WINDOWS_H |
| 5 | #define MBOXD_WINDOWS_H |
| 6 | |
| 7 | #define NO_FLUSH false |
| 8 | #define WITH_FLUSH true |
| 9 | |
Andrew Jeffery | 2f342ef | 2017-04-11 13:20:43 +0930 | [diff] [blame] | 10 | #include "mbox.h" |
| 11 | |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 12 | /* Initialisation Functions */ |
Suraj Jitindar Singh | c29172e | 2017-04-12 14:26:47 +1000 | [diff] [blame] | 13 | int init_windows(struct mbox_context *context); |
| 14 | void free_windows(struct mbox_context *context); |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 15 | /* Write From Window Functions */ |
| 16 | int write_from_window_v1(struct mbox_context *context, |
| 17 | uint32_t offset_bytes, uint32_t count_bytes); |
| 18 | int write_from_window(struct mbox_context *context, uint32_t offset, |
| 19 | uint32_t count, uint8_t type); |
| 20 | /* Window Management Functions */ |
| 21 | void alloc_window_dirty_bytemap(struct mbox_context *context); |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 22 | int set_window_bytemap(struct mbox_context *context, struct window_context *cur, |
| 23 | uint32_t offset, uint32_t size, uint8_t val); |
| 24 | void close_current_window(struct mbox_context *context, bool set_bmc_event, |
| 25 | uint8_t flags); |
| 26 | void reset_window(struct mbox_context *context, struct window_context *window); |
| 27 | void reset_all_windows(struct mbox_context *context, bool set_bmc_event); |
| 28 | struct window_context *find_oldest_window(struct mbox_context *context); |
Suraj Jitindar Singh | 5a3a066 | 2017-04-27 11:55:26 +1000 | [diff] [blame] | 29 | struct window_context *find_largest_window(struct mbox_context *context); |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 30 | struct window_context *search_windows(struct mbox_context *context, |
| 31 | uint32_t offset, bool exact); |
| 32 | int create_map_window(struct mbox_context *context, |
| 33 | struct window_context **this_window, |
| 34 | uint32_t offset, bool exact); |
| 35 | |
| 36 | #endif /* MBOXD_WINDOWS_H */ |