[haiku-commits] r34237 - in haiku/trunk/src: system/kernel tools/gensyscalls

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 25 Nov 2009 12:48:39 +0100 (CET)

Author: axeld
Date: 2009-11-25 12:48:39 +0100 (Wed, 25 Nov 2009)
New Revision: 34237
Changeset: http://dev.haiku-os.org/changeset/34237/haiku

Modified:
   haiku/trunk/src/system/kernel/syscalls.cpp
   haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp
Log:
* Cleanup, no functional change.


Modified: haiku/trunk/src/system/kernel/syscalls.cpp
===================================================================
--- haiku/trunk/src/system/kernel/syscalls.cpp  2009-11-25 11:07:49 UTC (rev 
34236)
+++ haiku/trunk/src/system/kernel/syscalls.cpp  2009-11-25 11:48:39 UTC (rev 
34237)
@@ -74,10 +74,10 @@
 #endif
 
 
-static generic_syscall *
-find_generic_syscall(const char *subsystem)
+static generic_syscall*
+find_generic_syscall(const char* subsystem)
 {
-       generic_syscall *syscall = NULL;
+       generic_syscall* syscall = NULL;
 
        ASSERT_LOCKED_MUTEX(&sGenericSyscallLock);
 
@@ -98,8 +98,8 @@
        All other return codes are depending on the generic syscall 
implementation.
 */
 static inline status_t
-_user_generic_syscall(const char *userSubsystem, uint32 function,
-       void *buffer, size_t bufferSize)
+_user_generic_syscall(const char* userSubsystem, uint32 function,
+       void* buffer, size_t bufferSize)
 {
        char subsystem[B_FILE_NAME_LENGTH];
 
@@ -138,7 +138,7 @@
        }
 
        while (syscall != NULL) {
-               generic_syscall *next;
+               generic_syscall* next;
 
                syscall->use_count++;
                locker.Unlock();
@@ -185,28 +185,28 @@
 
 
 int32
-syscall_dispatcher(uint32 call_num, void *args, uint64 *call_ret)
+syscall_dispatcher(uint32 callIndex, void* args, uint64* _returnValue)
 {
        bigtime_t startTime;
 
 //     dprintf("syscall_dispatcher: thread 0x%x call 0x%x, arg0 0x%x, arg1 
0x%x arg2 0x%x arg3 0x%x arg4 0x%x\n",
 //             thread_get_current_thread_id(), call_num, arg0, arg1, arg2, 
arg3, arg4);
 
-       user_debug_pre_syscall(call_num, args);
+       user_debug_pre_syscall(callIndex, args);
 
        startTime = system_time();
 
-       switch (call_num) {
+       switch (callIndex) {
                // the cases are auto-generated
                #include "syscall_dispatcher.h"
 
                default:
-                       *call_ret = (uint64)B_BAD_VALUE;
+                       *_returnValue = (uint64)B_BAD_VALUE;
        }
 
-       user_debug_post_syscall(call_num, args, *call_ret, startTime);
+       user_debug_post_syscall(callIndex, args, *_returnValue, startTime);
 
-//     dprintf("syscall_dispatcher: done with syscall 0x%x\n", call_num);
+//     dprintf("syscall_dispatcher: done with syscall 0x%x\n", callIndex);
 
        return B_HANDLED_INTERRUPT;
 }
@@ -236,7 +236,7 @@
 
 
 status_t
-register_generic_syscall(const char *subsystem, syscall_hook hook,
+register_generic_syscall(const char* subsystem, syscall_hook hook,
        uint32 version, uint32 flags)
 {
        if (hook == NULL)
@@ -275,7 +275,7 @@
 
 
 status_t
-unregister_generic_syscall(const char *subsystem, uint32 version)
+unregister_generic_syscall(const char* subsystem, uint32 version)
 {
        // TODO: we should only remove the syscall with the matching version
 

Modified: haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp
===================================================================
--- haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp   2009-11-25 11:07:49 UTC 
(rev 34236)
+++ haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp   2009-11-25 11:48:39 UTC 
(rev 34237)
@@ -3,10 +3,13 @@
  * Distributed under the terms of the MIT License.
  */
 
+
 // Don't include arch_gensyscalls.h. It's only needed when creating the
 // syscall vector.
 #define DONT_INCLUDE_ARCH_GENSYSCALLS_H 1
 
+#include "gensyscalls.h"
+
 #include <cstdio>
 #include <cstdlib>
 #include <fstream>
@@ -14,7 +17,6 @@
 #include <string.h>
 #include <vector>
 
-#include "gensyscalls.h"
 #include "gensyscalls_common.h"
 
 using std::vector;
@@ -49,47 +51,50 @@
 }
 
 
-// Type
+// #pragma mark - Type
 
-// constructor
+
 Type::Type(const char* name, int size, int usedSize,
        const char* alignmentTypeName)
-       : fName(name),
-         fSize(size),
-         fUsedSize(usedSize),
-         fAlignmentType(alignmentTypeName)
+       :
+       fName(name),
+       fSize(size),
+       fUsedSize(usedSize),
+       fAlignmentType(alignmentTypeName)
 {
 }
 
 
-// Parameter
+// #pragma mark - Parameter
 
-// constructor
+
 Parameter::Parameter(const char* typeName, const char* parameterName,
        int size, int usedSize, int offset, const char* alignmentTypeName)
-       : Type(typeName, size, usedSize, alignmentTypeName),
-         fParameterName(parameterName),
-         fOffset(offset)
+       :
+       Type(typeName, size, usedSize, alignmentTypeName),
+       fParameterName(parameterName),
+       fOffset(offset)
 {
 }
 
 
-// Syscall
+// #pragma mark - Syscall
 
-// ParameterVector
+
 struct Syscall::ParameterVector : public vector<Parameter*> {
 };
 
-// constructor
+
 Syscall::Syscall(const char* name, const char* kernelName)
-       : fName(name),
-         fKernelName(kernelName),
-         fReturnType(NULL),
-         fParameters(new ParameterVector)
+       :
+       fName(name),
+       fKernelName(kernelName),
+       fReturnType(NULL),
+       fParameters(new ParameterVector)
 {
 }
 
-// destructor
+
 Syscall::~Syscall()
 {
        delete fReturnType;
@@ -100,14 +105,14 @@
        delete fParameters;
 }
 
-// ParameterAt
+
 int
 Syscall::CountParameters() const
 {
        return fParameters->size();
 }
 
-// ParameterAt
+
 Parameter*
 Syscall::ParameterAt(int index) const
 {
@@ -117,14 +122,14 @@
        return (*fParameters)[index];
 }
 
-// LastParameter
+
 Parameter*
 Syscall::LastParameter() const
 {
        return ParameterAt(CountParameters() - 1);
 }
 
-// SetReturnType
+
 Type*
 Syscall::SetReturnType(const char* name, int size, int usedSize,
        const char* alignmentTypeName)
@@ -133,7 +138,7 @@
        return fReturnType = new Type(name, size, usedSize, alignmentTypeName);
 }
 
-// AddParameter
+
 Parameter*
 Syscall::AddParameter(const char* typeName, const char* parameterName,
        int size, int usedSize, int offset, const char* alignmentTypeName)
@@ -145,19 +150,21 @@
 }
 
 
-// SyscallVector
+// #pragma mark - SyscallVector
 
+
 struct SyscallVector::_SyscallVector : public vector<Syscall*> {
 };
 
 
-// constructor
+
 SyscallVector::SyscallVector()
-       : fSyscalls(new _SyscallVector)
+       :
+       fSyscalls(new _SyscallVector)
 {
 }
 
-// destructor
+
 SyscallVector::~SyscallVector()
 {
        int count = CountSyscalls();
@@ -166,21 +173,21 @@
        delete fSyscalls;
 }
 
-// Create
+
 SyscallVector*
 SyscallVector::Create()
 {
        return new SyscallVector;
 }
 
-// CountSyscalls
+
 int
 SyscallVector::CountSyscalls() const
 {
        return fSyscalls->size();
 }
 
-// SyscallAt
+
 Syscall*
 SyscallVector::SyscallAt(int index) const
 {
@@ -190,7 +197,7 @@
        return (*fSyscalls)[index];
 }
 
-// CreateSyscall
+
 Syscall*
 SyscallVector::CreateSyscall(const char* name, const char* kernelName)
 {
@@ -202,18 +209,18 @@
 
 // #pragma mark -
 
-// Main
+
 class Main {
 public:
-
-       int Run(int argc, char **argv)
+       int Run(int argc, char** argv)
        {
                // parse arguments
-               const char *syscallsFile = NULL;
-               const char *dispatcherFile = NULL;
-               const char *numbersFile = NULL;
-               const char *tableFile = NULL;
-               const char *straceFile = NULL;
+               const char* syscallsFile = NULL;
+               const char* dispatcherFile = NULL;
+               const char* numbersFile = NULL;
+               const char* tableFile = NULL;
+               const char* straceFile = NULL;
+
                for (int argi = 1; argi < argc; argi++) {
                        string arg(argv[argi]);
                        if (arg == "-h" || arg == "--help") {
@@ -275,7 +282,7 @@
                return 0;
        }
 
-       void _WriteSyscallsFile(const char *filename)
+       void _WriteSyscallsFile(const char* filename)
        {
                // open the syscalls output file
                ofstream file(filename, ofstream::out | ofstream::trunc);
@@ -299,7 +306,7 @@
                }
        }
 
-       void _WriteDispatcherFile(const char *filename)
+       void _WriteDispatcherFile(const char* filename)
        {
                // open the dispatcher output file
                ofstream file(filename, ofstream::out | ofstream::trunc);
@@ -312,7 +319,7 @@
                        file << "case " << i << ":" << endl;
                        file << "\t";
                        if (string(syscall->ReturnType()->TypeName()) != "void")
-                               file << "*call_ret = ";
+                               file << "*_returnValue = ";
                        file << syscall->KernelName() << "(";
                        int paramCount = syscall->CountParameters();
                        if (paramCount > 0) {
@@ -344,7 +351,7 @@
                }
        }
 
-       void _WriteNumbersFile(const char *filename)
+       void _WriteNumbersFile(const char* filename)
        {
                // open the syscall numbers output file
                ofstream file(filename, ofstream::out | ofstream::trunc);
@@ -352,7 +359,7 @@
                        throw IOException(string("Failed to open `") + filename 
+ "'.");
 
                // output the defines
-               const char *prefix = "_user_";
+               const char* prefix = "_user_";
                size_t prefixLen = strlen(prefix);
                for (int i = 0; i < fSyscallCount; i++) {
                        const Syscall* syscall = fSyscallVector->SyscallAt(i);
@@ -371,7 +378,7 @@
                }
        }
 
-       void _WriteTableFile(const char *filename)
+       void _WriteTableFile(const char* filename)
        {
                // open the syscall table output file
                ofstream file(filename, ofstream::out | ofstream::trunc);
@@ -452,7 +459,7 @@
                file << "#endif // _ASSEMBLER" << endl;
        }
 
-       void _WriteSTraceFile(const char *filename)
+       void _WriteSTraceFile(const char* filename)
        {
                // open the syscall table output file
                ofstream file(filename, ofstream::out | ofstream::trunc);
@@ -522,9 +529,9 @@
                file << "}" << endl;
        }
 
-       static string _GetPointerType(const char *type)
+       static string _GetPointerType(const char* type)
        {
-               const char *parenthesis = strchr(type, ')');
+               const char* parenthesis = strchr(type, ')');
                if (!parenthesis)
                        return string(type) + "*";
                // function pointer type
@@ -605,9 +612,9 @@
        int                             fSyscallCount;
 };
 
-// main
+
 int
-main(int argc, char **argv)
+main(int argc, char** argv)
 {
        try {
                return Main().Run(argc, argv);


Other related posts:

  • » [haiku-commits] r34237 - in haiku/trunk/src: system/kernel tools/gensyscalls - axeld