Loading...
Searching...
No Matches
mtd_mapper.h
1/*
2 * SPDX-FileCopyrightText: 2020 Koen Zandberg <koen@bergzand.net>
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
60
61#include <stdint.h>
62#include <stdbool.h>
63#include "mtd.h"
64#include "mutex.h"
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
74#define MTD_PARENT_INIT(_parent) \
75{ \
76 .mtd = _parent, \
77 .lock = MUTEX_INIT, \
78 .init = false, \
79}
80
89
98
102extern const mtd_desc_t mtd_mapper_driver;
103
104#ifdef __cplusplus
105}
106#endif
107
const mtd_desc_t mtd_mapper_driver
Mapper MTD device operations table.
struct mtd_desc mtd_desc_t
MTD driver interface.
Definition mtd.h:100
Mutex for thread synchronization.
MTD device descriptor.
Definition mtd.h:108
MTD mapper backing device context.
Definition mtd_mapper.h:84
mutex_t lock
Mutex for guarding the backing device access.
Definition mtd_mapper.h:86
mtd_dev_t * mtd
Parent MTD device.
Definition mtd_mapper.h:85
bool init
Initialization flag.
Definition mtd_mapper.h:87
MTD mapped region.
Definition mtd_mapper.h:93
mtd_mapper_parent_t * parent
MTD mapper parent device.
Definition mtd_mapper.h:95
mtd_dev_t mtd
MTD context.
Definition mtd_mapper.h:94
uint32_t sector
first sector of the region
Definition mtd_mapper.h:96
Mutex structure.
Definition mutex.h:36