xref: /openbmc/hiomapd/windows.h (revision c1a67fa8)
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 free_windows(struct mbox_context *context);
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);
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);
29 struct window_context *find_largest_window(struct mbox_context *context);
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 /* WINDOWS_H */
37