blob: 468fd12d8b834ff9c85558e68e87a9886a95d566 [file] [log] [blame]
Andrew Jeffery4fe996c2018-02-27 12:16:48 +10301/* SPDX-License-Identifier: Apache-2.0 */
2/* Copyright (C) 2018 IBM Corp. */
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +11003
4#ifndef MBOXD_WINDOWS_H
5#define MBOXD_WINDOWS_H
6
7#define NO_FLUSH false
8#define WITH_FLUSH true
9
Andrew Jeffery2f342ef2017-04-11 13:20:43 +093010#include "mbox.h"
11
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110012/* Initialisation Functions */
Suraj Jitindar Singhc29172e2017-04-12 14:26:47 +100013int init_windows(struct mbox_context *context);
14void free_windows(struct mbox_context *context);
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110015/* Write From Window Functions */
16int write_from_window_v1(struct mbox_context *context,
17 uint32_t offset_bytes, uint32_t count_bytes);
18int write_from_window(struct mbox_context *context, uint32_t offset,
19 uint32_t count, uint8_t type);
20/* Window Management Functions */
21void alloc_window_dirty_bytemap(struct mbox_context *context);
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110022int set_window_bytemap(struct mbox_context *context, struct window_context *cur,
23 uint32_t offset, uint32_t size, uint8_t val);
24void close_current_window(struct mbox_context *context, bool set_bmc_event,
25 uint8_t flags);
26void reset_window(struct mbox_context *context, struct window_context *window);
27void reset_all_windows(struct mbox_context *context, bool set_bmc_event);
28struct window_context *find_oldest_window(struct mbox_context *context);
Suraj Jitindar Singh5a3a0662017-04-27 11:55:26 +100029struct window_context *find_largest_window(struct mbox_context *context);
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110030struct window_context *search_windows(struct mbox_context *context,
31 uint32_t offset, bool exact);
32int 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 */