From 358b20f1a138285e7e64d845a5bfbe78c9c610d3 Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 4 Apr 2023 22:35:06 +0200 Subject: [PATCH] Reorder routines --- sdk/xtdk/amd64/hlfuncs.h | 18 ++++---- sdk/xtdk/i686/hlfuncs.h | 18 ++++---- xtoskrnl/hl/amd64/ioport.c | 90 +++++++++++++++++++------------------- xtoskrnl/hl/i686/ioport.c | 90 +++++++++++++++++++------------------- 4 files changed, 108 insertions(+), 108 deletions(-) diff --git a/sdk/xtdk/amd64/hlfuncs.h b/sdk/xtdk/amd64/hlfuncs.h index 925cf74..d5d6bff 100644 --- a/sdk/xtdk/amd64/hlfuncs.h +++ b/sdk/xtdk/amd64/hlfuncs.h @@ -20,27 +20,27 @@ XTCDECL UCHAR HlIoPortInByte(IN USHORT Port); -XTCDECL -USHORT -HlIoPortInShort(IN USHORT Port); - XTCDECL ULONG HlIoPortInLong(IN USHORT Port); +XTCDECL +USHORT +HlIoPortInShort(IN USHORT Port); + XTCDECL VOID HlIoPortOutByte(IN USHORT Port, IN UCHAR Data); -XTCDECL -VOID -HlIoPortOutShort(IN USHORT Port, - IN USHORT Value); - XTCDECL VOID HlIoPortOutLong(IN USHORT Port, IN ULONG Value); +XTCDECL +VOID +HlIoPortOutShort(IN USHORT Port, + IN USHORT Value); + #endif /* __XTDK_AMD64_HLFUNCS_H */ diff --git a/sdk/xtdk/i686/hlfuncs.h b/sdk/xtdk/i686/hlfuncs.h index cd55a7b..dfc35ac 100644 --- a/sdk/xtdk/i686/hlfuncs.h +++ b/sdk/xtdk/i686/hlfuncs.h @@ -20,27 +20,27 @@ XTCDECL UCHAR HlIoPortInByte(IN USHORT Port); -XTCDECL -USHORT -HlIoPortInShort(IN USHORT Port); - XTCDECL ULONG HlIoPortInLong(IN USHORT Port); +XTCDECL +USHORT +HlIoPortInShort(IN USHORT Port); + XTCDECL VOID HlIoPortOutByte(IN USHORT Port, IN UCHAR Data); -XTCDECL -VOID -HlIoPortOutShort(IN USHORT Port, - IN USHORT Value); - XTCDECL VOID HlIoPortOutLong(IN USHORT Port, IN ULONG Value); +XTCDECL +VOID +HlIoPortOutShort(IN USHORT Port, + IN USHORT Value); + #endif /* __XTDK_I686_HLFUNCS_H */ diff --git a/xtoskrnl/hl/amd64/ioport.c b/xtoskrnl/hl/amd64/ioport.c index 049bc3c..6ba8609 100644 --- a/xtoskrnl/hl/amd64/ioport.c +++ b/xtoskrnl/hl/amd64/ioport.c @@ -30,27 +30,6 @@ HlIoPortInByte(IN USHORT Port) return Value; } -/** - * Reads the 16-bit data from the specified I/O port. - * - * @param Port - * Specifies the address to read from, in the range of 0-0xFFFF. - * - * @return The value read from the port. - * - * @since XT 1.0 - */ -XTCDECL -USHORT -HlIoPortInShort(IN USHORT Port) -{ - USHORT Value; - asm volatile("inw %1, %0" - : "=a" (Value) - : "Nd" (Port)); - return Value; -} - /** * Reads the 32-bit data from the specified I/O port. * @@ -72,6 +51,27 @@ HlIoPortInLong(IN USHORT Port) return Value; } +/** + * Reads the 16-bit data from the specified I/O port. + * + * @param Port + * Specifies the address to read from, in the range of 0-0xFFFF. + * + * @return The value read from the port. + * + * @since XT 1.0 + */ +XTCDECL +USHORT +HlIoPortInShort(IN USHORT Port) +{ + USHORT Value; + asm volatile("inw %1, %0" + : "=a" (Value) + : "Nd" (Port)); + return Value; +} + /** * Writes the 8-bit data to the specified I/O port. * @@ -96,30 +96,6 @@ HlIoPortOutByte(IN USHORT Port, "Nd" (Port)); } -/** - * Writes the 16-bit data to the specified I/O port. - * - * @param Port - * Specifies the address to write to, in the range of 0-0xFFFF. - * - * @param Value - * Supplies the value to write. - * - * @return This routine does not return any value. - * - * @since XT 1.0 - */ -XTCDECL -VOID -HlIoPortOutShort(IN USHORT Port, - IN USHORT Value) -{ - asm volatile("outw %0, %1" - : - : "a" (Value), - "Nd" (Port)); -} - /** * Writes the 32-bit data to the specified I/O port. * @@ -143,3 +119,27 @@ HlIoPortOutLong(IN USHORT Port, : "a" (Value), "Nd" (Port)); } + +/** + * Writes the 16-bit data to the specified I/O port. + * + * @param Port + * Specifies the address to write to, in the range of 0-0xFFFF. + * + * @param Value + * Supplies the value to write. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTCDECL +VOID +HlIoPortOutShort(IN USHORT Port, + IN USHORT Value) +{ + asm volatile("outw %0, %1" + : + : "a" (Value), + "Nd" (Port)); +} diff --git a/xtoskrnl/hl/i686/ioport.c b/xtoskrnl/hl/i686/ioport.c index 54121b8..7f6b5d7 100644 --- a/xtoskrnl/hl/i686/ioport.c +++ b/xtoskrnl/hl/i686/ioport.c @@ -30,27 +30,6 @@ HlIoPortInByte(IN USHORT Port) return Value; } -/** - * Reads the 16-bit data from the specified I/O port. - * - * @param Port - * Specifies the address to read from, in the range of 0-0xFFFF. - * - * @return The value read from the port. - * - * @since XT 1.0 - */ -XTCDECL -USHORT -HlIoPortInShort(IN USHORT Port) -{ - USHORT Value; - asm volatile("inw %1, %0" - : "=a" (Value) - : "Nd" (Port)); - return Value; -} - /** * Reads the 32-bit data from the specified I/O port. * @@ -72,6 +51,27 @@ HlIoPortInLong(IN USHORT Port) return Value; } +/** + * Reads the 16-bit data from the specified I/O port. + * + * @param Port + * Specifies the address to read from, in the range of 0-0xFFFF. + * + * @return The value read from the port. + * + * @since XT 1.0 + */ +XTCDECL +USHORT +HlIoPortInShort(IN USHORT Port) +{ + USHORT Value; + asm volatile("inw %1, %0" + : "=a" (Value) + : "Nd" (Port)); + return Value; +} + /** * Writes the 8-bit data to the specified I/O port. * @@ -96,30 +96,6 @@ HlIoPortOutByte(IN USHORT Port, "Nd" (Port)); } -/** - * Writes the 16-bit data to the specified I/O port. - * - * @param Port - * Specifies the address to write to, in the range of 0-0xFFFF. - * - * @param Value - * Supplies the value to write. - * - * @return This routine does not return any value. - * - * @since XT 1.0 - */ -XTCDECL -VOID -HlIoPortOutShort(IN USHORT Port, - IN USHORT Value) -{ - asm volatile("outw %0, %1" - : - : "a" (Value), - "Nd" (Port)); -} - /** * Writes the 32-bit data to the specified I/O port. * @@ -143,3 +119,27 @@ HlIoPortOutLong(IN USHORT Port, : "a" (Value), "Nd" (Port)); } + +/** + * Writes the 16-bit data to the specified I/O port. + * + * @param Port + * Specifies the address to write to, in the range of 0-0xFFFF. + * + * @param Value + * Supplies the value to write. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTCDECL +VOID +HlIoPortOutShort(IN USHORT Port, + IN USHORT Value) +{ + asm volatile("outw %0, %1" + : + : "a" (Value), + "Nd" (Port)); +}