From 96f1dd834ca1b2a61237950dff1cf88a5d47549a Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Fri, 13 Jul 2012 13:29:28 +0000 Subject: [PATCH] Added CMOVcc replacements to kernel macros (for eBox) git-svn-id: svn://kolibrios.org@2866 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/macros.inc | 80 +++++++++++++++++++++++ kernel/branches/net/network/tcp.inc | 2 +- kernel/branches/net/network/tcp_input.inc | 4 +- 3 files changed, 83 insertions(+), 3 deletions(-) diff --git a/kernel/branches/net/macros.inc b/kernel/branches/net/macros.inc index 482d8e45f0..ad328c4f9e 100644 --- a/kernel/branches/net/macros.inc +++ b/kernel/branches/net/macros.inc @@ -117,3 +117,83 @@ macro list_del entry mov [ecx+list_fd], edx } + + +if __CPU_type eq p5 ; CMOVcc isnt supported on the P5 + +cmove fix cmovz +macro cmovz reg1, reg2 { + +local .jumpaddr + + jnz .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +cmovne fix cmovnz +macro cmovnz reg1, reg2 { + +local .jumpaddr + + jz .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovg reg1, reg2 { + +local .jumpaddr + + jle .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovl reg1, reg2 { + +local .jumpaddr + + jge .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmova reg1, reg2 { + +local .jumpaddr + + jbe .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovb reg1, reg2 { + +local .jumpaddr + + jae .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovae reg1, reg2 { + +local .jumpaddr + + jb .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +macro cmovbe reg1, reg2 { + +local .jumpaddr + + ja .jumpaddr + mov reg1, reg2 + .jumpaddr: +} + +end if + diff --git a/kernel/branches/net/network/tcp.inc b/kernel/branches/net/network/tcp.inc index e4beeeeb71..1a50319f28 100644 --- a/kernel/branches/net/network/tcp.inc +++ b/kernel/branches/net/network/tcp.inc @@ -134,7 +134,7 @@ include 'tcp_output.inc' ; ; TCP_API ; -; This function is called by system function 75 +; This function is called by system function 76 ; ; IN: subfunction number in bl ; device number in bh diff --git a/kernel/branches/net/network/tcp_input.inc b/kernel/branches/net/network/tcp_input.inc index 6e13d613da..ca1545cc95 100644 --- a/kernel/branches/net/network/tcp_input.inc +++ b/kernel/branches/net/network/tcp_input.inc @@ -966,7 +966,7 @@ align 4 mov eax, [ebx + TCP_SOCKET.SND_WND] cmp eax, [ebx + TCP_SOCKET.SND_CWND] - cmovg eax, [ebx + TCP_SOCKET.SND_CWND] + cmova eax, [ebx + TCP_SOCKET.SND_CWND] shr eax, 1 push edx xor edx, edx @@ -1108,7 +1108,7 @@ align 4 pop ecx cmp esi, eax - cmovg esi, eax + cmova esi, eax mov [ebx + TCP_SOCKET.SND_CWND], esi