13#if defined(OS_USE_OS_APP_CONFIG_H)
14#include <cmsis-plus/os-app-config.h>
24#pragma clang diagnostic ignored "-Wc++98-compat"
40#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
41 trace::printf (
"block_device_partition::%s(\"%s\")=@%p\n", __func__,
48#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
49 trace::printf (
"block_device_partition::%s() @%p %s\n", __func__,
this,
59#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
60 trace::printf (
"block_device_partition::%s(%u,%u) @%p\n", __func__,
61 offset, nblocks,
this);
73#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
74 trace::printf (
"block_device_partition_impl::%s()=@%p\n", __func__,
this);
80#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
81 trace::printf (
"block_device_partition_impl::%s() @%p\n", __func__,
this);
87#pragma GCC diagnostic push
89#pragma clang diagnostic ignored "-Wunused-parameter"
90#elif defined(__GNUC__)
91#pragma GCC diagnostic ignored "-Wunused-parameter"
101#pragma GCC diagnostic pop
106#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
107 trace::printf (
"block_device_partition_impl::%s(%u,%u) @%p\n", __func__,
111 partition_offset_blocks_ =
offset;
113 num_blocks_ = nblocks;
116 block_logical_size_bytes_ = parent_.block_logical_size_bytes ();
117 block_physical_size_bytes_ = parent_.block_physical_size_bytes ();
124#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
125 trace::printf (
"block_device_partition_impl::%s(%d) @%p\n", __func__,
129 return parent_.vopen (path, oflag, args);
136#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
137 trace::printf (
"block_device_partition_impl::%s(0x%X, %u, %u) @%p\n",
138 __func__, buf, blknum, nblocks,
this);
141 return parent_.read_block (buf, blknum + partition_offset_blocks_,
150#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
151 trace::printf (
"block_device_partition_impl::%s(0x%X, %u, %u) @%p\n",
152 __func__, buf, blknum, nblocks,
this);
155 return parent_.write_block (buf, blknum + partition_offset_blocks_,
162#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
163 trace::printf (
"block_device_partition_impl::%s() @%p\n", __func__,
this);
166 return parent_.sync ();
172#if defined(OS_TRACE_POSIX_IO_BLOCK_DEVICE_PARTITION)
173 trace::printf (
"block_device_partition_impl::%s() @%p\n", __func__,
this);
176 return parent_.close ();
block_device::blknum_t blknum_t
virtual int do_vopen(const char *path, int oflag, std::va_list args) override
virtual int do_close(void) override
virtual ~block_device_partition_impl() override
virtual void do_sync(void) override
virtual int do_vioctl(int request, std::va_list args) override
block_device_partition_impl(block_device &parent)
virtual ssize_t do_write_block(const void *buf, blknum_t blknum, std::size_t nblocks) override
void configure(blknum_t offset, blknum_t nblocks)
virtual ssize_t do_read_block(void *buf, blknum_t blknum, std::size_t nblocks) override
block_device_partition_impl & impl(void) const
block_device_partition(block_device_impl &impl, const char *name)
virtual ~block_device_partition() override
void configure(blknum_t offset, blknum_t nblocks)
const char * name(void) const
int printf(const char *format,...)
Write a formatted string to the trace device.