From 4983b39a0687b00688478e6748b979a02934b234 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 19 Aug 2009 16:14:47 -0700 Subject: Staging: hv: move osd.h This moves osd.h out of the include/ subdirectory. No code changes are made here. Cc: Hank Janssen Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/hv/BlkVsc.c b/drivers/staging/hv/BlkVsc.c index 526a0ab..c2e0367 100644 --- a/drivers/staging/hv/BlkVsc.c +++ b/drivers/staging/hv/BlkVsc.c @@ -22,6 +22,7 @@ #include #include +#include "osd.h" #include "StorVsc.c" static const char* gBlkDriverName="blkvsc"; diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c index 78850f3..5f40161 100644 --- a/drivers/staging/hv/Channel.c +++ b/drivers/staging/hv/Channel.c @@ -23,7 +23,7 @@ #include #include -#include "include/osd.h" +#include "osd.h" #include "include/logging.h" #include "VmbusPrivate.h" diff --git a/drivers/staging/hv/Channel.h b/drivers/staging/hv/Channel.h index c741dc1..d0fd9aa 100644 --- a/drivers/staging/hv/Channel.h +++ b/drivers/staging/hv/Channel.h @@ -25,7 +25,6 @@ #ifndef _CHANNEL_H_ #define _CHANNEL_H_ -#include "include/osd.h" #include "ChannelMgmt.h" /* The format must be the same as VMDATA_GPA_DIRECT */ diff --git a/drivers/staging/hv/ChannelInterface.c b/drivers/staging/hv/ChannelInterface.c index 451a1a5..ffd62bb 100644 --- a/drivers/staging/hv/ChannelInterface.c +++ b/drivers/staging/hv/ChannelInterface.c @@ -23,8 +23,7 @@ #include #include -#include "include/osd.h" - +#include "osd.h" #include "VmbusPrivate.h" static int diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c index ebf4f7e..86ce05b4 100644 --- a/drivers/staging/hv/ChannelMgmt.c +++ b/drivers/staging/hv/ChannelMgmt.c @@ -24,7 +24,7 @@ #include #include -#include "include/osd.h" +#include "osd.h" #include "include/logging.h" #include "VmbusPrivate.h" diff --git a/drivers/staging/hv/ChannelMgmt.h b/drivers/staging/hv/ChannelMgmt.h index 8b81d59..34eddab 100644 --- a/drivers/staging/hv/ChannelMgmt.h +++ b/drivers/staging/hv/ChannelMgmt.h @@ -25,7 +25,6 @@ #ifndef _CHANNEL_MGMT_H_ #define _CHANNEL_MGMT_H_ -#include "include/osd.h" #include "include/List.h" #include "RingBuffer.h" diff --git a/drivers/staging/hv/Connection.c b/drivers/staging/hv/Connection.c index 6b72689..9083f33 100644 --- a/drivers/staging/hv/Connection.c +++ b/drivers/staging/hv/Connection.c @@ -25,6 +25,7 @@ #include #include #include +#include "osd.h" #include "include/logging.h" #include "VmbusPrivate.h" diff --git a/drivers/staging/hv/Hv.c b/drivers/staging/hv/Hv.c index f706ab8..31459f7 100644 --- a/drivers/staging/hv/Hv.c +++ b/drivers/staging/hv/Hv.c @@ -24,6 +24,7 @@ #include #include #include +#include "osd.h" #include "include/logging.h" #include "VmbusPrivate.h" diff --git a/drivers/staging/hv/Hv.h b/drivers/staging/hv/Hv.h index 9262135..6df388d 100644 --- a/drivers/staging/hv/Hv.h +++ b/drivers/staging/hv/Hv.h @@ -25,8 +25,6 @@ #ifndef __HV_H__ #define __HV_H__ -#include "include/osd.h" - #include "include/HvTypes.h" #include "include/HvStatus.h" #include "include/HvHalApi.h" diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c index 349329a..0389ef7 100644 --- a/drivers/staging/hv/NetVsc.c +++ b/drivers/staging/hv/NetVsc.c @@ -24,6 +24,7 @@ #include #include #include +#include "osd.h" #include "include/logging.h" #include "NetVsc.h" #include "RndisFilter.h" diff --git a/drivers/staging/hv/RingBuffer.c b/drivers/staging/hv/RingBuffer.c index f7332f3..7473f91 100644 --- a/drivers/staging/hv/RingBuffer.c +++ b/drivers/staging/hv/RingBuffer.c @@ -23,6 +23,7 @@ #include #include +#include "osd.h" #include "include/logging.h" #include "RingBuffer.h" diff --git a/drivers/staging/hv/RingBuffer.h b/drivers/staging/hv/RingBuffer.h index 17e859f..6202157 100644 --- a/drivers/staging/hv/RingBuffer.h +++ b/drivers/staging/hv/RingBuffer.h @@ -27,8 +27,6 @@ #include -#include "include/osd.h" - typedef struct _RING_BUFFER { /* Offset in bytes from the start of ring data below */ volatile u32 WriteIndex; diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c index 5cd1575..ef490f5 100644 --- a/drivers/staging/hv/RndisFilter.c +++ b/drivers/staging/hv/RndisFilter.c @@ -26,8 +26,8 @@ #include #include +#include "osd.h" #include "include/logging.h" - #include "include/NetVscApi.h" #include "RndisFilter.h" diff --git a/drivers/staging/hv/RndisFilter.h b/drivers/staging/hv/RndisFilter.h index 6725fe5..8e357c8 100644 --- a/drivers/staging/hv/RndisFilter.h +++ b/drivers/staging/hv/RndisFilter.h @@ -27,7 +27,6 @@ #define __struct_bcount(x) -#include "include/osd.h" #include "NetVsc.h" #include "include/rndis.h" diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c index 47de70b..32fa291 100644 --- a/drivers/staging/hv/StorVsc.c +++ b/drivers/staging/hv/StorVsc.c @@ -25,8 +25,8 @@ #include #include #include +#include "osd.h" #include "include/logging.h" - #include "include/StorVscApi.h" #include "include/VmbusPacketFormat.h" #include "include/vstorage.h" diff --git a/drivers/staging/hv/Vmbus.c b/drivers/staging/hv/Vmbus.c index 50d2773..2feb7c3 100644 --- a/drivers/staging/hv/Vmbus.c +++ b/drivers/staging/hv/Vmbus.c @@ -23,6 +23,7 @@ #include #include +#include "osd.h" #include "include/logging.h" #include "VersionInfo.h" #include "VmbusPrivate.h" diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 6888909..3107f46 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c @@ -33,6 +33,7 @@ #include #include +#include "osd.h" #include "include/logging.h" #include "include/vmbus.h" diff --git a/drivers/staging/hv/include/List.h b/drivers/staging/hv/include/List.h index 31c1296..3895c32 100644 --- a/drivers/staging/hv/include/List.h +++ b/drivers/staging/hv/include/List.h @@ -25,7 +25,6 @@ #ifndef _LIST_H_ #define _LIST_H_ -#include "osd.h" /* * * Doubly-linked list manipulation routines. Implemented as macros diff --git a/drivers/staging/hv/include/VmbusApi.h b/drivers/staging/hv/include/VmbusApi.h index 0a87085..442a212 100644 --- a/drivers/staging/hv/include/VmbusApi.h +++ b/drivers/staging/hv/include/VmbusApi.h @@ -25,7 +25,6 @@ #ifndef _VMBUS_API_H_ #define _VMBUS_API_H_ -#include "osd.h" /* Defines */ diff --git a/drivers/staging/hv/include/logging.h b/drivers/staging/hv/include/logging.h index 8609269..74c18f1 100644 --- a/drivers/staging/hv/include/logging.h +++ b/drivers/staging/hv/include/logging.h @@ -28,7 +28,6 @@ /* #include */ /* #include */ -#include "osd.h" #define VMBUS 0x0001 #define STORVSC 0x0002 diff --git a/drivers/staging/hv/include/osd.h b/drivers/staging/hv/include/osd.h deleted file mode 100644 index 949c273..0000000 --- a/drivers/staging/hv/include/osd.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * Copyright (c) 2009, Microsoft Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307 USA. - * - * Authors: - * Haiyang Zhang - * Hank Janssen - * - */ - - -#ifndef _OSD_H_ -#define _OSD_H_ - - -/* Defines */ - - - -#define ALIGN_UP(value, align) ( ((value) & (align-1))? ( ((value) + (align-1)) & ~(align-1) ): (value) ) -#define ALIGN_DOWN(value, align) ( (value) & ~(align-1) ) -#define NUM_PAGES_SPANNED(addr, len) ( (ALIGN_UP(addr+len, PAGE_SIZE) - ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT ) - -#define LOWORD(dw) ((unsigned short) (dw)) -#define HIWORD(dw) ((unsigned short) (((unsigned int) (dw) >> 16) & 0xFFFF)) - -typedef struct _DLIST_ENTRY { - struct _DLIST_ENTRY *Flink; - struct _DLIST_ENTRY *Blink; -} DLIST_ENTRY; - - -/* Other types */ - -/* typedef unsigned char GUID[16]; */ - -typedef struct { - unsigned char Data[16]; -} GUID; - -struct osd_waitevent { - int condition; - wait_queue_head_t event; -}; - -/* Osd routines */ - -extern void *osd_VirtualAllocExec(unsigned int size); - -extern void *osd_PageAlloc(unsigned int count); -extern void osd_PageFree(void* page, unsigned int count); - -extern struct osd_waitevent *osd_WaitEventCreate(void); -extern void osd_WaitEventSet(struct osd_waitevent *waitEvent); -extern int osd_WaitEventWait(struct osd_waitevent *waitEvent); - -/* If >0, waitEvent got signaled. If ==0, timeout. If < 0, error */ -extern int osd_WaitEventWaitEx(struct osd_waitevent *waitEvent, u32 TimeoutInMs); - - -int osd_schedule_callback(struct workqueue_struct *wq, - void (*func)(void *), - void *data); - -#endif /* _OSD_H_ */ diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index 439c357..4348850 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c @@ -36,6 +36,7 @@ #include #include +#include "osd.h" #include "include/logging.h" #include "include/vmbus.h" diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c index f257695..3b142ce 100644 --- a/drivers/staging/hv/osd.c +++ b/drivers/staging/hv/osd.c @@ -43,7 +43,7 @@ #include #include -#include "include/osd.h" +#include "osd.h" /* Data types */ diff --git a/drivers/staging/hv/osd.h b/drivers/staging/hv/osd.h new file mode 100644 index 0000000..949c273 --- /dev/null +++ b/drivers/staging/hv/osd.h @@ -0,0 +1,78 @@ +/* + * + * Copyright (c) 2009, Microsoft Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA 02111-1307 USA. + * + * Authors: + * Haiyang Zhang + * Hank Janssen + * + */ + + +#ifndef _OSD_H_ +#define _OSD_H_ + + +/* Defines */ + + + +#define ALIGN_UP(value, align) ( ((value) & (align-1))? ( ((value) + (align-1)) & ~(align-1) ): (value) ) +#define ALIGN_DOWN(value, align) ( (value) & ~(align-1) ) +#define NUM_PAGES_SPANNED(addr, len) ( (ALIGN_UP(addr+len, PAGE_SIZE) - ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT ) + +#define LOWORD(dw) ((unsigned short) (dw)) +#define HIWORD(dw) ((unsigned short) (((unsigned int) (dw) >> 16) & 0xFFFF)) + +typedef struct _DLIST_ENTRY { + struct _DLIST_ENTRY *Flink; + struct _DLIST_ENTRY *Blink; +} DLIST_ENTRY; + + +/* Other types */ + +/* typedef unsigned char GUID[16]; */ + +typedef struct { + unsigned char Data[16]; +} GUID; + +struct osd_waitevent { + int condition; + wait_queue_head_t event; +}; + +/* Osd routines */ + +extern void *osd_VirtualAllocExec(unsigned int size); + +extern void *osd_PageAlloc(unsigned int count); +extern void osd_PageFree(void* page, unsigned int count); + +extern struct osd_waitevent *osd_WaitEventCreate(void); +extern void osd_WaitEventSet(struct osd_waitevent *waitEvent); +extern int osd_WaitEventWait(struct osd_waitevent *waitEvent); + +/* If >0, waitEvent got signaled. If ==0, timeout. If < 0, error */ +extern int osd_WaitEventWaitEx(struct osd_waitevent *waitEvent, u32 TimeoutInMs); + + +int osd_schedule_callback(struct workqueue_struct *wq, + void (*func)(void *), + void *data); + +#endif /* _OSD_H_ */ diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index a79ea81..fc5b02d 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -36,9 +36,9 @@ #include +#include "osd.h" #include "include/logging.h" #include "include/vmbus.h" - #include "include/StorVscApi.h" diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 0e13d77..bb40c2e 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c @@ -28,7 +28,7 @@ #include #include #include - +#include "osd.h" #include "include/logging.h" #include "include/vmbus.h" -- cgit v0.10.2