Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 IBM |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | #ifndef MBOXD_WINDOWS_H |
| 19 | #define MBOXD_WINDOWS_H |
| 20 | |
| 21 | #define NO_FLUSH false |
| 22 | #define WITH_FLUSH true |
| 23 | |
| 24 | /* Initialisation Functions */ |
Suraj Jitindar Singh | c29172e | 2017-04-12 14:26:47 +1000 | [diff] [blame] | 25 | int init_windows(struct mbox_context *context); |
| 26 | void free_windows(struct mbox_context *context); |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 27 | /* Write From Window Functions */ |
| 28 | int write_from_window_v1(struct mbox_context *context, |
| 29 | uint32_t offset_bytes, uint32_t count_bytes); |
| 30 | int write_from_window(struct mbox_context *context, uint32_t offset, |
| 31 | uint32_t count, uint8_t type); |
| 32 | /* Window Management Functions */ |
| 33 | void alloc_window_dirty_bytemap(struct mbox_context *context); |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 34 | int set_window_bytemap(struct mbox_context *context, struct window_context *cur, |
| 35 | uint32_t offset, uint32_t size, uint8_t val); |
| 36 | void close_current_window(struct mbox_context *context, bool set_bmc_event, |
| 37 | uint8_t flags); |
| 38 | void reset_window(struct mbox_context *context, struct window_context *window); |
| 39 | void reset_all_windows(struct mbox_context *context, bool set_bmc_event); |
| 40 | struct window_context *find_oldest_window(struct mbox_context *context); |
| 41 | struct window_context *search_windows(struct mbox_context *context, |
| 42 | uint32_t offset, bool exact); |
| 43 | int create_map_window(struct mbox_context *context, |
| 44 | struct window_context **this_window, |
| 45 | uint32_t offset, bool exact); |
| 46 | |
| 47 | #endif /* MBOXD_WINDOWS_H */ |