1 /* SPDX-License-Identifier: Apache-2.0 */ 2 /* Copyright (C) 2018 IBM Corp. */ 3 4 #ifndef WINDOWS_H 5 #define WINDOWS_H 6 7 #define WINDOWS_NO_FLUSH false 8 #define WINDOWS_WITH_FLUSH true 9 10 #include "mbox.h" 11 12 /* Initialisation Functions */ 13 int windows_init(struct mbox_context *context); 14 void windows_free(struct mbox_context *context); 15 /* Write From Window Functions */ 16 int window_flush_v1(struct mbox_context *context, 17 uint32_t offset_bytes, uint32_t count_bytes); 18 int window_flush(struct mbox_context *context, uint32_t offset, 19 uint32_t count, uint8_t type); 20 /* Window Management Functions */ 21 void windows_alloc_dirty_bytemap(struct mbox_context *context); 22 int window_set_bytemap(struct mbox_context *context, struct window_context *cur, 23 uint32_t offset, uint32_t size, uint8_t val); 24 void windows_close_current(struct mbox_context *context, bool set_bmc_event, 25 uint8_t flags); 26 void window_reset(struct mbox_context *context, struct window_context *window); 27 void windows_reset_all(struct mbox_context *context, bool set_bmc_event); 28 struct window_context *windows_find_oldest(struct mbox_context *context); 29 struct window_context *windows_find_largest(struct mbox_context *context); 30 struct window_context *windows_search(struct mbox_context *context, 31 uint32_t offset, bool exact); 32 int windows_create_map(struct mbox_context *context, 33 struct window_context **this_window, 34 uint32_t offset, bool exact); 35 36 #endif /* WINDOWS_H */ 37