ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2005
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
563 discussions
Start a n
N
ew thread
[chorns] 16809: Update API status to SVN
by chorns@svn.reactos.com
Update API status to SVN Modified: trunk/reactos/tools/rgenstat/web/rapistatus.js _____ Modified: trunk/reactos/tools/rgenstat/web/rapistatus.js --- trunk/reactos/tools/rgenstat/web/rapistatus.js 2005-07-27 18:46:27 UTC (rev 16808) +++ trunk/reactos/tools/rgenstat/web/rapistatus.js 2005-07-27 18:46:52 UTC (rev 16809) @@ -145,23 +145,22 @@ if (elt.className == 'l') // label { - var strName; + var strName; eltDiv = getParentDiv (elt); var strEltClass = eltDiv.className; if (strEltClass.charAt (strEltClass.length - 1) == '_') strEltClass = strEltClass.slice (0, strEltClass.length - 1); - strName = getName (eltDiv); + strName = getName (eltDiv); if (strEltClass == 'f') // Function { - var strFilename = elt.nextSibling; + var strFilename = elt.nextSibling; if (strFilename && strFilename.innerText) { - var strRoot = '
http://mok.lvcm.com/cgi-bin/reactos/ros-cvs/~checkout~/
'; - var strExtra = '?content-type=text/plain'; - - window.open (strRoot + strFilename.innerText + strExtra, 'CVS'); + var strRoot = '
http://svn.reactos.com/viewcvs/trunk/
'; + var strExtra = '?view=markup'; + window.open (strRoot + strFilename.innerText + strExtra, 'SVN'); } } }
19 years, 6 months
1
0
0
0
[chorns] 16808: rgenstat makefile
by chorns@svn.reactos.com
rgenstat makefile Added: trunk/reactos/tools/rgenstat/rgenstat.mak _____ Added: trunk/reactos/tools/rgenstat/rgenstat.mak --- trunk/reactos/tools/rgenstat/rgenstat.mak 2005-07-27 18:24:18 UTC (rev 16807) +++ trunk/reactos/tools/rgenstat/rgenstat.mak 2005-07-27 18:46:27 UTC (rev 16808) @@ -0,0 +1,51 @@ +RGENSTAT_BASE = $(TOOLS_BASE_)rgenstat +RGENSTAT_BASE_ = $(RGENSTAT_BASE)$(SEP) +RGENSTAT_INT = $(INTERMEDIATE_)$(RGENSTAT_BASE) +RGENSTAT_INT_ = $(RGENSTAT_INT)$(SEP) +RGENSTAT_OUT = $(OUTPUT_)$(RGENSTAT_BASE) +RGENSTAT_OUT_ = $(RGENSTAT_OUT)$(SEP) + +$(RGENSTAT_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RGENSTAT_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +RGENSTAT_TARGET = \ + $(EXEPREFIX)$(RGENSTAT_OUT_)rgenstat$(EXEPOSTFIX) + +RGENSTAT_SOURCES = $(addprefix $(RGENSTAT_BASE_), \ + rgenstat.c \ + llmosrt.c \ + ) + +RGENSTAT_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(RGENSTAT_SOURCES:.c=.o)) + +RGENSTAT_HOST_CFLAGS = -g -Werror -Wall + +RGENSTAT_HOST_LFLAGS = -g + +$(RGENSTAT_TARGET): $(RGENSTAT_OBJECTS) | $(RGENSTAT_OUT) + $(ECHO_LD) + ${host_gcc} $(RGENSTAT_OBJECTS) $(RGENSTAT_HOST_LFLAGS) -o $@ + +$(RGENSTAT_INT_)rgenstat.o: $(RGENSTAT_BASE_)rgenstat.c | $(RGENSTAT_INT) + $(ECHO_CC) + ${host_gcc} $(RGENSTAT_HOST_CFLAGS) -c $< -o $@ + +$(RGENSTAT_INT_)llmosrt.o: $(RGENSTAT_BASE_)llmosrt.c | $(RGENSTAT_INT) + $(ECHO_CC) + ${host_gcc} $(RGENSTAT_HOST_CFLAGS) -c $< -o $@ + +.PHONY: rgenstat +rgenstat: $(RGENSTAT_TARGET) + +.PHONY: rgenstat_clean +rgenstat_clean: $(RGENSTAT_TARGET) + -@$(rm) $(RGENSTAT_TARGET) $(RGENSTAT_OBJECTS) 2>$(NUL) +clean: rgenstat_clean Property changes on: trunk/reactos/tools/rgenstat/rgenstat.mak ___________________________________________________________________ Name: svn:eol-style + native
19 years, 6 months
1
0
0
0
[weiden] 16807: implemented GetInheritanceSource and FreeInheritedFromArray and forward them to the MARTA provider
by weiden@svn.reactos.com
implemented GetInheritanceSource and FreeInheritedFromArray and forward them to the MARTA provider Modified: trunk/reactos/lib/advapi32/advapi32.h Modified: trunk/reactos/lib/advapi32/sec/ac.c Modified: trunk/reactos/lib/advapi32/sec/misc.c Modified: trunk/reactos/lib/ntmarta/ntmarta.c Modified: trunk/reactos/lib/ntmarta/ntmarta.def _____ Modified: trunk/reactos/lib/advapi32/advapi32.h --- trunk/reactos/lib/advapi32/advapi32.h 2005-07-27 17:20:57 UTC (rev 16806) +++ trunk/reactos/lib/advapi32/advapi32.h 2005-07-27 18:24:18 UTC (rev 16807) @@ -69,8 +69,21 @@ PVOID RewriteGetExplicitEntriesFromAcl; PVOID TreeResetNamedSecurityInfo; - PVOID GetInheritanceSource; - PVOID FreeIndexArray; + + DWORD (STDCALL *GetInheritanceSource)(LPWSTR pObjectName, + SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, + BOOL Container, + GUID** pObjectClassGuids, + DWORD GuidCount, + PACL pAcl, + PFN_OBJECT_MGR_FUNCTS pfnArray, + PGENERIC_MAPPING pGenericMapping, + PINHERITED_FROMW pInheritArray); + + DWORD (STDCALL *FreeIndexArray)(PINHERITED_FROMW pInheritArray, + USHORT AceCnt, + PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL); } NTMARTA, *PNTMARTA; #define AccLookupAccountTrustee NtMartaStatic.LookupAccountTrustee _____ Modified: trunk/reactos/lib/advapi32/sec/ac.c --- trunk/reactos/lib/advapi32/sec/ac.c 2005-07-27 17:20:57 UTC (rev 16806) +++ trunk/reactos/lib/advapi32/sec/ac.c 2005-07-27 18:24:18 UTC (rev 16807) @@ -435,7 +435,7 @@ /* - * @unimplemented + * @implemented */ DWORD STDCALL @@ -452,8 +452,25 @@ PINHERITED_FROMW pInheritArray ) { - DPRINT1("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; + DWORD ErrorCode; + + ErrorCode = CheckNtMartaPresent(); + if (ErrorCode == ERROR_SUCCESS) + { + /* call the MARTA provider */ + ErrorCode = AccGetInheritanceSource(pObjectName, + ObjectType, + SecurityInfo, + Container, + pObjectClassGuids, + GuidCount, + pAcl, + pfnArray, + pGenericMapping, + pInheritArray); + } + + return ErrorCode; } @@ -475,24 +492,38 @@ PINHERITED_FROM pInheritArray ) { - DPRINT1("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; + /* That's all this function does, at least up to w2k3... Even MS was too + lazy to implement it... */ + return ERROR_CALL_NOT_IMPLEMENTED; } /* - * @unimplemented + * @implemented */ DWORD STDCALL FreeInheritedFromArray ( - PINHERITED_FROM pInheritArray, + PINHERITED_FROMW pInheritArray, USHORT AceCnt, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL ) { - DPRINT1("%s() not implemented!\n", __FUNCTION__); - return ERROR_CALL_NOT_IMPLEMENTED; + DWORD ErrorCode; + + /* pfnArray is not yet used */ + UNREFERENCED_PARAMETER(pfnArray); + + ErrorCode = CheckNtMartaPresent(); + if (ErrorCode == ERROR_SUCCESS) + { + /* call the MARTA provider */ + ErrorCode = AccFreeIndexArray(pInheritArray, + AceCnt, + NULL); + } + + return ErrorCode; } _____ Modified: trunk/reactos/lib/advapi32/sec/misc.c --- trunk/reactos/lib/advapi32/sec/misc.c 2005-07-27 17:20:57 UTC (rev 16806) +++ trunk/reactos/lib/advapi32/sec/misc.c 2005-07-27 18:24:18 UTC (rev 16807) @@ -62,9 +62,9 @@ #if 0 FindNtMartaProc(RewriteGetExplicitEntriesFromAcl); FindNtMartaProc(TreeResetNamedSecurityInfo); +#endif FindNtMartaProc(GetInheritanceSource); FindNtMartaProc(FreeIndexArray); -#endif return ERROR_SUCCESS; } _____ Modified: trunk/reactos/lib/ntmarta/ntmarta.c --- trunk/reactos/lib/ntmarta/ntmarta.c 2005-07-27 17:20:57 UTC (rev 16806) +++ trunk/reactos/lib/ntmarta/ntmarta.c 2005-07-27 18:24:18 UTC (rev 16807) @@ -121,6 +121,43 @@ } +/********************************************************************** + * AccRewriteSetEntriesInAcl EXPORTED + * + * @unimplemented + */ +DWORD STDCALL +AccGetInheritanceSource(LPWSTR pObjectName, + SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, + BOOL Container, + GUID** pObjectClassGuids, + DWORD GuidCount, + PACL pAcl, + PFN_OBJECT_MGR_FUNCTS pfnArray, + PGENERIC_MAPPING pGenericMapping, + PINHERITED_FROMW pInheritArray) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +/********************************************************************** + * AccFreeIndexArray EXPORTED + * + * @unimplemented + */ +DWORD STDCALL +AccFreeIndexArray(PINHERITED_FROMW pInheritArray, + USHORT AceCnt, + PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + BOOL STDCALL DllMain(IN HINSTANCE hinstDLL, IN DWORD dwReason, _____ Modified: trunk/reactos/lib/ntmarta/ntmarta.def --- trunk/reactos/lib/ntmarta/ntmarta.def 2005-07-27 17:20:57 UTC (rev 16806) +++ trunk/reactos/lib/ntmarta/ntmarta.def 2005-07-27 18:24:18 UTC (rev 16807) @@ -1,8 +1,8 @@ LIBRARY ntmarta.dll EXPORTS -;AccFreeIndexArray -;AccGetInheritanceSource +AccFreeIndexArray@12 +AccGetInheritanceSource@40 ;AccProvHandleGrantAccessRights; ;AccRewriteGetExplicitEntriesFromAcl AccRewriteGetHandleRights@32
19 years, 6 months
1
0
0
0
[weiden] 16806: implemented SetEntriesInAclA/W and forward the call to the MARTA provider
by weiden@svn.reactos.com
implemented SetEntriesInAclA/W and forward the call to the MARTA provider Modified: trunk/reactos/lib/advapi32/advapi32.def Modified: trunk/reactos/lib/advapi32/advapi32.h Modified: trunk/reactos/lib/advapi32/sec/ac.c Modified: trunk/reactos/lib/advapi32/sec/misc.c Modified: trunk/reactos/lib/ntmarta/ntmarta.c Modified: trunk/reactos/lib/ntmarta/ntmarta.def _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-07-27 17:06:06 UTC (rev 16805) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-07-27 17:20:57 UTC (rev 16806) @@ -550,8 +550,8 @@ SetAclInformation@16 ;SetEntriesInAccessListA ;SetEntriesInAccessListW -;SetEntriesInAclA@16 -;SetEntriesInAclW@16 +SetEntriesInAclA@16 +SetEntriesInAclW@16 ;SetEntriesInAuditListA ;SetEntriesInAuditListW SetFileSecurityA@12 _____ Modified: trunk/reactos/lib/advapi32/advapi32.h --- trunk/reactos/lib/advapi32/advapi32.h 2005-07-27 17:06:06 UTC (rev 16805) +++ trunk/reactos/lib/advapi32/advapi32.h 2005-07-27 17:20:57 UTC (rev 16806) @@ -18,4 +18,82 @@ #define NTOS_MODE_USER #include <ndk/ntndk.h> +/* Interface to ntmarta.dll **************************************************/ + +typedef struct _NTMARTA +{ + HINSTANCE hDllInstance; + + PVOID LookupAccountTrustee; + PVOID LookupAccountName; + PVOID LookupAccountSid; + PVOID SetEntriesInAList; + PVOID ConvertAccessToSecurityDescriptor; + PVOID ConvertSDToAccess; + PVOID ConvertAclToAccess; + PVOID GetAccessForTrustee; + PVOID GetExplicitEntries; + + DWORD (STDCALL *RewriteGetNamedRights)(LPWSTR pObjectName, + SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, + PSID* ppsidOwner, + PSID* ppsidGroup, + PACL* ppDacl, + PACL* ppSacl, + PSECURITY_DESCRIPTOR* ppSecurityDescriptor); + + DWORD (STDCALL *RewriteSetNamedRights)(LPWSTR pObjectName, + SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, + PSECURITY_DESCRIPTOR pSecurityDescriptor); + + DWORD (STDCALL *RewriteGetHandleRights)(HANDLE handle, + SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, + PSID* ppsidOwner, + PSID* ppsidGroup, + PACL* ppDacl, + PACL* ppSacl, + PSECURITY_DESCRIPTOR* ppSecurityDescriptor); + + DWORD (STDCALL *RewriteSetHandleRights)(HANDLE handle, + SE_OBJECT_TYPE ObjectType, + SECURITY_INFORMATION SecurityInfo, + PSECURITY_DESCRIPTOR pSecurityDescriptor); + + DWORD (STDCALL *RewriteSetEntriesInAcl)(ULONG cCountOfExplicitEntries, + PEXPLICIT_ACCESS_W pListOfExplicitEntries, + PACL OldAcl, + PACL* NewAcl); + + PVOID RewriteGetExplicitEntriesFromAcl; + PVOID TreeResetNamedSecurityInfo; + PVOID GetInheritanceSource; + PVOID FreeIndexArray; +} NTMARTA, *PNTMARTA; + +#define AccLookupAccountTrustee NtMartaStatic.LookupAccountTrustee +#define AccLookupAccountName NtMartaStatic.LookupAccountName +#define AccLookupAccountSid NtMartaStatic.LookupAccountSid +#define AccSetEntriesInAList NtMartaStatic.SetEntriesInAList +#define AccConvertAccessToSecurityDescriptor NtMartaStatic.ConvertAccessToSecurityDescriptor +#define AccConvertSDToAccess NtMartaStatic.ConvertSDToAccess +#define AccConvertAclToAccess NtMartaStatic.ConvertAclToAccess +#define AccGetAccessForTrustee NtMartaStatic.GetAccessForTrustee +#define AccGetExplicitEntries NtMartaStatic.GetExplicitEntries +#define AccRewriteGetNamedRights NtMartaStatic.RewriteGetNamedRights +#define AccRewriteSetNamedRights NtMartaStatic.RewriteSetNamedRights +#define AccRewriteGetHandleRights NtMartaStatic.RewriteGetHandleRights +#define AccRewriteSetHandleRights NtMartaStatic.RewriteSetHandleRights +#define AccRewriteSetEntriesInAcl NtMartaStatic.RewriteSetEntriesInAcl +#define AccRewriteGetExplicitEntriesFromAcl NtMartaStatic.RewriteGetExplicitEntriesFromAcl +#define AccTreeResetNamedSecurityInfo NtMartaStatic.TreeResetNamedSecurityInfo +#define AccGetInheritanceSource NtMartaStatic.GetInheritanceSource +#define AccFreeIndexArray NtMartaStatic.FreeIndexArray + +extern NTMARTA NtMartaStatic; + +DWORD CheckNtMartaPresent(VOID); + /* EOF */ _____ Modified: trunk/reactos/lib/advapi32/sec/ac.c --- trunk/reactos/lib/advapi32/sec/ac.c 2005-07-27 17:06:06 UTC (rev 16805) +++ trunk/reactos/lib/advapi32/sec/ac.c 2005-07-27 17:20:57 UTC (rev 16806) @@ -495,4 +495,147 @@ return ERROR_CALL_NOT_IMPLEMENTED; } + +/* + * @implemented + */ +DWORD +STDCALL +SetEntriesInAclW( + ULONG cCountOfExplicitEntries, + PEXPLICIT_ACCESS_W pListOfExplicitEntries, + PACL OldAcl, + PACL* NewAcl) +{ + DWORD ErrorCode; + + ErrorCode = CheckNtMartaPresent(); + if (ErrorCode == ERROR_SUCCESS) + { + /* call the MARTA provider */ + ErrorCode = AccRewriteSetEntriesInAcl(cCountOfExplicitEntries, + pListOfExplicitEntries, + OldAcl, + NewAcl); + } + + return ErrorCode; +} + + +/* + * @implemented + */ +DWORD +STDCALL +SetEntriesInAclA( + ULONG cCountOfExplicitEntries, + PEXPLICIT_ACCESS_A pListOfExplicitEntries, + PACL OldAcl, + PACL* NewAcl) +{ + PEXPLICIT_ACCESS_W ListOfExplicitEntriesW; + ULONG i; + DWORD ErrorCode; + + if (cCountOfExplicitEntries != 0) + { + ListOfExplicitEntriesW = HeapAlloc(GetProcessHeap(), + 0, + cCountOfExplicitEntries * sizeof(EXPLICIT_ACCESS_W)); + if (ListOfExplicitEntriesW != NULL) + { + /* directly copy the array, this works as the size of the EXPLICIT_ACCESS_A + structure matches the size of the EXPLICIT_ACCESS_W version */ + ASSERT(sizeof(EXPLICIT_ACCESS_A) == sizeof(EXPLICIT_ACCESS_W)); + + RtlCopyMemory(ListOfExplicitEntriesW, + pListOfExplicitEntries, + cCountOfExplicitEntries * sizeof(EXPLICIT_ACCESS_W)); + + /* convert the trustee names if required */ + for (i = 0; i != cCountOfExplicitEntries; i++) + { + if (pListOfExplicitEntries[i].Trustee.TrusteeForm == TRUSTEE_IS_NAME) + { + UINT BufCount = strlen(pListOfExplicitEntries[i].Trustee.ptstrName) + 1; + ListOfExplicitEntriesW[i].Trustee.ptstrName = + (LPWSTR)HeapAlloc(GetProcessHeap(), + 0, + BufCount * sizeof(WCHAR)); + + if (ListOfExplicitEntriesW[i].Trustee.ptstrName == NULL || + MultiByteToWideChar(CP_ACP, + 0, + pListOfExplicitEntries[i].Trustee.ptstrName, + -1, + ListOfExplicitEntriesW[i].Trustee.ptstrName, + BufCount) == 0) + { + /* failed to allocate enough momory for the strings or failed to + convert the ansi string to unicode, then fail and free all + allocated memory */ + + ErrorCode = GetLastError(); + + while (i != 0) + { + if (ListOfExplicitEntriesW[i].Trustee.TrusteeForm == TRUSTEE_IS_NAME && + ListOfExplicitEntriesW[i].Trustee.ptstrName != NULL) + { + HeapFree(GetProcessHeap(), + 0, + ListOfExplicitEntriesW[i].Trustee.ptstrName); + } + + i--; + } + + /* free the allocated array */ + HeapFree(GetProcessHeap(), + 0, + ListOfExplicitEntriesW); + + return ErrorCode; + } + } + } + } + else + { + return GetLastError(); + } + } + else + ListOfExplicitEntriesW = NULL; + + ErrorCode = SetEntriesInAclW(cCountOfExplicitEntries, + ListOfExplicitEntriesW, + OldAcl, + NewAcl); + + /* free the strings */ + if (ListOfExplicitEntriesW != NULL) + { + /* free the converted strings */ + for (i = 0; i != cCountOfExplicitEntries; i++) + { + if (ListOfExplicitEntriesW[i].Trustee.TrusteeForm == TRUSTEE_IS_NAME) + { + HeapFree(GetProcessHeap(), + 0, + ListOfExplicitEntriesW[i].Trustee.ptstrName); + } + } + + /* free the allocated array */ + HeapFree(GetProcessHeap(), + 0, + ListOfExplicitEntriesW); + } + + return ErrorCode; +} + + /* EOF */ _____ Modified: trunk/reactos/lib/advapi32/sec/misc.c --- trunk/reactos/lib/advapi32/sec/misc.c 2005-07-27 17:06:06 UTC (rev 16805) +++ trunk/reactos/lib/advapi32/sec/misc.c 2005-07-27 17:20:57 UTC (rev 16806) @@ -15,77 +15,9 @@ /* Interface to ntmarta.dll ***************************************************/ -typedef struct _NTMARTA -{ - HINSTANCE hDllInstance; - - PVOID LookupAccountTrustee; - PVOID LookupAccountName; - PVOID LookupAccountSid; - PVOID SetEntriesInAList; - PVOID ConvertAccessToSecurityDescriptor; - PVOID ConvertSDToAccess; - PVOID ConvertAclToAccess; - PVOID GetAccessForTrustee; - PVOID GetExplicitEntries; - - DWORD (STDCALL *RewriteGetNamedRights)(LPWSTR pObjectName, - SE_OBJECT_TYPE ObjectType, - SECURITY_INFORMATION SecurityInfo, - PSID* ppsidOwner, - PSID* ppsidGroup, - PACL* ppDacl, - PACL* ppSacl, - PSECURITY_DESCRIPTOR* ppSecurityDescriptor); - - DWORD (STDCALL *RewriteSetNamedRights)(LPWSTR pObjectName, - SE_OBJECT_TYPE ObjectType, - SECURITY_INFORMATION SecurityInfo, - PSECURITY_DESCRIPTOR pSecurityDescriptor); - - DWORD (STDCALL *RewriteGetHandleRights)(HANDLE handle, - SE_OBJECT_TYPE ObjectType, - SECURITY_INFORMATION SecurityInfo, - PSID* ppsidOwner, - PSID* ppsidGroup, - PACL* ppDacl, - PACL* ppSacl, - PSECURITY_DESCRIPTOR* ppSecurityDescriptor); - - DWORD (STDCALL *RewriteSetHandleRights)(HANDLE handle, - SE_OBJECT_TYPE ObjectType, - SECURITY_INFORMATION SecurityInfo, - PSECURITY_DESCRIPTOR pSecurityDescriptor); - - PVOID RewriteSetEntriesInAcl; - PVOID RewriteGetExplicitEntriesFromAcl; - PVOID TreeResetNamedSecurityInfo; - PVOID GetInheritanceSource; - PVOID FreeIndexArray; -} NTMARTA, *PNTMARTA; - -static NTMARTA NtMartaStatic = { 0 }; +NTMARTA NtMartaStatic = { 0 }; static PNTMARTA NtMarta = NULL; -#define AccLookupAccountTrustee NtMartaStatic.LookupAccountTrustee -#define AccLookupAccountName NtMartaStatic.LookupAccountName -#define AccLookupAccountSid NtMartaStatic.LookupAccountSid -#define AccSetEntriesInAList NtMartaStatic.SetEntriesInAList -#define AccConvertAccessToSecurityDescriptor NtMartaStatic.ConvertAccessToSecurityDescriptor -#define AccConvertSDToAccess NtMartaStatic.ConvertSDToAccess -#define AccConvertAclToAccess NtMartaStatic.ConvertAclToAccess -#define AccGetAccessForTrustee NtMartaStatic.GetAccessForTrustee -#define AccGetExplicitEntries NtMartaStatic.GetExplicitEntries -#define AccRewriteGetNamedRights NtMartaStatic.RewriteGetNamedRights -#define AccRewriteSetNamedRights NtMartaStatic.RewriteSetNamedRights -#define AccRewriteGetHandleRights NtMartaStatic.RewriteGetHandleRights -#define AccRewriteSetHandleRights NtMartaStatic.RewriteSetHandleRights -#define AccRewriteSetEntriesInAcl NtMartaStatic.RewriteSetEntriesInAcl -#define AccRewriteGetExplicitEntriesFromAcl NtMartaStatic.RewriteGetExplicitEntriesFromAcl -#define AccTreeResetNamedSecurityInfo NtMartaStatic.TreeResetNamedSecurityInfo -#define AccGetInheritanceSource NtMartaStatic.GetInheritanceSource -#define AccFreeIndexArray NtMartaStatic.FreeIndexArray - #define FindNtMartaProc(Name) \ NtMartaStatic.Name = (PVOID)GetProcAddress(NtMartaStatic.hDllInstance, \ "Acc" # Name ); \ @@ -126,8 +58,8 @@ FindNtMartaProc(RewriteSetNamedRights); FindNtMartaProc(RewriteGetHandleRights); FindNtMartaProc(RewriteSetHandleRights); -#if 0 FindNtMartaProc(RewriteSetEntriesInAcl); +#if 0 FindNtMartaProc(RewriteGetExplicitEntriesFromAcl); FindNtMartaProc(TreeResetNamedSecurityInfo); FindNtMartaProc(GetInheritanceSource); @@ -137,7 +69,7 @@ return ERROR_SUCCESS; } -static DWORD +DWORD CheckNtMartaPresent(VOID) { DWORD ErrorCode; _____ Modified: trunk/reactos/lib/ntmarta/ntmarta.c --- trunk/reactos/lib/ntmarta/ntmarta.c 2005-07-27 17:06:06 UTC (rev 16805) +++ trunk/reactos/lib/ntmarta/ntmarta.c 2005-07-27 17:20:57 UTC (rev 16806) @@ -105,6 +105,22 @@ } +/********************************************************************** + * AccRewriteSetEntriesInAcl EXPORTED + * + * @unimplemented + */ +DWORD STDCALL +AccRewriteSetEntriesInAcl(ULONG cCountOfExplicitEntries, + PEXPLICIT_ACCESS_W pListOfExplicitEntries, + PACL OldAcl, + PACL* NewAcl) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + BOOL STDCALL DllMain(IN HINSTANCE hinstDLL, IN DWORD dwReason, _____ Modified: trunk/reactos/lib/ntmarta/ntmarta.def --- trunk/reactos/lib/ntmarta/ntmarta.def 2005-07-27 17:06:06 UTC (rev 16805) +++ trunk/reactos/lib/ntmarta/ntmarta.def 2005-07-27 17:20:57 UTC (rev 16806) @@ -7,7 +7,7 @@ ;AccRewriteGetExplicitEntriesFromAcl AccRewriteGetHandleRights@32 AccRewriteGetNamedRights@32 -;AccRewriteSetEntriesInAcl +AccRewriteSetEntriesInAcl@16 AccRewriteSetHandleRights@16 AccRewriteSetNamedRights@16 ;AccTreeResetNamedSecurityInfo
19 years, 6 months
1
0
0
0
[sedwards] 16805: revert the ctype.h changes to wine dlls
by sedwards@svn.reactos.com
revert the ctype.h changes to wine dlls Modified: trunk/reactos/lib/dbghelp/module.c Modified: trunk/reactos/lib/dbghelp/path.c Modified: trunk/reactos/lib/dbghelp/stabs.c Modified: trunk/reactos/lib/oleaut32/vartype.c Modified: trunk/reactos/lib/shell32/shfldr_mycomp.c Modified: trunk/reactos/lib/shlwapi/path.c Modified: trunk/reactos/lib/uxtheme/msstyles.c Modified: trunk/reactos/lib/uxtheme/uxini.c Modified: trunk/reactos/lib/wininet/ftp.c _____ Modified: trunk/reactos/lib/dbghelp/module.c --- trunk/reactos/lib/dbghelp/module.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/dbghelp/module.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -22,7 +22,6 @@ #include "config.h" #include <stdlib.h> #include <stdio.h> -#include <ctype.h> #include <string.h> #include <assert.h> _____ Modified: trunk/reactos/lib/dbghelp/path.c --- trunk/reactos/lib/dbghelp/path.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/dbghelp/path.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -21,7 +21,6 @@ #include "config.h" #include <stdlib.h> #include <stdio.h> -#include <ctype.h> #include <string.h> #include "dbghelp_private.h" _____ Modified: trunk/reactos/lib/dbghelp/stabs.c --- trunk/reactos/lib/dbghelp/stabs.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/dbghelp/stabs.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -39,7 +39,6 @@ #endif #include <limits.h> #include <stdlib.h> -#include <ctype.h> #include <string.h> #ifdef HAVE_UNISTD_H # include <unistd.h> _____ Modified: trunk/reactos/lib/oleaut32/vartype.c --- trunk/reactos/lib/oleaut32/vartype.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/oleaut32/vartype.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -29,7 +29,6 @@ #include "winnt.h" #include "variant.h" #include "resource.h" -#include <ctype.h> WINE_DEFAULT_DEBUG_CHANNEL(variant); _____ Modified: trunk/reactos/lib/shell32/shfldr_mycomp.c --- trunk/reactos/lib/shell32/shfldr_mycomp.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/shell32/shfldr_mycomp.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -26,7 +26,6 @@ #include <string.h> #include <stdarg.h> #include <stdio.h> -#include <ctype.h> #define COBJMACROS #define NONAMELESSUNION _____ Modified: trunk/reactos/lib/shlwapi/path.c --- trunk/reactos/lib/shlwapi/path.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/shlwapi/path.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -25,7 +25,6 @@ #include <stdarg.h> #include <string.h> #include <stdlib.h> -#include <ctype.h> #include "wine/unicode.h" #include "windef.h" _____ Modified: trunk/reactos/lib/uxtheme/msstyles.c --- trunk/reactos/lib/uxtheme/msstyles.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/uxtheme/msstyles.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -21,7 +21,6 @@ #include "config.h" #include <stdarg.h> -#include <ctype.h> #include "windef.h" #include "winbase.h" _____ Modified: trunk/reactos/lib/uxtheme/uxini.c --- trunk/reactos/lib/uxtheme/uxini.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/uxtheme/uxini.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -21,7 +21,6 @@ #include "config.h" #include <stdarg.h> -#include <ctype.h> #include "windef.h" #include "winbase.h" _____ Modified: trunk/reactos/lib/wininet/ftp.c --- trunk/reactos/lib/wininet/ftp.c 2005-07-27 16:55:40 UTC (rev 16804) +++ trunk/reactos/lib/wininet/ftp.c 2005-07-27 17:06:06 UTC (rev 16805) @@ -34,7 +34,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> #include <sys/types.h> #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h>
19 years, 6 months
1
0
0
0
[ion] 16804: - Include ctype.h by default.
by ion@svn.reactos.com
- Include ctype.h by default. Modified: trunk/reactos/w32api/include/winnt.h _____ Modified: trunk/reactos/w32api/include/winnt.h --- trunk/reactos/w32api/include/winnt.h 2005-07-27 16:34:14 UTC (rev 16803) +++ trunk/reactos/w32api/include/winnt.h 2005-07-27 16:55:40 UTC (rev 16804) @@ -34,6 +34,7 @@ extern "C" { #endif +#include <ctype.h> #include <winerror.h> #ifndef RC_INVOKED
19 years, 6 months
1
0
0
0
[ion] 16803: - Use inline function instead of macro.
by ion@svn.reactos.com
- Use inline function instead of macro. Modified: trunk/reactos/lib/ntdll/stdio/sprintf.c Modified: trunk/reactos/lib/ntdll/stdio/swprintf.c _____ Modified: trunk/reactos/lib/ntdll/stdio/sprintf.c --- trunk/reactos/lib/ntdll/stdio/sprintf.c 2005-07-27 16:18:06 UTC (rev 16802) +++ trunk/reactos/lib/ntdll/stdio/sprintf.c 2005-07-27 16:34:14 UTC (rev 16803) @@ -20,15 +20,8 @@ * Wirzenius wrote this portably, Torvalds fucked it up :-) */ -#define __NO_CTYPE_INLINES -#include <ctype.h> -#include <limits.h> - #include <ntdll.h> -#define NDEBUG -#include <debug.h> - #define ZEROPAD 1 /* pad with zero */ #define SIGN 2 /* unsigned/signed long */ #define PLUS 4 /* show plus */ @@ -38,11 +31,16 @@ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ -#define do_div(n,base) ({ \ -int __res; \ -__res = ((unsigned long long) n) % (unsigned) base; \ -n = ((unsigned long long) n) / (unsigned) base; \ -__res; }) +static +__inline +int +do_div(long long *n, int base) +{ + int a; + a = ((unsigned long long) *n) % (unsigned) base; + *n = ((unsigned long long) *n) / (unsigned) base; + return a; +} static int skip_atoi(const char **s) @@ -94,7 +92,7 @@ if (num == 0) tmp[i++]='0'; else while (num != 0) - tmp[i++] = digits[do_div(num,base)]; + tmp[i++] = digits[do_div(&num,base)]; if (i > precision) precision = i; size -= precision; _____ Modified: trunk/reactos/lib/ntdll/stdio/swprintf.c --- trunk/reactos/lib/ntdll/stdio/swprintf.c 2005-07-27 16:18:06 UTC (rev 16802) +++ trunk/reactos/lib/ntdll/stdio/swprintf.c 2005-07-27 16:34:14 UTC (rev 16803) @@ -37,11 +37,16 @@ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ -#define do_div(n,base) ({ \ -int __res; \ -__res = ((unsigned long long) n) % (unsigned) base; \ -n = ((unsigned long long) n) / (unsigned) base; \ -__res; }) +static +__inline +int +do_div(long long *n, int base) +{ + int a; + a = ((unsigned long long) *n) % (unsigned) base; + *n = ((unsigned long long) *n) / (unsigned) base; + return a; +} static int skip_atoi(const wchar_t **s) @@ -93,7 +98,7 @@ if (num == 0) tmp[i++] = L'0'; else while (num != 0) - tmp[i++] = digits[do_div(num,base)]; + tmp[i++] = digits[do_div(&num,base)]; if (i > precision) precision = i; size -= precision;
19 years, 6 months
1
0
0
0
[ion] 16802: - Use PCH everywhere to increase compile speed
by ion@svn.reactos.com
- Use PCH everywhere to increase compile speed - Some PSDK compatibility. Modified: trunk/reactos/lib/ntdll/inc/ntdll.h Modified: trunk/reactos/lib/ntdll/ldr/utils.c Modified: trunk/reactos/lib/ntdll/rtl/path.c Modified: trunk/reactos/lib/ntdll/stdlib/abs.c Modified: trunk/reactos/lib/ntdll/stdlib/atoi.c Modified: trunk/reactos/lib/ntdll/stdlib/atoi64.c Modified: trunk/reactos/lib/ntdll/stdlib/atol.c Modified: trunk/reactos/lib/ntdll/stdlib/bsearch.c Modified: trunk/reactos/lib/ntdll/stdlib/itoa.c Modified: trunk/reactos/lib/ntdll/stdlib/itow.c Modified: trunk/reactos/lib/ntdll/stdlib/labs.c Modified: trunk/reactos/lib/ntdll/stdlib/lfind.c Modified: trunk/reactos/lib/ntdll/stdlib/splitp.c Modified: trunk/reactos/lib/ntdll/stdlib/strtol.c Modified: trunk/reactos/lib/ntdll/stdlib/strtoul.c Modified: trunk/reactos/lib/ntdll/stdlib/wcstol.c Modified: trunk/reactos/lib/ntdll/stdlib/wcstoul.c Modified: trunk/reactos/lib/ntdll/stdlib/wtoi.c Modified: trunk/reactos/lib/ntdll/stdlib/wtoi64.c Modified: trunk/reactos/lib/ntdll/stdlib/wtol.c Modified: trunk/reactos/lib/ntdll/string/ctype.c Modified: trunk/reactos/lib/ntdll/string/memicmp.c Modified: trunk/reactos/lib/ntdll/string/stricmp.c Modified: trunk/reactos/lib/ntdll/string/strlwr.c Modified: trunk/reactos/lib/ntdll/string/strnicmp.c Modified: trunk/reactos/lib/ntdll/string/strstr.c Modified: trunk/reactos/lib/ntdll/string/strupr.c Modified: trunk/reactos/lib/ntdll/string/wstring.c _____ Modified: trunk/reactos/lib/ntdll/inc/ntdll.h --- trunk/reactos/lib/ntdll/inc/ntdll.h 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/inc/ntdll.h 2005-07-27 16:18:06 UTC (rev 16802) @@ -9,6 +9,9 @@ /* INCLUDES ******************************************************************/ /* C Headers */ +#define _CTYPE_DISABLE_MACROS +#define _INC_SWPRINTF_INL_ +#include <limits.h> #include <stdio.h> #include <ctype.h> _____ Modified: trunk/reactos/lib/ntdll/ldr/utils.c --- trunk/reactos/lib/ntdll/ldr/utils.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/ldr/utils.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -96,7 +96,7 @@ return FALSE; } -static inline LONG LdrpDecrementLoadCount(PLDR_DATA_TABLE_ENTRY Module, BOOLEAN Locked) +static __inline LONG LdrpDecrementLoadCount(PLDR_DATA_TABLE_ENTRY Module, BOOLEAN Locked) { LONG LoadCount; if (!Locked) @@ -115,7 +115,7 @@ return LoadCount; } -static inline LONG LdrpIncrementLoadCount(PLDR_DATA_TABLE_ENTRY Module, BOOLEAN Locked) +static __inline LONG LdrpIncrementLoadCount(PLDR_DATA_TABLE_ENTRY Module, BOOLEAN Locked) { LONG LoadCount; if (!Locked) @@ -134,7 +134,7 @@ return LoadCount; } -static inline VOID LdrpAcquireTlsSlot(PLDR_DATA_TABLE_ENTRY Module, ULONG Size, BOOLEAN Locked) +static __inline VOID LdrpAcquireTlsSlot(PLDR_DATA_TABLE_ENTRY Module, ULONG Size, BOOLEAN Locked) { if (!Locked) { @@ -149,7 +149,7 @@ } } -static inline VOID LdrpTlsCallback(PLDR_DATA_TABLE_ENTRY Module, ULONG dwReason) +static __inline VOID LdrpTlsCallback(PLDR_DATA_TABLE_ENTRY Module, ULONG dwReason) { PIMAGE_TLS_CALLBACK TlsCallback; if (Module->TlsIndex != 0xFFFF && Module->LoadCount == 0xFFFF) _____ Modified: trunk/reactos/lib/ntdll/rtl/path.c --- trunk/reactos/lib/ntdll/rtl/path.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/rtl/path.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -406,7 +406,7 @@ * 2) Get rid of duplicate backslashes * 3) Get rid of . and .. components in the path. */ -static inline void collapse_path( WCHAR *path, UINT mark ) +static __inline void collapse_path( WCHAR *path, UINT mark ) { WCHAR *p, *next; _____ Modified: trunk/reactos/lib/ntdll/stdlib/abs.c --- trunk/reactos/lib/ntdll/stdlib/abs.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/abs.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/atoi.c --- trunk/reactos/lib/ntdll/stdlib/atoi.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/atoi.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/atoi64.c --- trunk/reactos/lib/ntdll/stdlib/atoi64.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/atoi64.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -6,9 +6,7 @@ * PURPOSE: converts an ascii string to 64 bit integer */ -#include <stdlib.h> -#define __NO_CTYPE_INLINES -#include <ctype.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/atol.c --- trunk/reactos/lib/ntdll/stdlib/atol.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/atol.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/bsearch.c --- trunk/reactos/lib/ntdll/stdlib/bsearch.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/bsearch.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/itoa.c --- trunk/reactos/lib/ntdll/stdlib/itoa.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/itoa.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -15,8 +15,7 @@ * Copyright 2003 Thomas Mertes */ -#include <stdlib.h> -#include <string.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/itow.c --- trunk/reactos/lib/ntdll/stdlib/itow.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/itow.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -9,7 +9,7 @@ * 1998: Added ltoa Boudewijn Dekker */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/labs.c --- trunk/reactos/lib/ntdll/stdlib/labs.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/labs.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/lfind.c --- trunk/reactos/lib/ntdll/stdlib/lfind.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/lfind.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,4 @@ -#include <search.h> -#include <stdlib.h> +#include <ntdll.h> /* _____ Modified: trunk/reactos/lib/ntdll/stdlib/splitp.c --- trunk/reactos/lib/ntdll/stdlib/splitp.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/splitp.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,4 @@ -#include <stdlib.h> -#include <string.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/strtol.c --- trunk/reactos/lib/ntdll/stdlib/strtol.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/strtol.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,10 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <limits.h> -#define __NO_CTYPE_INLINES -#include <ctype.h> -#include <stdlib.h> +#include <ntdll.h> - /* * @implemented */ _____ Modified: trunk/reactos/lib/ntdll/stdlib/strtoul.c --- trunk/reactos/lib/ntdll/stdlib/strtoul.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/strtoul.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,8 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <limits.h> -#define __NO_CTYPE_INLINES -#include <ctype.h> -#include <stdlib.h> +#include <ntdll.h> /* _____ Modified: trunk/reactos/lib/ntdll/stdlib/wcstol.c --- trunk/reactos/lib/ntdll/stdlib/wcstol.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/wcstol.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,7 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <limits.h> -#include <ctype.h> -#include <stdlib.h> +#include <ntdll.h> /* _____ Modified: trunk/reactos/lib/ntdll/stdlib/wcstoul.c --- trunk/reactos/lib/ntdll/stdlib/wcstoul.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/wcstoul.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,9 +1,6 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <limits.h> -#include <ctype.h> -#include <stdlib.h> +#include <ntdll.h> - /* * Convert a unicode string to an unsigned long integer. * _____ Modified: trunk/reactos/lib/ntdll/stdlib/wtoi.c --- trunk/reactos/lib/ntdll/stdlib/wtoi.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/wtoi.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/wtoi64.c --- trunk/reactos/lib/ntdll/stdlib/wtoi64.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/wtoi64.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -6,8 +6,7 @@ * PURPOSE: converts a unicode string to 64 bit integer */ -#include <stdlib.h> -#include <ctype.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/stdlib/wtol.c --- trunk/reactos/lib/ntdll/stdlib/wtol.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/stdlib/wtol.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,5 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <stdlib.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/string/ctype.c --- trunk/reactos/lib/ntdll/string/ctype.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/ctype.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -10,8 +10,7 @@ * 29/12/1999: Added missing functions and changed * all functions to use ctype table */ -#undef __MSVCRT__ -#include <ctype.h> +#include <ntdll.h> #undef _pctype _____ Modified: trunk/reactos/lib/ntdll/string/memicmp.c --- trunk/reactos/lib/ntdll/string/memicmp.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/memicmp.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <string.h> -#include <ctype.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/string/stricmp.c --- trunk/reactos/lib/ntdll/string/stricmp.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/stricmp.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <string.h> -#include <ctype.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/string/strlwr.c --- trunk/reactos/lib/ntdll/string/strlwr.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/strlwr.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -8,8 +8,7 @@ * Copyright 1997 Uwe Bonnes */ -#include <string.h> -#include <ctype.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/string/strnicmp.c --- trunk/reactos/lib/ntdll/string/strnicmp.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/strnicmp.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <string.h> -#include <ctype.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/string/strstr.c --- trunk/reactos/lib/ntdll/string/strstr.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/strstr.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -1,6 +1,5 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ -#include <string.h> -//#include <unconst.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/string/strupr.c --- trunk/reactos/lib/ntdll/string/strupr.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/strupr.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -9,8 +9,7 @@ */ -#include <string.h> -#include <ctype.h> +#include <ntdll.h> /* * @implemented _____ Modified: trunk/reactos/lib/ntdll/string/wstring.c --- trunk/reactos/lib/ntdll/string/wstring.c 2005-07-27 16:11:29 UTC (rev 16801) +++ trunk/reactos/lib/ntdll/string/wstring.c 2005-07-27 16:18:06 UTC (rev 16802) @@ -12,7 +12,7 @@ /* INCLUDES *****************************************************************/ -#include <wchar.h> +#include <ntdll.h> /* FUNCTIONS *****************************************************************/
19 years, 6 months
1
0
0
0
[ion] 16801: - Combine some assembly files together and move them to rtl
by ion@svn.reactos.com
- Combine some assembly files together and move them to rtl - Convert rtl memory functions written by Greatlord to GAS and properly add them into build system (not used yet since they haven't been tested) - Misc cleanups Deleted: trunk/reactos/lib/ntdll/dbg/brkpoint.c Deleted: trunk/reactos/lib/ntdll/nasm/ Modified: trunk/reactos/lib/ntdll/ntdll.xml Deleted: trunk/reactos/lib/ntdll/rtl/i386/ Modified: trunk/reactos/lib/ntdll/rtl/math.c Deleted: trunk/reactos/lib/rtl/i386/alldiv.s Deleted: trunk/reactos/lib/rtl/i386/allmul.s Deleted: trunk/reactos/lib/rtl/i386/allrem.s Deleted: trunk/reactos/lib/rtl/i386/allshl.s Deleted: trunk/reactos/lib/rtl/i386/allshr.s Deleted: trunk/reactos/lib/rtl/i386/aulldiv.s Deleted: trunk/reactos/lib/rtl/i386/aullrem.s Deleted: trunk/reactos/lib/rtl/i386/aullshr.s Added: trunk/reactos/lib/rtl/i386/debug.S Added: trunk/reactos/lib/rtl/i386/math.S Added: trunk/reactos/lib/rtl/i386/mem.S Added: trunk/reactos/lib/rtl/i386/random.S Modified: trunk/reactos/lib/rtl/rtl.xml Modified: trunk/reactos/ntoskrnl/ke/i386/brkpoint.S _____ Deleted: trunk/reactos/lib/ntdll/dbg/brkpoint.c --- trunk/reactos/lib/ntdll/dbg/brkpoint.c 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/ntdll/dbg/brkpoint.c 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,50 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/ntdll/dbg/brkpoint.c - * PURPOSE: Handles breakpoints - * PROGRAMMER: Eric Kohl - * UPDATE HISTORY: - * Created 28/12/1999 - */ - -/* INCLUDES *****************************************************************/ - -#include <ntdll.h> -#define NDEBUG -#include <debug.h> - -/* FUNCTIONS *****************************************************************/ - -#if 0 -/* - * FIXME: DbgBreakPoint must not have a stack frame, but GCC doesn't support - * __declspec(naked) yet - * - * @implemented - */ -__declspec(naked) VOID STDCALL DbgBreakPoint(VOID) -{ __asm__(ASM_BREAKPOINT_STR); } - -/* - * @implemented - */ -VOID STDCALL DbgUserBreakPoint(VOID) -{ __asm__(ASM_BREAKPOINT_STR); } -#else -#define DBG_BP_FUNC(__NAME__) \ -__asm__ \ -( \ - "\n" \ - ".global _" #__NAME__ "@0\n" \ - "_" #__NAME__ "@0:\n" \ - ASM_BREAKPOINT \ - "ret $0\n" \ -) - -DBG_BP_FUNC(DbgBreakPoint); -DBG_BP_FUNC(DbgUserBreakPoint); -#endif - -/* EOF */ _____ Modified: trunk/reactos/lib/ntdll/ntdll.xml --- trunk/reactos/lib/ntdll/ntdll.xml 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/ntdll/ntdll.xml 2005-07-27 16:11:29 UTC (rev 16801) @@ -18,7 +18,6 @@ <file>thread.c</file> </directory> <directory name="dbg"> - <file>brkpoint.c</file> <file>debug.c</file> <file>print.c</file> </directory> @@ -32,9 +31,6 @@ <file>dllmain.c</file> </directory> <directory name="rtl"> - <directory name="i386"> - <file>ftol.c</file> - </directory> <file>apc.c</file> <file>callback.c</file> <file>crc32.c</file> _____ Modified: trunk/reactos/lib/ntdll/rtl/math.c --- trunk/reactos/lib/ntdll/rtl/math.c 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/ntdll/rtl/math.c 2005-07-27 16:11:29 UTC (rev 16801) @@ -33,6 +33,7 @@ double sqrt (double __x); double tan (double __x); +int _fltused = 0x9875; double atan (double __x) { _____ Deleted: trunk/reactos/lib/rtl/i386/alldiv.s --- trunk/reactos/lib/rtl/i386/alldiv.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/alldiv.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,50 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/alldiv.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - */ - -/* - * long long - * __alldiv(long long Dividend, long long Divisor); - * - * Parameters: - * [ESP+04h] - long long Dividend - * [ESP+0Ch] - long long Divisor - * Registers: - * Unknown - * Returns: - * EDX:EAX - long long quotient (Dividend/Divisor) - * Notes: - * Routine removes the arguments from the stack. - */ -.globl __alldiv -__alldiv: - call ___divdi3 - ret $0x10 - -/* -__alldiv: - pushl %ebp - movl %esp, %ebp - pushl %eax - pushl %eax - movl 20(%ebp), %eax - pushl %eax - movl 16(%ebp), %eax - pushl %eax - movl 12(%ebp), %eax - pushl %eax - movl 8(%ebp), %eax - pushl %eax - call ___divdi3 - addl $16, %esp - movl %ebp, %esp - popl %ebp - ret -*/ - -/* EOF */ _____ Deleted: trunk/reactos/lib/rtl/i386/allmul.s --- trunk/reactos/lib/rtl/i386/allmul.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/allmul.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,54 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/allmul.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - */ - -/* - * long long - * __allmul(long long Multiplier, long long Multiplicand); - * - * Parameters: - * [ESP+04h] - long long Multiplier - * [ESP+0Ch] - long long Multiplicand - * Registers: - * Unknown - * Returns: - * EDX:EAX - long long product (Multiplier*Multiplicand) - * Notes: - * Routine removes the arguments from the stack. - */ -.globl __allmul -__allmul: - pushl %ebp - movl %esp, %ebp - pushl %edi - pushl %esi - pushl %ebx - subl $12, %esp - movl 16(%ebp), %ebx - movl 8(%ebp), %eax - mull %ebx - movl 20(%ebp), %ecx - movl %eax, -24(%ebp) - movl 8(%ebp), %eax - movl %edx, %esi - imull %ecx, %eax - addl %eax, %esi - movl 12(%ebp), %eax - imull %eax, %ebx - leal (%ebx,%esi), %eax - movl %eax, -20(%ebp) - movl -24(%ebp), %eax - movl -20(%ebp), %edx - addl $12, %esp - popl %ebx - popl %esi - popl %edi - popl %ebp - ret $0x10 - -/* EOF */ _____ Deleted: trunk/reactos/lib/rtl/i386/allrem.s --- trunk/reactos/lib/rtl/i386/allrem.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/allrem.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,31 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/math.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - * NOTES: This file is shared with ntoskrnl/rtl/i386/math.s. - * Please keep the files synchronized! - */ - -/* - * long long - * __allrem(long long Dividend, long long Divisor); - * - * Parameters: - * [ESP+04h] - long long Dividend - * [ESP+0Ch] - long long Divisor - * Registers: - * Unknown - * Returns: - * EDX:EAX - long long remainder (Dividend/Divisor) - * Notes: - * Routine removes the arguments from the stack. - */ -.globl __allrem -__allrem: - call ___moddi3 - ret $16 - -/* EOF */ _____ Deleted: trunk/reactos/lib/rtl/i386/allshl.s --- trunk/reactos/lib/rtl/i386/allshl.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/allshl.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,33 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/allshl.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - */ - -/* - * long long - * __allshl(long long Value, unsigned char Shift); - * - * Parameters: - * EDX:EAX - signed long long value to be shifted left - * CL - number of bits to shift by - * Registers: - * Destroys CL - * Returns: - * EDX:EAX - shifted value - */ -.globl __allshl -__allshl: - shldl %cl, %eax, %edx - sall %cl, %eax - andl $32, %ecx - je L1 - movl %eax, %edx - xorl %eax, %eax -L1: - ret - -/* EOF */ _____ Deleted: trunk/reactos/lib/rtl/i386/allshr.s --- trunk/reactos/lib/rtl/i386/allshr.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/allshr.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,33 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/allshr.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - */ - -/* - * long long - * __allshr(long long Value, unsigned char Shift); - * - * Parameters: - * EDX:EAX - signed long long value to be shifted right - * CL - number of bits to shift by - * Registers: - * Destroys CL - * Returns: - * EDX:EAX - shifted value - */ -.globl __allshr -__allshr: - shrdl %cl, %edx, %eax - sarl %cl, %edx - andl $32, %ecx - je L1 - movl %edx, %eax - sarl $31, %edx -L1: - ret - -/* EOF */ _____ Deleted: trunk/reactos/lib/rtl/i386/aulldiv.s --- trunk/reactos/lib/rtl/i386/aulldiv.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/aulldiv.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,29 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/aulldiv.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - */ - -/* - * unsigned long long - * __aulldiv(unsigned long long Dividend, unsigned long long Divisor); - * - * Parameters: - * [ESP+04h] - unsigned long long Dividend - * [ESP+0Ch] - unsigned long long Divisor - * Registers: - * Unknown - * Returns: - * EDX:EAX - unsigned long long quotient (Dividend/Divisor) - * Notes: - * Routine removes the arguments from the stack. - */ -.globl __aulldiv -__aulldiv: - call ___udivdi3 - ret $16 - -/* EOF */ _____ Deleted: trunk/reactos/lib/rtl/i386/aullrem.s --- trunk/reactos/lib/rtl/i386/aullrem.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/aullrem.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,29 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/aullrem.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - */ - -/* - * unsigned long long - * __aullrem(unsigned long long Dividend, unsigned long long Divisor); - * - * Parameters: - * [ESP+04h] - unsigned long long Dividend - * [ESP+0Ch] - unsigned long long Divisor - * Registers: - * Unknown - * Returns: - * EDX:EAX - unsigned long long remainder (Dividend%Divisor) - * Notes: - * Routine removes the arguments from the stack. - */ -.globl __aullrem -__aullrem: - call ___umoddi3 - ret $16 - -/* EOF */ _____ Deleted: trunk/reactos/lib/rtl/i386/aullshr.s --- trunk/reactos/lib/rtl/i386/aullshr.s 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/aullshr.s 2005-07-27 16:11:29 UTC (rev 16801) @@ -1,32 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Math support for IA-32 - * FILE: ntoskrnl/rtl/i386/aullshr.s - * PROGRAMER: Eric Kohl (ekohl(a)rz-online.de) - */ - -/* - * unsigned long long - * __aullshr(unsigned long long Value, unsigned char Shift); - * - * Parameters: - * EDX:EAX - unsigned long long value to be shifted right - * CL - number of bits to shift by - * Registers: - * Destroys CL - * Returns: - * EDX:EAX - shifted value - */ -.globl __aullshr -__aullshr: - shrdl %cl, %edx, %eax - shrl %cl, %edx - andl $32, %ecx - je L1 - movl %edx, %eax -L1: - ret - -/* EOF */ _____ Added: trunk/reactos/lib/rtl/i386/debug.S --- trunk/reactos/lib/rtl/i386/debug.S 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/debug.S 2005-07-27 16:11:29 UTC (rev 16801) @@ -0,0 +1,28 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Run-Time Library + * FILE: lib/rtl/i386/debug.S + * PROGRAMER: Alex Ionescu (alex(a)relsoft.net) + * REVISION HISTORY: 27/07/2005 Created + */ + +.intel_syntax noprefix + +/* GLOBALS ****************************************************************/ + +.globl _DbgBreakPoint@0 +.globl _DbgBreakPointWithStatus@4 +.globl _DbgUserBreakPoint@0 + +/* FUNCTIONS ***************************************************************/ + +_DbgBreakPoint@0: +_DbgUserBreakPoint@0: + int 3 + ret + +_DbgBreakPointWithStatus@4: + mov eax, [esp+4] + int 3 + ret 4 _____ Added: trunk/reactos/lib/rtl/i386/math.S --- trunk/reactos/lib/rtl/i386/math.S 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/math.S 2005-07-27 16:11:29 UTC (rev 16801) @@ -0,0 +1,231 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Run-Time Library + * FILE: lib/rtl/i386/math.S + * PROGRAMER: Alex Ionescu (alex(a)relsoft.net) + * Eric Kohl (ekohl(a)rz-online.de) + * REVISION HISTORY: 27/07/2005 Created + */ + +/* GLOBALS ****************************************************************/ + +.globl __ftol +.globl __aullshr +.globl __allrem +.globl __aulldiv +.globl __allshr +.globl __allshl +.globl __aullrem +.globl __allmul +.globl __alldiv + +/* FUNCTIONS ***************************************************************/ + +/* + * long long + * __alldiv(long long Dividend, long long Divisor); + * + * Parameters: + * [ESP+04h] - long long Dividend + * [ESP+0Ch] - long long Divisor + * Registers: + * Unknown + * Returns: + * EDX:EAX - long long quotient (Dividend/Divisor) + * Notes: + * Routine removes the arguments from the stack. + */ +__alldiv: + call ___divdi3 + ret $0x10 + +/* + * long long + * __allmul(long long Multiplier, long long Multiplicand); + * + * Parameters: + * [ESP+04h] - long long Multiplier + * [ESP+0Ch] - long long Multiplicand + * Registers: + * Unknown + * Returns: + * EDX:EAX - long long product (Multiplier*Multiplicand) + * Notes: + * Routine removes the arguments from the stack. + */ +__allmul: + pushl %ebp + movl %esp, %ebp + pushl %edi + pushl %esi + pushl %ebx + subl $12, %esp + movl 16(%ebp), %ebx + movl 8(%ebp), %eax + mull %ebx + movl 20(%ebp), %ecx + movl %eax, -24(%ebp) + movl 8(%ebp), %eax + movl %edx, %esi + imull %ecx, %eax + addl %eax, %esi + movl 12(%ebp), %eax + imull %eax, %ebx + leal (%ebx,%esi), %eax + movl %eax, -20(%ebp) + movl -24(%ebp), %eax + movl -20(%ebp), %edx + addl $12, %esp + popl %ebx + popl %esi + popl %edi + popl %ebp + ret $0x10 + +/* + * unsigned long long + * __aullrem(unsigned long long Dividend, unsigned long long Divisor); + * + * Parameters: + * [ESP+04h] - unsigned long long Dividend + * [ESP+0Ch] - unsigned long long Divisor + * Registers: + * Unknown + * Returns: + * EDX:EAX - unsigned long long remainder (Dividend%Divisor) + * Notes: + * Routine removes the arguments from the stack. + */ +__aullrem: + call ___umoddi3 + ret $16 + +/* + * long long + * __allshl(long long Value, unsigned char Shift); + * + * Parameters: + * EDX:EAX - signed long long value to be shifted left + * CL - number of bits to shift by + * Registers: + * Destroys CL + * Returns: + * EDX:EAX - shifted value + */ +__allshl: + shldl %cl, %eax, %edx + sall %cl, %eax + andl $32, %ecx + je 1f + movl %eax, %edx + xorl %eax, %eax +1: + ret + +/* + * long long + * __allshr(long long Value, unsigned char Shift); + * + * Parameters: + * EDX:EAX - signed long long value to be shifted right + * CL - number of bits to shift by + * Registers: + * Destroys CL + * Returns: + * EDX:EAX - shifted value + */ +__allshr: + shrdl %cl, %edx, %eax + sarl %cl, %edx + andl $32, %ecx + je 1f + movl %edx, %eax + sarl $31, %edx +1: + ret + +/* + * unsigned long long + * __aulldiv(unsigned long long Dividend, unsigned long long Divisor); + * + * Parameters: + * [ESP+04h] - unsigned long long Dividend + * [ESP+0Ch] - unsigned long long Divisor + * Registers: + * Unknown + * Returns: + * EDX:EAX - unsigned long long quotient (Dividend/Divisor) + * Notes: + * Routine removes the arguments from the stack. + */ +__aulldiv: + call ___udivdi3 + ret $16 + +/* + * unsigned long long + * __aullshr(unsigned long long Value, unsigned char Shift); + * + * Parameters: + * EDX:EAX - unsigned long long value to be shifted right + * CL - number of bits to shift by + * Registers: + * Destroys CL + * Returns: + * EDX:EAX - shifted value + */ +__aullshr: + shrdl %cl, %edx, %eax + shrl %cl, %edx + andl $32, %ecx + je 1f + movl %edx, %eax +1: + ret + +/* + * long long + * __allrem(long long Dividend, long long Divisor); + * + * Parameters: + * [ESP+04h] - long long Dividend + * [ESP+0Ch] - long long Divisor + * Registers: + * Unknown + * Returns: + * EDX:EAX - long long remainder (Dividend/Divisor) + * Notes: + * Routine removes the arguments from the stack. + */ +__allrem: + call ___moddi3 + ret $16 + +.intel_syntax noprefix + +__ftol: + /* Set up stack frame */ + push ebp + mov ebp, esp + + /* Set "round towards zero" mode */ + fstcw [ebp-2] + wait + mov ax, [ebp-2] + or ah, 0xC + fldcw [ebp-4] + + /* Do the conversion */ + fistp qword ptr [ebp-8] + + /* Restore rounding mode */ + fldcw [ebp-2] + + /* Return value */ + mov eax, [ebp-12] + mov edx, [ebp-8] + + /* Remove stack frame and return*/ + leave + ret _____ Added: trunk/reactos/lib/rtl/i386/mem.S --- trunk/reactos/lib/rtl/i386/mem.S 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/mem.S 2005-07-27 16:11:29 UTC (rev 16801) @@ -0,0 +1,147 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: mem.asm + * PURPOSE: Memory functions + * PROGRAMMER: Magnus Olsen (magnusolsen(a)greatlord.com) + * UPDATE HISTORY: + * Created 27/07/2005 + */ + +.intel_syntax noprefix + +/* GLOBALS ****************************************************************/ + +.globl _RtlZeroMemory@8 // (no bug) (max optimze code) +.globl _RtlFillMemoryUlong@12 // (no bug) (max optimze code) +.globl _RtlFillMemory@12 // [4] (no bug) +.globl _RtlCompareMemoryUlong@12 // [5] (no bug) +.globl _RtlCompareMemory@12 // [4] (no bug) + +/* FUNCTIONS ***************************************************************/ + +_RtlZeroMemory@8: + mov ecx,dword [esp + 8 ] // Length + cmp ecx,0// if (Length==0) goto .zero + je 3f + + pushad // Save all register on the stack + mov edi, dword [esp + (4 + 32)] // Destination + xor eax,eax // ZeroFillByte = 0 + +// code for take four byte each time it loop + mov ebx,ecx // temp_Length = Length + shr ecx,2// Length = Length / sizeof(ULONG) + jz 1f // if (Length==0) goto .1byte + + shl ecx,2// Length = Length * sizeof(ULONG) + sub ebx,ecx // temp_Length = temp_Length - Length// + jz 2f // if (temp_Length==0) goto .4byte + +// move 4byte and 1byte + shr ecx,2// Length = Length / sizeof(ULONG) + cld // clear d flag + rep stosd// while (Length!=0) { (ULONG *) Destination[Length-1]=ZeroFillByte// Legnth = Legnth - 1 } + mov ecx,ebx // Length = temp_Length + rep stosb// while (Length!=0) { (UCHAR *) Destination[Length-1]=ZeroFillByte// Legnth = Legnth - 1 } + popad // restore register + ret 8 // return + +// move 1byte +1: + mov ecx,dword [esp + (12 +32) ] // Length + cld // clear d flag + rep stosb// while (Length!=0) { (UCHAR *) Destination[Length-1]=ZeroFillByte// Legnth = Legnth - 1 } + popad // restore register + ret 8 // return + +// move 4bytes +2: + shr ecx,2// Length = Length / sizeof(ULONG) + cld // clear d flag + rep stosd// while (Length!=0) { (ULONG *) Destination[Length-1]=ZeroFillByte// Legnth = Legnth - 1 } + popad // restore register +3: + ret 8 // return + +_RtlFillMemoryUlong@12: + mov ecx, dword [esp + 8 ] // Length + shr ecx,2// Length = Length / sizeof(ULONG) + jz 1f // if (Length==0) goto .zero + + push edi + mov edi, dword [esp + (4 + 4)] // Destination + mov eax, dword [esp + (12 + 4)] // Fill + cld + rep stosd// while (Length>0) {Destination[Length-1]=Fill// Length = Length - 1} + pop edi +1: + ret 12 + +_RtlFillMemory@12: + mov ecx,dword [esp + 8 ] // ecx = Length + cmp ecx,0// if (Length==0) goto .zero + je 2f + + mov edx, dword [esp + 4] // edx = Destination + mov eax, dword [esp + 12] // eax = fill +1: + mov byte [edx + ecx -1],al // src[Length - 1] = fill + dec ecx // Length = Length - 1 + jnz 1b // if (Length!=0) goto .loop +2: + ret 12 // return + +_RtlCompareMemoryUlong@12: + xor eax,eax + mov ecx, dword [esp + 8 ] // ecx = Length + shr ecx,2 // Length / sizeof(ULONG) + jz 1f // if (Length==0) goto .zero + + push edi// register that does not to be save eax,ecx,edx to + push ebx// the stack for protetion + + mov edi, dword [esp + (4 + 8)] // edx = Destination + mov eax, dword [esp + (12 + 8)] // ebx = value + mov ebx,ecx + cld + repe scasd + + inc ecx + mov eax,ebx + + sub eax,ecx + shl eax,2 + + pop ebx + pop edi + +1: + ret 12 + +_RtlCompareMemory@12: + xor eax,eax // count = 0 + mov ecx, dword [esp + 12 ] // ecx = Length + cmp ecx,0 // if (Length==0) goto .zero + je 3f + + push edi// register that does not to be save eax,ecx,edx to + push ebx// the stack for protetion + + mov edi, dword [esp + (4 + 8)] // edi = Destination + mov edx, dword [esp + (8 + 8)] // edx = Source + +1: + mov bl,byte [edi + eax ] // if (src[count]!=des[count]) goto .pop_zero + cmp byte [edx + eax ],bl + jne 2f + + inc eax // count = count + 1 + dec ecx // Length = Length - 1 + jnz 1b // if (Length!=0) goto .loop_1byte + +2: + pop ebx // restore regiester + pop edi +3: + ret 12 // return count _____ Added: trunk/reactos/lib/rtl/i386/random.S --- trunk/reactos/lib/rtl/i386/random.S 2005-07-27 14:57:33 UTC (rev 16800) +++ trunk/reactos/lib/rtl/i386/random.S 2005-07-27 16:11:29 UTC (rev 16801) @@ -0,0 +1,245 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ranom.asm + * PURPOSE: Random number generator functions + * PROGRAMMER: Magnus Olsen (magnusolsen(a)greatlord.com) + * UPDATE HISTORY: + * Created 27/07/2005 + */ + +.intel_syntax noprefix + +/* GLOBALS ****************************************************************/ + +.globl _RtlRandom@4 // [1] (no bug) (max optimze code) +.globl _RtlUniform@4 // [2] (no bug) (max optimze code) +.globl _SavedValue // [3] (no bug) (max optimze code) + +/* FUNCTIONS ***************************************************************/ + +_RtlRandom@4: + // load pointer + mov ecx,[esp+4] + mov eax,[ecx] + + // Result = *Seed * 0xffffffed + 0x7fffffc3 // take now 3 cycles + lea edx,[eax + eax * 8] + + lea eax,[eax + edx * 2 + 2147483709 ] // + 2147483709 + neg eax + + cmp eax,-1 + je .RtlRandom_Rand1 + cmp eax, 2147483646 + je .RtlRandom_Rand1 + + cmp eax, 2147483647 + je .RtlRandom_Rand2 + + test eax,eax + jns .RtlRandom_Rand3 + + // else { + mov edx,eax + and edx,1 + add eax,edx + and eax,2147483647 + mov [ecx],eax + jmp .RtlRandom_Seed + +.RtlRandom_Rand1: + // if (Result == 0xffffffff || Result == 0x7ffffffe) + add eax, 2 + and eax, 2147483647 + mov [ecx],eax + jmp .RtlRandom_Seed + +.RtlRandom_Rand2: + // else if (Result == 0x7fffffff) + xor eax,eax + mov [ecx],eax + jmp .RtlRandom_Seed + +.RtlRandom_Rand3: + // else if ((Result & 0x80000000) == 0) + mov edx,eax + xor edx,-1 // not edx lock all clock until it finsish, but xor does not do that + and edx,1 + add eax,edx + mov [ecx],eax + +.RtlRandom_Seed: + mov eax,[ecx] + + // Result = *Seed * 0xffffffed + 0x7fffffc3 // take now 3 cycles + lea edx,[eax + eax * 8] + + lea eax,[eax + edx * 2 + 2147483709 ] // + 2147483709 09-18 + neg eax + + cmp eax,-1 + je .RtlRandom_Seed1 + cmp eax, 2147483646 + je .RtlRandom_Seed1 + + cmp eax, 2147483647 + je .RtlRandom_Seed2 + + test eax,eax + jns .RtlRandom_Seed3 + + // else { + mov edx,eax + and edx,1 + add eax,edx + and eax,2147483647 + + // end + mov edx,[ecx] + mov [ecx],eax + + mov ecx,eax // pos + and ecx, 0x7f // pos = seed & 0x7f + mov eax,ecx// + mov eax, dword [_SavedValue + ecx*4] + mov dword [_SavedValue + ecx*4], edx + ret 4 + +.RtlRandom_Seed1: + // if (Result == 0xffffffff || Result == 0x7ffffffe) + add eax, 2 + and eax, 2147483647 + + // end + mov edx,[ecx] + mov [ecx],eax + + mov ecx,eax // pos + and ecx, 0x7f // pos = seed & 0x7f + mov eax,ecx// + mov eax, dword [_SavedValue + ecx*4] + mov dword [_SavedValue + ecx*4], edx + ret 4 + +.RtlRandom_Seed2: + // else if (Result == 0x7fffffff) + xor eax,eax + + // end + mov edx,[ecx] + mov [ecx],eax + + mov ecx,eax // pos + and ecx, 0x7f // pos = seed & 0x7f + mov eax,ecx// + mov eax, dword [_SavedValue + ecx*4] + mov dword [_SavedValue + ecx*4], edx + ret 4 + +.RtlRandom_Seed3: + // else if ((Result & 0x80000000) == 0) + mov edx,eax + xor edx,-1 // not edx lock all clock until it finsish, but xor does not do that + and edx,1 + add eax,edx + + // end + mov edx,[ecx] + mov [ecx],eax + + mov ecx,eax // pos + and ecx, 0x7f // pos = seed & 0x7f + mov eax,ecx// + mov eax, dword [_SavedValue + ecx*4] [truncated at 1000 lines; 157 more skipped]
19 years, 6 months
1
0
0
0
[fireball] 16800: Timer modifications, turning on debug messages, implementing more functions (but spinlocks are disabled now).
by fireball@svn.reactos.com
Timer modifications, turning on debug messages, implementing more functions (but spinlocks are disabled now). Now it detects attached device(s) and show info in debug messages. Modified: trunk/reactos/drivers/usb/cromwell/core/hcd.c Modified: trunk/reactos/drivers/usb/cromwell/core/hub.c Modified: trunk/reactos/drivers/usb/cromwell/core/message.c Modified: trunk/reactos/drivers/usb/cromwell/core/urb.c Modified: trunk/reactos/drivers/usb/cromwell/core/usb.c Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.c Modified: trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h Modified: trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c _____ Modified: trunk/reactos/drivers/usb/cromwell/core/hcd.c --- trunk/reactos/drivers/usb/cromwell/core/hcd.c 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/core/hcd.c 2005-07-27 14:57:33 UTC (rev 16800) @@ -100,7 +100,7 @@ EXPORT_SYMBOL_GPL (usb_bus_list_lock); /* used when updating hcd data */ -static spinlock_t hcd_data_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t hcd_data_lock;// = SPIN_LOCK_UNLOCKED; /*---------------------------------------------------------------------- ---*/ @@ -476,7 +476,7 @@ hcd->rh_timer.function = rh_report_status; hcd->rh_timer.data = (unsigned long) urb; /* USB 2.0 spec says 256msec; this is close enough */ - hcd->rh_timer.expires = jiffies + HZ/4; + hcd->rh_timer.expires = HZ/4; add_timer (&hcd->rh_timer); urb->hcpriv = hcd; /* nonzero to indicate it's queued */ return 0; @@ -515,7 +515,7 @@ urb->status = 0; urb->hcpriv = 0; } else - mod_timer (&hcd->rh_timer, jiffies + HZ/4); + mod_timer (&hcd->rh_timer, HZ/4); spin_unlock (&hcd_data_lock); spin_unlock (&urb->lock); @@ -982,7 +982,7 @@ if (!hcd || !dev) return -ENODEV; -// printk("submit_urb %p, # %i, t %i\n",urb,urb->dev->devnum,usb_pipetype(urb->pipe)); + printk("submit_urb %p, # %i, t %i\n",urb,urb->dev->devnum,usb_pipetype(urb->pipe)); /* * FIXME: make urb timeouts be generic, keeping the HCD cores * as simple as possible. @@ -1053,10 +1053,12 @@ status = hcd->driver->urb_enqueue (hcd, urb, mem_flags); done: + if (status) { usb_put_urb (urb); urb_unlink (urb); } + return status; } _____ Modified: trunk/reactos/drivers/usb/cromwell/core/hub.c --- trunk/reactos/drivers/usb/cromwell/core/hub.c 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/core/hub.c 2005-07-27 14:57:33 UTC (rev 16800) @@ -42,7 +42,7 @@ #endif /* Wakes up khubd */ -//static spinlock_t hub_event_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t hub_event_lock; //static DECLARE_MUTEX(usb_address0_sem); static LIST_HEAD(hub_event_list); /* List of hubs needing servicing */ @@ -141,13 +141,24 @@ case -ECONNRESET: /* async unlink */ case -ESHUTDOWN: /* hardware going away */ return; - + case -EOVERFLOW: + if (hub->RestCounter>0) { + // we already resetted one time ... + hub->error = 0; + hub->nerrors = 0; + break; + } + hub->RestCounter++; + default: /* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ + //printe("hub_irq got ...: error %d URB: %d",hub->error,urb->status); + dev_dbg (&hub->intf->dev, "transfer --> %d\n", urb->status); if ((++hub->nerrors < 10) || hub->error) goto resubmit; hub->error = urb->status; + /* FALL THROUGH */ /* let khubd handle things */ @@ -155,6 +166,7 @@ break; } + hub->nerrors = 0; /* Something happened, let khubd figure it out */ @@ -269,17 +281,40 @@ { struct usb_device *dev; int i; + int DelayPerPort; + int DelayAfterPort; + + DelayAfterPort = hub->descriptor->bPwrOn2PwrGood * 2; + DelayPerPort = 0; + + switch (hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) { + case 0x00: + DelayAfterPort = hub->descriptor->bPwrOn2PwrGood * 2; + DelayPerPort = 0; + break; + case 0x01: + DelayAfterPort = hub->descriptor->bPwrOn2PwrGood; + DelayPerPort = hub->descriptor->bPwrOn2PwrGood /4; + break; + case 0x02: + case 0x03: + //dev_dbg(hub_dev, "unknown reserved power switching mode\n"); + break; + } + /* Enable power to the ports */ dev_dbg(hubdev(interface_to_usbdev(hub->intf)), "enabling power on all ports\n"); dev = interface_to_usbdev(hub->intf); - for (i = 0; i < hub->descriptor->bNbrPorts; i++) + for (i = 0; i < hub->descriptor->bNbrPorts; i++) { set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER); + wait_ms(DelayPerPort); + } /* Wait for power to be enabled */ - wait_ms(hub->descriptor->bPwrOn2PwrGood * 2); + wait_ms(DelayAfterPort); } static int hub_hub_status(struct usb_hub *hub, @@ -435,6 +470,9 @@ (hub->descriptor->wHubCharacteristics & HUB_CHAR_PORTIND) ? "" : "not"); + if (hub->descriptor->bPwrOn2PwrGood<3) hub->descriptor->bPwrOn2PwrGood = 3; + if (hub->descriptor->bPwrOn2PwrGood>20) hub->descriptor->bPwrOn2PwrGood = 20; + dev_dbg(hub_dev, "power on to power good time: %dms\n", hub->descriptor->bPwrOn2PwrGood * 2); dev_dbg(hub_dev, "hub controller current requirement: %dmA\n", @@ -560,27 +598,31 @@ if ((desc->desc.bInterfaceSubClass != 0) && (desc->desc.bInterfaceSubClass != 1)) { descriptor_error: + desc->desc.bInterfaceSubClass =0; dev_err (&intf->dev, "bad descriptor, ignoring hub\n"); - return -EIO; + //return -EIO; } /* Multiple endpoints? What kind of mutant ninja-hub is this? */ if (desc->desc.bNumEndpoints != 1) { - goto descriptor_error; + desc->desc.bNumEndpoints = 1; + //goto descriptor_error; } endpoint = &desc->endpoint[0].desc; /* Output endpoint? Curiouser and curiouser.. */ if (!(endpoint->bEndpointAddress & USB_DIR_IN)) { - goto descriptor_error; + //goto descriptor_error; + endpoint->bEndpointAddress |= USB_DIR_IN; } /* If it's not an interrupt endpoint, we'd better punt! */ if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) { - goto descriptor_error; - return -EIO; + endpoint->bmAttributes |= USB_ENDPOINT_XFER_INT; + //goto descriptor_error; + //return -EIO; } /* We found a hub */ @@ -594,6 +636,8 @@ memset(hub, 0, sizeof(*hub)); + hub->RestCounter = 0; + INIT_LIST_HEAD(&hub->event_list); hub->intf = intf; init_MUTEX(&hub->khubd_sem); @@ -606,12 +650,13 @@ usb_set_intfdata (intf, hub); - if (hub_configure(hub, endpoint) >= 0) { + if (hub_configure(hub, endpoint) >= 0) + { strcpy (intf->dev.name, "Hub"); return 0; } - hub_disconnect (intf); + //hub_disconnect (intf); return -ENODEV; } @@ -703,6 +748,9 @@ struct usb_hub *hub = usb_get_intfdata (dev->actconfig->interface); int ret; + if (!hub) + return -ENODEV; + ret = get_port_status(dev, port + 1, &hub->status->port); if (ret < 0) { dev_err (hubdev (dev), @@ -717,9 +765,10 @@ } #define HUB_RESET_TRIES 5 -#define HUB_PROBE_TRIES 2 +#define HUB_PROBE_TRIES 5 +#define HUB_ROOT_RESET_TIME 40 #define HUB_SHORT_RESET_TIME 10 -#define HUB_LONG_RESET_TIME 200 +#define HUB_LONG_RESET_TIME 70 #define HUB_RESET_TIMEOUT 500 /* return: -1 on error, 0 on success, 1 on disconnect. */ @@ -835,8 +884,8 @@ */ #define HUB_DEBOUNCE_TIMEOUT 400 -#define HUB_DEBOUNCE_STEP 25 -#define HUB_DEBOUNCE_STABLE 4 +#define HUB_DEBOUNCE_STEP 5 +#define HUB_DEBOUNCE_STABLE 3 /* return: -1 on error, 0 on success, 1 on disconnect. */ static int hub_port_debounce(struct usb_device *hub, int port) @@ -885,7 +934,11 @@ struct usb_device *dev; unsigned int delay = HUB_SHORT_RESET_TIME; int i; - + int DevcoosenAdress = 0; + + //printe("port %d, status %x, change %x,\n",port + 1, portstatus, portchange); + + dev_dbg (&hubstate->intf->dev, "port %d, status %x, change %x, %s\n", port + 1, portstatus, portchange, portspeed (portstatus)); @@ -909,10 +962,17 @@ dev_err (&hubstate->intf->dev, "connect-debounce failed, port %d disabled\n", port+1); + //printe("connect-debounce failed, port %d disabled\n", port+1); hub_port_disable(hub, port); return; } + /* root hub ports have a slightly longer reset period + * (from USB 2.0 spec, section 7.1.7.5) + */ + if (!hub->parent) + delay = HUB_ROOT_RESET_TIME; + /* Some low speed devices have problems with the quick delay, so */ /* be a bit pessimistic with those devices. RHbug #23670 */ if (portstatus & USB_PORT_STAT_LOW_SPEED) @@ -932,7 +992,7 @@ break; } - hub->children[port] = dev; + dev->state = USB_STATE_POWERED; /* Reset the device, and detect its speed */ @@ -942,8 +1002,12 @@ } /* Find a new address for it */ - usb_connect(dev); - + if (DevcoosenAdress==0) { + usb_choose_address(dev); + DevcoosenAdress = dev->devnum; + } + dev->devnum = DevcoosenAdress ; + /* Set up TT records, if needed */ if (hub->tt) { dev->tt = hub->tt; @@ -985,8 +1049,10 @@ dev->dev.parent = dev->parent->dev.parent->parent; /* Run it through the hoops (find a driver, etc) */ - if (!usb_new_device(dev, &hub->dev)) + if (!usb_new_device(dev, &hub->dev)) { + hub->children[port] = dev; goto done; + } /* Free the configuration if there was an error */ usb_put_dev(dev); @@ -995,7 +1061,7 @@ delay = HUB_LONG_RESET_TIME; } - hub->children[port] = NULL; + hub_port_disable(hub, port); done: up(&usb_address0_sem); @@ -1149,34 +1215,39 @@ daemonize("khubd"); allow_signal(SIGKILL); + + // Initialize khubd spinlock + KeInitializeSpinLock((PKSPIN_LOCK)&hub_event_lock); + /* Send me a signal to get me die (for debugging) */ do { + LARGE_INTEGER delay; /* The following is just for debug */ inc_jiffies(1); do_all_timers(); handle_irqs(-1); /* End of debug hack*/ - hub_events(); - /* The following is just for debug */ handle_irqs(-1); /* End of debug hack*/ - //FIXME: Correct this //wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list)); // interruptable_sleep_on analog - below //while (!list_empty(&hub_event_list)) { // interruptible_sleep_on(&khubd_wait); //} + delay.QuadPart = -10000*100; // convert to 100ns units + KeDelayExecutionThread(KernelMode, FALSE, &delay); //wait_us(1); + if (current->flags & PF_FREEZE) refrigerator(PF_IOTHREAD); } while (!signal_pending(current)); -// dbg("hub_thread exiting"); + dbg("hub_thread exiting"); complete_and_exit(&khubd_exited, 0); } @@ -1361,20 +1432,24 @@ return 1; } - dev->actconfig = dev->config; - usb_set_maxpacket(dev); + usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue); + return 1; } kfree(descriptor); - ret = usb_set_configuration(dev, dev->actconfig->desc.bConfigurationValue); + ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), + USB_REQ_SET_CONFIGURATION, 0, + dev->actconfig->desc.bConfigurationValue, 0, + NULL, 0, HZ * USB_CTRL_SET_TIMEOUT); if (ret < 0) { err("failed to set dev %s active configuration (error=%d)", dev->devpath, ret); return ret; } + dev->state = USB_STATE_CONFIGURED; for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { struct usb_interface *intf = &dev->actconfig->interface[i]; _____ Modified: trunk/reactos/drivers/usb/cromwell/core/message.c --- trunk/reactos/drivers/usb/cromwell/core/message.c 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/core/message.c 2005-07-27 14:57:33 UTC (rev 16800) @@ -40,6 +40,8 @@ struct usb_api_data awd; int status; + printk("usb_start_wait_urb(): urb devnum=%d, timeout=%d, urb->actual_length=%d\n", urb->dev->devnum, timeout, urb->actual_length); + init_waitqueue_head((PKEVENT)&awd.wqh); awd.done = 0; @@ -48,6 +50,7 @@ urb->context = &awd; status = usb_submit_urb(urb, GFP_ATOMIC); + if (status) { // something went wrong usb_free_urb(urb); @@ -55,7 +58,7 @@ remove_wait_queue(&awd.wqh, &wait); return status; } - + printk("TRACE 3.1, timeout=%d, awd.done=%d\n", timeout, awd.done); while (timeout && !awd.done) { timeout = schedule_timeout(timeout); @@ -84,6 +87,7 @@ *actual_length = urb->actual_length; usb_free_urb(urb); + return status; } @@ -152,12 +156,10 @@ dr->wIndex = cpu_to_le16p(&index); dr->wLength = cpu_to_le16p(&size); - //dbg("usb_control_msg"); + printk("usb_control_msg: devnum=%d, size=%d, timeout=%d\n", dev->devnum, size, timeout); ret = usb_internal_control_msg(dev, pipe, dr, data, size, timeout); - kfree(dr); - return ret; } _____ Modified: trunk/reactos/drivers/usb/cromwell/core/urb.c --- trunk/reactos/drivers/usb/cromwell/core/urb.c 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/core/urb.c 2005-07-27 14:57:33 UTC (rev 16800) @@ -201,8 +201,8 @@ struct usb_device *dev; struct usb_operations *op; int is_out; -// printk("sub dev %p bus %p num %i op %p sub %p\n", -// urb->dev, urb->dev->bus,urb->dev->devnum,urb->dev->bus->op, urb->dev->bus->op->submit_urb); + printk("sub dev %p bus %p num %i op %p sub %p\n", + urb->dev, urb->dev->bus,urb->dev->devnum,urb->dev->bus->op, urb->dev->bus->op->submit_urb); if (!urb || urb->hcpriv || !urb->complete) return -EINVAL; if (!(dev = urb->dev) || _____ Modified: trunk/reactos/drivers/usb/cromwell/core/usb.c --- trunk/reactos/drivers/usb/cromwell/core/usb.c 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/core/usb.c 2005-07-27 14:57:33 UTC (rev 16800) @@ -54,6 +54,7 @@ #include "hcd.h" #endif +#define DEBUG extern int usb_hub_init(void); extern void usb_hub_cleanup(void); @@ -95,6 +96,9 @@ if (!driver->probe) return error; + /* driver claim() doesn't yet affect dev->driver... */ + if (intf->driver) + return error; id = usb_match_id (intf, driver->id_table); if (id) { @@ -396,6 +400,14 @@ { struct usb_host_interface *intf; struct usb_device *dev; + struct usb_device_id *save_id; + int firsttime; + + firsttime = 1; + + save_id = (struct usb_device_id*)id; +retry_id: + id = (struct usb_device_id*)save_id; /* proc_connectinfo in devio.c may call us with id == NULL. */ if (id == NULL) @@ -967,7 +979,36 @@ } } +/** + * usb_choose_address - pick device address (usbcore-internal) + * @dev: newly detected device (in DEFAULT state) + * + * Picks a device address. It's up to the hub (or root hub) driver + * to handle and manage enumeration, starting from the DEFAULT state. + * Only hub drivers (but not virtual root hub drivers for host + * controllers) should ever call this. + */ +void usb_choose_address(struct usb_device *dev) +{ + int devnum; + // FIXME needs locking for SMP!! + /* why? this is called only from the hub thread, + * which hopefully doesn't run on multiple CPU's simultaneously 8-) + */ + /* Try to allocate the next devnum beginning at bus->devnum_next. */ + devnum = find_next_zero_bit(dev->bus->devmap.devicemap, 128, dev->bus->devnum_next); + if (devnum >= 128) + devnum = find_next_zero_bit(dev->bus->devmap.devicemap, 128, 1); + + dev->bus->devnum_next = ( devnum >= 127 ? 1 : devnum + 1); + + if (devnum < 128) { + set_bit(devnum, dev->bus->devmap.devicemap); + dev->devnum = devnum; + } +} + // hub-only!! ... and only exported for reset/reinit path. // otherwise used internally, for usb_new_device() int usb_set_address(struct usb_device *dev) @@ -1062,10 +1103,10 @@ * controllers) should ever call this. */ #define NEW_DEVICE_RETRYS 2 -#define SET_ADDRESS_RETRYS 2 +#define SET_ADDRESS_RETRYS 20 int usb_new_device(struct usb_device *dev, struct device *parent) { - int err = 0; + int err = -EINVAL; int i; int j; @@ -1108,7 +1149,7 @@ i = 8; break; default: - return -EINVAL; + goto fail; } dev->epmaxpacketin [0] = i; dev->epmaxpacketout[0] = i; @@ -1119,15 +1160,12 @@ err = usb_set_address(dev); if (err >= 0) break; - wait_ms(200); + wait_ms(5); } if (err < 0) { dev_err(&dev->dev, "USB device not accepting new address=%d (error=%d)\n", dev->devnum, err); - dev->state = USB_STATE_DEFAULT; - clear_bit(dev->devnum, dev->bus->devmap.devicemap); - dev->devnum = -1; - return 1; + goto fail; } wait_ms(10); /* Let the SET_ADDRESS settle */ @@ -1140,17 +1178,13 @@ } if (err < 8) { - if (err < 0) { - dev_err(&dev->dev, "USB device not responding, giving up (error=%d)\n", err); - } - else { - dev_err(&dev->dev, "USB device descriptor short read (expected %i, got %i)\n", 8, err); - } - clear_bit(dev->devnum, dev->bus->devmap.devicemap); - dev->devnum = -1; - return 1; + dev_err(&dev->dev, "device descriptor read/8, error %d\n", err); + goto fail; } if (dev->speed == USB_SPEED_FULL) { + //usb_disable_endpoint(dev, 0); + usb_endpoint_running(dev, 0, 1); + usb_endpoint_running(dev, 0, 0); dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0; dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0; } @@ -1159,26 +1193,15 @@ err = usb_get_device_descriptor(dev); if (err < (signed)sizeof(dev->descriptor)) { - if (err < 0) { - dev_err(&dev->dev, "unable to get device descriptor (error=%d)\n", err); - } - else { - dev_err(&dev->dev, "USB device descriptor short read (expected %Zi, got %i)\n", - sizeof(dev->descriptor), err); - } - - clear_bit(dev->devnum, dev->bus->devmap.devicemap); - dev->devnum = -1; - return 1; + dev_err(&dev->dev, "device descriptor read/all, error %d\n", err); + goto fail; } err = usb_get_configuration(dev); if (err < 0) { - dev_err(&dev->dev, "unable to get device %d configuration (error=%d)\n", - dev->devnum, err); - clear_bit(dev->devnum, dev->bus->devmap.devicemap); - dev->devnum = -1; - return 1; + dev_err(&dev->dev, "can't read configurations, error %d\n", + err); + goto fail; } /* we set the default configuration here */ @@ -1186,9 +1209,7 @@ if (err) { dev_err(&dev->dev, "failed to set device %d default configuration (error=%d)\n", dev->devnum, err); - clear_bit(dev->devnum, dev->bus->devmap.devicemap); - dev->devnum = -1; - return 1; + goto fail; } /* USB device state == configured ... tell the world! */ @@ -1234,7 +1255,7 @@ "usb-%s-%s interface %d", dev->bus->bus_name, dev->devpath, desc->bInterfaceNumber); - DPRINT1("usb_new_device: %s\n", interface->dev.name); + DPRINT1(".........................usb_new_device: %s\n", interface->dev.name); } dev_dbg (&dev->dev, "%s - registering interface %s\n", __FUNCTION__, interface->dev.bus_id); device_add (&interface->dev); @@ -1244,6 +1265,11 @@ usbfs_add_device(dev); return 0; +fail: + dev->state = USB_STATE_DEFAULT; + clear_bit(dev->devnum, dev->bus->devmap.devicemap); + dev->devnum = -1; + return err; } /** _____ Modified: trunk/reactos/drivers/usb/cromwell/host/ohci_main.c --- trunk/reactos/drivers/usb/cromwell/host/ohci_main.c 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/host/ohci_main.c 2005-07-27 14:57:33 UTC (rev 16800) @@ -125,6 +125,27 @@ ohci_hcd_pci_cleanup(); } +void RegisterISR(PDEVICE_OBJECT DeviceObject) +{ +#if 0 + NTSTATUS Status; + POHCI_DEVICE_EXTENSION DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + /* Connect interrupt and enable them */ + Status = IoConnectInterrupt( + &DeviceExtension->InterruptObject, SerialInterruptService, + DeviceObject, NULL, + Vector, Dirql, Dirql, + InterruptMode, ShareInterrupt, + Affinity, FALSE); + if (!NT_SUCCESS(Status)) + { + DPRINT("hci: IoConnectInterrupt() failed with status 0x%08x\n", Status); + return 1; + } +#endif +} + NTSTATUS InitLinuxWrapper(PDEVICE_OBJECT DeviceObject) { @@ -154,6 +175,9 @@ // Probe device with real id now ohci_pci_driver.probe(dev, pci_ids); + // Register interrupt here + RegisterISR(DeviceObject); + DPRINT1("InitLinuxWrapper() done\n"); return STATUS_SUCCESS; @@ -169,6 +193,9 @@ POHCI_DEVICE_EXTENSION DeviceExtension; PCM_RESOURCE_LIST AllocatedResources; + NTSTATUS Status; // debug + LONGLONG delay; // debug + /* * Get the initialization data we saved in VideoPortInitialize. */ @@ -236,7 +263,13 @@ /* * Init wrapper with this object */ - return InitLinuxWrapper(DeviceObject); + //return InitLinuxWrapper(DeviceObject); + Status = InitLinuxWrapper(DeviceObject); + + delay = -10000000*60*2; // wait 2 minutes + KeDelayExecutionThread(KernelMode, FALSE, (LARGE_INTEGER *)&delay); //wait_us(1); + + return Status; } // Dispatch PNP _____ Modified: trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h --- trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h 2005-07-27 14:57:33 UTC (rev 16800) @@ -34,7 +34,12 @@ typedef u32 dma_addr_t; -typedef int spinlock_t; +typedef struct +{ + KSPIN_LOCK SpinLock; + KIRQL OldIrql; +} spinlock_t; + typedef int atomic_t; #ifndef STANDALONE #ifndef _MODE_T_ @@ -156,7 +161,8 @@ }; struct completion { unsigned int done; - wait_queue_head_t wait; + KEVENT wait; + //wait_queue_head_t wait; }; // windows lookaside list head @@ -383,13 +389,20 @@ #define init_MUTEX(x) #define SPIN_LOCK_UNLOCKED 0 -#define spin_lock_init(a) do {} while(0) -#define spin_lock(a) *(int*)a=1 -#define spin_unlock(a) do {} while(0) -#define spin_lock_irqsave(a,b) b=0 -#define spin_unlock_irqrestore(a,b) +#define spin_lock_init(a) my_spin_lock_init(a) +void my_spin_lock_init(spinlock_t *sl); +#define spin_lock(a) my_spin_lock(a) +void my_spin_lock(spinlock_t *sl); + +#define spin_unlock(a) my_spin_unlock(a) +void my_spin_unlock(spinlock_t *sl); + +#define spin_lock_irqsave(a,b) my_spin_lock_irqsave(a,b) +void my_spin_lock_irqsave(spinlock_t *sl, int flags); +#define spin_unlock_irqrestore(a,b) my_spin_unlock(a) + #if 0 #define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory") #define local_irq_restore(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory", "cc") @@ -526,12 +539,15 @@ VOID KeMemoryBarrier(VOID); #define mb() KeMemoryBarrier() -#define wmb() __asm__ __volatile__ ("": : :"memory") -#define rmb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory") +#define wmb() do {} while (0) +#define rmb() do {} while (0) +/*#define wmb() __asm__ __volatile__ ("": : :"memory") +#define rmb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")*/ #define in_interrupt() 0 -#define init_completion(x) (x)->done=0 +#define init_completion(x) my_init_completion(x) +void my_init_completion(struct completion *); #define wait_for_completion(x) my_wait_for_completion(x) void my_wait_for_completion(struct completion*); @@ -790,9 +806,10 @@ // cannot be mapped via macro due to collision with urb->complete static void __inline__ complete(struct completion *p) { + printk("completing event 0x%08x\n", (ULONG)p); /* Wake up x->wait */ p->done++; - wake_up((PKEVENT)&p->wait); + wake_up((PKEVENT)&p->wait); } #define kernel_thread(a,b,c) my_kernel_thread(a,b,c) @@ -832,7 +849,5 @@ void init_wrapper(struct pci_dev *pci_dev); void do_all_timers(void); -#define __KERNEL_DS 0x18 - int my_pci_write_config_word(struct pci_dev *, int, u16); _____ Modified: trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c --- trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c 2005-07-27 13:18:11 UTC (rev 16799) +++ trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c 2005-07-27 14:57:33 UTC (rev 16800) @@ -242,56 +242,65 @@ int my_schedule_timeout(int x) { LONGLONG HH; - LONGLONG temp; - LONGLONG delay; - extern unsigned int LAST_USB_EVENT_TICK; + //LONGLONG temp; + LARGE_INTEGER delay; + //PULONG tmp_debug=NULL; + //extern unsigned int LAST_USB_EVENT_TICK; + //*tmp_debug = 0xFFAAFFAA; + printk("schedule_timeout: %d ms\n", x); + //delay.QuadPart = -x*10000; // convert to 100ns units + //KeDelayExecutionThread(KernelMode, FALSE, &delay); //wait_us(1); + + /* x+=5; // safety x = x*1000; // to us format + */ + x = 300; // it's enough for most purposes while(x>0) { KeQueryTickCount((LARGE_INTEGER *)&HH);//IoInputDword(0x8008); - temp = HH - LAST_USB_EVENT_TICK; + //temp = HH - LAST_USB_EVENT_TICK; //if (temp>(3579)) { //3579 = 1ms! - if (temp>1000) { + //if (temp>1000) { do_all_timers(); - LAST_USB_EVENT_TICK = HH; - } + // LAST_USB_EVENT_TICK = HH; + //} - //if (LAST_USB_IRQ != OHCI_1_INTERRUPT ) { - // LAST_USB_IRQ = OHCI_1_INTERRUPT; - handle_irqs(-1); - //} + handle_irqs(-1); if (need_wakeup) break; - delay = 10; - KeDelayExecutionThread(KernelMode, FALSE, (LARGE_INTEGER *)&delay); //wait_us(1); + delay.QuadPart = -10; + KeDelayExecutionThread(KernelMode, FALSE, &delay); //wait_us(1); x-=1; + //DPRINT("schedule_timeout(): time left: %d\n", x); } need_wakeup=0; + printk("schedule DONE!!!!!!\n"); - return x; + return 0;//x; } /*---------------------------------------------------------------------- --*/ void my_wait_for_completion(struct completion *x) { LONGLONG HH; LONGLONG temp; - LONGLONG delay; + LARGE_INTEGER delay; + extern unsigned int LAST_USB_EVENT_TICK; - printk("wait for completion\n"); + printk("wait for completion11, x=0x%08x\n", (DWORD)x); int n=10; n = n*1000; // to us format - + while(!x->done && (n>0)) { KeQueryTickCount((LARGE_INTEGER *)&HH);//IoInputDword(0x8008); @@ -299,23 +308,26 @@ //if (temp>(3579)) { if (temp>(1000)) { - do_all_timers(); + // do_all_timers(); LAST_USB_EVENT_TICK = HH; } - //if (LAST_USB_IRQ != OHCI_1_INTERRUPT ) { - // LAST_USB_IRQ = OHCI_1_INTERRUPT; - handle_irqs(-1); - //} + // handle_irqs(-1); - delay = 10; - KeDelayExecutionThread(KernelMode, FALSE, (LARGE_INTEGER *)&delay); //wait_us(1); + delay.QuadPart = -10; + KeDelayExecutionThread(KernelMode, FALSE, &delay); //wait_us(1); n--; } printk("wait for completion done %i\n",x->done); } /*---------------------------------------------------------------------- --*/ +void my_init_completion(struct completion *x) +{ + x->done=0; + KeInitializeEvent(&x->wait, NotificationEvent, FALSE); +} +/*--------------------------------------------------------------------- ---*/ void my_interruptible_sleep_on(PKEVENT evnt) { KeWaitForSingleObject(evnt, Executive, KernelMode, FALSE, NULL); @@ -364,6 +376,7 @@ num_irqs++; return 0; } + return 1; } /*---------------------------------------------------------------------- --*/ @@ -609,8 +622,8 @@ return 0; retval = ExAllocatePool(NonPagedPool, sizeof(struct pci_pool)); // Non-paged because could be - // pci_pool is rather big struct - + // accesses at IRQL < PASSIVE + // fill retval structure strncpy (retval->name, name, sizeof retval->name); retval->name[sizeof retval->name - 1] = 0; @@ -623,7 +636,7 @@ retval->pages_allocated = 0; retval->blocks_allocated = 0; - DPRINT1("pci_pool_create(): %s/%s size %d, %d/page (%d alloc)\n", + DPRINT("pci_pool_create(): %s/%s size %d, %d/page (%d alloc)\n", pdev ? pdev->slot_name : NULL, retval->name, size, retval->blocks_per_page, allocation); @@ -652,11 +665,12 @@ { PVOID result; POHCI_DEVICE_EXTENSION devExt = (POHCI_DEVICE_EXTENSION)pool->pdev->dev_ext; - //PHYSICAL_ADDRESS logicalAddr; - DPRINT1("pci_pool_alloc() called, blocks already allocated=%d\n", pool->blocks_allocated); - //size_t current_block_in_page; - int page,map,i,block,offset; + int page=0, offset; + int map, i, block; + //DPRINT1("pci_pool_alloc() called, blocks already allocated=%d, dma_handle=%p\n", pool->blocks_allocated, dma_handle); + //ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); + if (pool->pages_allocated == 0) { // we need to allocate at least one page @@ -665,7 +679,7 @@ PAGE_SIZE, &pool->pages[pool->pages_allocated].dmaAddress, FALSE); //FIXME: Cache-enabled? // mark all blocks as free (bit=set) - memset(pool->pages[pool->pages_allocated].bitmap, 0xFF, 128*sizeof(long)); + memset(pool->pages[pool->pages_allocated].bitmap, 0xFF, 128*sizeof(unsigned long)); /* FIXME: the next line replaces physical address by virtual address: * this change is needed to boot VMWare, but I'm really not sure this [truncated at 1000 lines; 69 more skipped]
19 years, 6 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
57
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Results per page:
10
25
50
100
200