Author: hbelusca
Date: Mon Dec 23 17:40:50 2013
New Revision: 61352
URL: http://svn.reactos.org/svn/reactos?rev=61352&view=rev
Log:
[DDK]
Introduce DDK headers needed for Virtual Device Drivers development. nt_vdd.h and vddsvc.h will get populated with functions as soon as they will be implemented in NTVDM.
isvbop.h/.inc is fully implemented. isvbop.inc defines 3rd-party VDD bops and "function"-calls for 16-bit apps (in assembler), and isvbop.h defines the same in C-language.
They are both MSVC and GCC-compatible.
Added:
branches/ntvdm/include/ddk/isvbop.h (with props)
branches/ntvdm/include/ddk/isvbop.inc (with props)
branches/ntvdm/include/ddk/nt_vdd.h (with props)
branches/ntvdm/include/ddk/vddsvc.h (with props)
Added: branches/ntvdm/include/ddk/isvbop.h
URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/include/ddk/isvbop.h?rev=…
==============================================================================
--- branches/ntvdm/include/ddk/isvbop.h (added)
+++ branches/ntvdm/include/ddk/isvbop.h [iso-8859-1] Mon Dec 23 17:40:50 2013
@@ -0,0 +1,51 @@
+/*
+ * isvbop.h
+ *
+ * Windows NT Device Driver Kit
+ *
+ * This file is part of the ReactOS DDK package.
+ *
+ * Contributors:
+ * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+/*
+ * The corresponding ASM header of this file is isvbop.inc.
+ */
+
+#pragma once
+
+/* BOP Identifiers */
+#define BOP_3RDPARTY 0x58 // 3rd-party VDD BOP
+#define BOP_UNSIMULATE 0xFE // Stop execution
+
+#if defined(__GNUC__)
+
+#define RegisterModule() __asm__(".byte 0xC4, 0xC4, %c0, 0" : : "i"(BOP_3RDPARTY))
+#define UnRegisterModule() __asm__(".byte 0xC4, 0xC4, %c0, 1" : : "i"(BOP_3RDPARTY))
+#define DispatchCall() __asm__(".byte 0xC4, 0xC4, %c0, 2" : : "i"(BOP_3RDPARTY))
+#define VDDUnSimulate16() __asm__(".byte 0xC4, 0xC4, %c0" : : "i"(BOP_UNSIMULATE))
+
+#elif defined(_MSC_VER)
+
+#define RegisterModule() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_3RDPARTY _asm _emit 0
+#define UnRegisterModule() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_3RDPARTY _asm _emit 1
+#define DispatchCall() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_3RDPARTY _asm _emit 2
+#define VDDUnSimulate16() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_UNSIMULATE
+
+#else
+#error Unknown compiler for inline assembler
+#endif
+
+/* EOF */
Propchange: branches/ntvdm/include/ddk/isvbop.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/ntvdm/include/ddk/isvbop.inc
URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/include/ddk/isvbop.inc?re…
==============================================================================
--- branches/ntvdm/include/ddk/isvbop.inc (added)
+++ branches/ntvdm/include/ddk/isvbop.inc [iso-8859-1] Mon Dec 23 17:40:50 2013
@@ -0,0 +1,49 @@
+/*
+ * isvbop.inc
+ *
+ * Windows NT Device Driver Kit
+ *
+ * This file is part of the ReactOS DDK package.
+ *
+ * Contributors:
+ * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+/*
+ * This is the corresponding ASM header for isvbop.h.
+ * Please refer to isvbop.h for information about these interfaces.
+ */
+
+#include <asm.inc>
+
+BOP_3RDPARTY = HEX(58)
+BOP_UNSIMULATE = HEX(FE)
+
+MACRO(RegisterModule)
+ .byte HEX(C4), HEX(C4), BOP_3RDPARTY, 0
+ENDM
+
+MACRO(UnRegisterModule)
+ .byte HEX(C4), HEX(C4), BOP_3RDPARTY, 1
+ENDM
+
+MACRO(DispatchCall)
+ .byte HEX(C4), HEX(C4), BOP_3RDPARTY, 2
+ENDM
+
+MACRO(VDDUnSimulate16)
+ .byte HEX(C4), HEX(C4), BOP_UNSIMULATE
+ENDM
+
+/* EOF */
Propchange: branches/ntvdm/include/ddk/isvbop.inc
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/ntvdm/include/ddk/nt_vdd.h
URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/include/ddk/nt_vdd.h?rev=…
==============================================================================
--- branches/ntvdm/include/ddk/nt_vdd.h (added)
+++ branches/ntvdm/include/ddk/nt_vdd.h [iso-8859-1] Mon Dec 23 17:40:50 2013
@@ -0,0 +1,85 @@
+/*
+ * nt_vdd.h
+ *
+ * Windows NT Device Driver Kit
+ *
+ * This file is part of the ReactOS DDK package.
+ *
+ * Contributors:
+ * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+#pragma once
+
+#define _NT_VDD
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * I/O Port services
+ */
+
+typedef VOID (*PFNVDD_INB) (WORD iport, PBYTE data);
+typedef VOID (*PFNVDD_INW) (WORD iport, PWORD data);
+typedef VOID (*PFNVDD_INSB) (WORD iport, PBYTE data, WORD count);
+typedef VOID (*PFNVDD_INSW) (WORD iport, PWORD data, WORD count);
+typedef VOID (*PFNVDD_OUTB) (WORD iport, BYTE data);
+typedef VOID (*PFNVDD_OUTW) (WORD iport, WORD data);
+typedef VOID (*PFNVDD_OUTSB) (WORD iport, PBYTE data, WORD count);
+typedef VOID (*PFNVDD_OUTSW) (WORD iport, PWORD data, WORD count);
+
+typedef struct _VDD_IO_HANDLERS
+{
+ PFNVDD_INB inb_handler;
+ PFNVDD_INW inw_handler;
+ PFNVDD_INSB insb_handler;
+ PFNVDD_INSW insw_handler;
+ PFNVDD_OUTB outb_handler;
+ PFNVDD_OUTW outw_handler;
+ PFNVDD_OUTSB outsb_handler;
+ PFNVDD_OUTSW outsw_handler;
+} VDD_IO_HANDLERS, *PVDD_IO_HANDLERS;
+
+typedef struct _VDD_IO_PORTRANGE
+{
+ WORD First;
+ WORD Last;
+} VDD_IO_PORTRANGE, *PVDD_IO_PORTRANGE;
+
+BOOL
+WINAPI
+VDDInstallIOHook
+(
+ HANDLE hVdd,
+ WORD cPortRange,
+ PVDD_IO_PORTRANGE pPortRange,
+ PVDD_IO_HANDLERS IOhandler
+);
+
+VOID
+WINAPI
+VDDDeInstallIOHook
+(
+ HANDLE hVdd,
+ WORD cPortRange,
+ PVDD_IO_PORTRANGE pPortRange
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* EOF */
Propchange: branches/ntvdm/include/ddk/nt_vdd.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/ntvdm/include/ddk/vddsvc.h
URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/include/ddk/vddsvc.h?rev=…
==============================================================================
--- branches/ntvdm/include/ddk/vddsvc.h (added)
+++ branches/ntvdm/include/ddk/vddsvc.h [iso-8859-1] Mon Dec 23 17:40:50 2013
@@ -0,0 +1,31 @@
+/*
+ * vddsvc.h
+ *
+ * Windows NT Device Driver Kit
+ *
+ * This file is part of the ReactOS DDK package.
+ *
+ * Contributors:
+ * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr)
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+#pragma once
+
+#ifndef _NT_VDD
+#include <nt_vdd.h>
+#endif
+
+
+
+/* EOF */
Propchange: branches/ntvdm/include/ddk/vddsvc.h
------------------------------------------------------------------------------
svn:eol-style = native