Files
Xenia-Canary/src/xenia/vfs/device.h
Ben Vanik 3c96b6fa0a DANGER DANGER. Switching to global critical region.
This changes almost all locks held by guest threads to use a single global
critical region. This emulates the behavior on the PPC of disabling
interrupts (by calls like KeRaiseIrqlToDpcLevel or masking interrupts),
and prevents deadlocks from occuring when threads are suspended or
otherwise blocked.
This has performance implications and a pass is needed to ensure the
locking is as granular as possible. It could also break everything
because it's fundamentally unsound. We'll see.
2015-09-06 09:30:54 -07:00

52 lines
1.4 KiB
C++

/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_VFS_DEVICE_H_
#define XENIA_VFS_DEVICE_H_
#include <memory>
#include <string>
#include "xenia/base/mutex.h"
#include "xenia/base/string_buffer.h"
#include "xenia/vfs/entry.h"
namespace xe {
namespace vfs {
class Device {
public:
explicit Device(const std::string& path);
virtual ~Device();
virtual bool Initialize() = 0;
void Dump(StringBuffer* string_buffer);
const std::string& mount_path() const { return mount_path_; }
virtual bool is_read_only() const { return true; }
Entry* ResolvePath(std::string path);
virtual uint32_t total_allocation_units() const = 0;
virtual uint32_t available_allocation_units() const = 0;
virtual uint32_t sectors_per_allocation_unit() const = 0;
virtual uint32_t bytes_per_sector() const = 0;
protected:
xe::global_critical_region global_critical_region_;
std::string mount_path_;
std::unique_ptr<Entry> root_entry_;
};
} // namespace vfs
} // namespace xe
#endif // XENIA_VFS_DEVICE_H_