* Moved IOCallback class into separate source file.
* Moved IOScheduler::_IOCallbackWrapper() to IOCallback::WrapperFunction(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36394 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2008-2010, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2004-2009, Axel Dörfler, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "IOCallback.h"
|
||||||
|
|
||||||
|
|
||||||
|
IOCallback::~IOCallback()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
IOCallback::DoIO(IOOperation* operation)
|
||||||
|
{
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*static*/ status_t
|
||||||
|
IOCallback::WrapperFunction(void* data, io_operation* operation)
|
||||||
|
{
|
||||||
|
return ((IOCallback*)data)->DoIO(operation);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2008-2010, Ingo Weinhold, [email protected].
|
||||||
|
* Copyright 2004-2008, Axel Dörfler, [email protected].
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef IO_CALLBACK_H
|
||||||
|
#define IO_CALLBACK_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "IORequest.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef status_t (*io_callback)(void* data, io_operation* operation);
|
||||||
|
|
||||||
|
|
||||||
|
class IOCallback {
|
||||||
|
public:
|
||||||
|
virtual ~IOCallback();
|
||||||
|
|
||||||
|
virtual status_t DoIO(IOOperation* operation) = 0;
|
||||||
|
|
||||||
|
static status_t WrapperFunction(void* data,
|
||||||
|
io_operation* operation);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // IO_CALLBACK_H
|
||||||
@@ -31,21 +31,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - IOCallback
|
|
||||||
|
|
||||||
|
|
||||||
IOCallback::~IOCallback()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
IOCallback::DoIO(IOOperation* operation)
|
|
||||||
{
|
|
||||||
return B_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
@@ -254,7 +239,7 @@ IOScheduler::InitCheck() const
|
|||||||
void
|
void
|
||||||
IOScheduler::SetCallback(IOCallback& callback)
|
IOScheduler::SetCallback(IOCallback& callback)
|
||||||
{
|
{
|
||||||
SetCallback(&_IOCallbackWrapper, &callback);
|
SetCallback(&IOCallback::WrapperFunction, &callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -870,13 +855,6 @@ IOScheduler::_GetRequestOwner(team_id team, thread_id thread, bool allocate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*static*/ status_t
|
|
||||||
IOScheduler::_IOCallbackWrapper(void* data, io_operation* operation)
|
|
||||||
{
|
|
||||||
return ((IOCallback*)data)->DoIO(operation);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - IOSchedulerNotificationService
|
// #pragma mark - IOSchedulerNotificationService
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008-2009, Ingo Weinhold, [email protected].
|
* Copyright 2008-2010, Ingo Weinhold, [email protected].
|
||||||
* Copyright 2004-2008, Axel Dörfler, [email protected].
|
* Copyright 2004-2008, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <util/OpenHashTable.h>
|
#include <util/OpenHashTable.h>
|
||||||
|
|
||||||
#include "dma_resources.h"
|
#include "dma_resources.h"
|
||||||
|
#include "IOCallback.h"
|
||||||
#include "IORequest.h"
|
#include "IORequest.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -29,16 +30,6 @@
|
|||||||
#define IO_SCHEDULER_OPERATION_FINISHED 0x20
|
#define IO_SCHEDULER_OPERATION_FINISHED 0x20
|
||||||
|
|
||||||
|
|
||||||
class IOCallback {
|
|
||||||
public:
|
|
||||||
virtual ~IOCallback();
|
|
||||||
|
|
||||||
virtual status_t DoIO(IOOperation* operation) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef status_t (*io_callback)(void* data, io_operation* operation);
|
|
||||||
|
|
||||||
|
|
||||||
struct IORequestOwner : DoublyLinkedListLinkImpl<IORequestOwner> {
|
struct IORequestOwner : DoublyLinkedListLinkImpl<IORequestOwner> {
|
||||||
team_id team;
|
team_id team;
|
||||||
thread_id thread;
|
thread_id thread;
|
||||||
@@ -114,9 +105,6 @@ private:
|
|||||||
IORequestOwner* _GetRequestOwner(team_id team, thread_id thread,
|
IORequestOwner* _GetRequestOwner(team_id team, thread_id thread,
|
||||||
bool allocate);
|
bool allocate);
|
||||||
|
|
||||||
static status_t _IOCallbackWrapper(void* data,
|
|
||||||
io_operation* operation);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DMAResource* fDMAResource;
|
DMAResource* fDMAResource;
|
||||||
char* fName;
|
char* fName;
|
||||||
|
|||||||
@@ -11,12 +11,13 @@ KernelMergeObject kernel_device_manager.o :
|
|||||||
FileDevice.cpp
|
FileDevice.cpp
|
||||||
id_generator.cpp
|
id_generator.cpp
|
||||||
io_resources.cpp
|
io_resources.cpp
|
||||||
IOScheduler.cpp
|
|
||||||
legacy_drivers.cpp
|
legacy_drivers.cpp
|
||||||
|
|
||||||
dma_resources.cpp
|
dma_resources.cpp
|
||||||
io_requests.cpp
|
io_requests.cpp
|
||||||
|
IOCallback.cpp
|
||||||
IORequest.cpp
|
IORequest.cpp
|
||||||
|
IOScheduler.cpp
|
||||||
:
|
:
|
||||||
$(TARGET_KERNEL_PIC_CCFLAGS)
|
$(TARGET_KERNEL_PIC_CCFLAGS)
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user