Author: bonefish Date: 2010-04-21 13:20:07 +0200 (Wed, 21 Apr 2010) New Revision: 36394 Changeset: http://dev.haiku-os.org/changeset/36394/haiku Added: haiku/trunk/src/system/kernel/device_manager/IOCallback.cpp haiku/trunk/src/system/kernel/device_manager/IOCallback.h Modified: haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp haiku/trunk/src/system/kernel/device_manager/IOScheduler.h haiku/trunk/src/system/kernel/device_manager/Jamfile Log: * Moved IOCallback class into separate source file. * Moved IOScheduler::_IOCallbackWrapper() to IOCallback::WrapperFunction(). Added: haiku/trunk/src/system/kernel/device_manager/IOCallback.cpp =================================================================== --- haiku/trunk/src/system/kernel/device_manager/IOCallback.cpp (rev 0) +++ haiku/trunk/src/system/kernel/device_manager/IOCallback.cpp 2010-04-21 11:20:07 UTC (rev 36394) @@ -0,0 +1,27 @@ +/* + * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx + * Copyright 2004-2009, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx + * 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); +} Added: haiku/trunk/src/system/kernel/device_manager/IOCallback.h =================================================================== --- haiku/trunk/src/system/kernel/device_manager/IOCallback.h (rev 0) +++ haiku/trunk/src/system/kernel/device_manager/IOCallback.h 2010-04-21 11:20:07 UTC (rev 36394) @@ -0,0 +1,27 @@ +/* + * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx + * Copyright 2004-2008, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx + * 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 Modified: haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp =================================================================== --- haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp 2010-04-21 10:03:01 UTC (rev 36393) +++ haiku/trunk/src/system/kernel/device_manager/IOScheduler.cpp 2010-04-21 11:20:07 UTC (rev 36394) @@ -31,21 +31,6 @@ #endif -// #pragma mark - IOCallback - - -IOCallback::~IOCallback() -{ -} - - -status_t -IOCallback::DoIO(IOOperation* operation) -{ - return B_ERROR; -} - - // #pragma mark - @@ -254,7 +239,7 @@ void IOScheduler::SetCallback(IOCallback& callback) { - SetCallback(&_IOCallbackWrapper, &callback); + SetCallback(&IOCallback::WrapperFunction, &callback); } @@ -870,13 +855,6 @@ } -/*static*/ status_t -IOScheduler::_IOCallbackWrapper(void* data, io_operation* operation) -{ - return ((IOCallback*)data)->DoIO(operation); -} - - // #pragma mark - IOSchedulerNotificationService Modified: haiku/trunk/src/system/kernel/device_manager/IOScheduler.h =================================================================== --- haiku/trunk/src/system/kernel/device_manager/IOScheduler.h 2010-04-21 10:03:01 UTC (rev 36393) +++ haiku/trunk/src/system/kernel/device_manager/IOScheduler.h 2010-04-21 11:20:07 UTC (rev 36394) @@ -1,5 +1,5 @@ /* - * Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@xxxxxxx + * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx * Copyright 2004-2008, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx * Distributed under the terms of the MIT License. */ @@ -16,6 +16,7 @@ #include <util/OpenHashTable.h> #include "dma_resources.h" +#include "IOCallback.h" #include "IORequest.h" @@ -29,16 +30,6 @@ #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> { team_id team; thread_id thread; @@ -114,9 +105,6 @@ IORequestOwner* _GetRequestOwner(team_id team, thread_id thread, bool allocate); - static status_t _IOCallbackWrapper(void* data, - io_operation* operation); - private: DMAResource* fDMAResource; char* fName; Modified: haiku/trunk/src/system/kernel/device_manager/Jamfile =================================================================== --- haiku/trunk/src/system/kernel/device_manager/Jamfile 2010-04-21 10:03:01 UTC (rev 36393) +++ haiku/trunk/src/system/kernel/device_manager/Jamfile 2010-04-21 11:20:07 UTC (rev 36394) @@ -11,12 +11,13 @@ FileDevice.cpp id_generator.cpp io_resources.cpp - IOScheduler.cpp legacy_drivers.cpp dma_resources.cpp io_requests.cpp + IOCallback.cpp IORequest.cpp + IOScheduler.cpp : $(TARGET_KERNEL_PIC_CCFLAGS) ;