Compile fixes for clang
authorJohn Hodge <[email protected]>
Thu, 24 Mar 2011 08:05:28 +0000 (16:05 +0800)
committerJohn Hodge <[email protected]>
Thu, 24 Mar 2011 08:05:28 +0000 (16:05 +0800)
Kernel/drvutil.c
Kernel/threads.c
Makefile.host.cfg
Makefile.x86.cfg [new file with mode: 0644]
Makefile.x86_64.cfg
Modules/IPStack/interface.c
Modules/IPStack/routing.c

index 7e5b9b1..bac7894 100644 (file)
 Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,
        tDrvUtil_Video_2DHandlers *Handlers, int SizeofHandlers)
 {
-       Uint8   *stream = Buffer;
+       void    *stream = Buffer;
         int    rem = Length;
         int    op;
        while( rem )
        {
                rem --;
-               op = *stream++;
+               op = *(Uint8*)stream;
+               stream = (void*)((tVAddr)stream + 1);
                
                if(op > NUM_VIDEO_2DOPS) {
                        Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Unknown"
@@ -46,17 +47,17 @@ Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,
                        
                        Handlers->Fill(
                                Ent,
-                               *(Uint16*)(&stream[0]), *(Uint16*)(&stream[2]),
-                               *(Uint16*)(&stream[4]), *(Uint16*)(&stream[6]),
-                               *(Uint32*)(&stream[8])
+                               ((Uint16*)stream)[0], ((Uint16*)stream)[1],
+                               ((Uint16*)stream)[2], ((Uint16*)stream)[3],
+                               ((Uint32*)stream)[4]
                                );
                        
                        rem -= 12;
-                       stream += 12;
+                       stream = (void*)((tVAddr)stream + 12);
                        break;
                
                case VIDEO_2DOP_BLIT:
-                       if(rem < 12)    return Length-rem;
+                       if(rem < 16)    return Length-rem;
                        
                        if(!Handlers->Blit) {
                                Log_Warning("DrvUtil", "DrvUtil_Video_2DStream: Driver"
@@ -64,21 +65,15 @@ Uint64 DrvUtil_Video_2DStream(void *Ent, void *Buffer, int Length,
                                return Length-rem;
                        }
                        
-                       //Log("Handlers->Blit{%}}(%p, %i,%i, %i,%i, %i,%i)",
-                       //      Handlers->Blit, Ent,
-                       //      *(Uint16*)(&stream[0]), *(Uint16*)(&stream[2]),
-                       //      *(Uint16*)(&stream[4]), *(Uint16*)(&stream[6]),
-                       //      *(Uint16*)(&stream[8]), *(Uint16*)(&stream[10])
-                       //      );
                        Handlers->Blit(
                                Ent,
-                               *(Uint16*)(&stream[0]), *(Uint16*)(&stream[2]),
-                               *(Uint16*)(&stream[4]), *(Uint16*)(&stream[6]),
-                               *(Uint16*)(&stream[8]), *(Uint16*)(&stream[10])
+                               ((Uint16*)stream)[0], ((Uint16*)stream)[1],
+                               ((Uint16*)stream)[2], ((Uint16*)stream)[3],
+                               ((Uint16*)stream)[4], ((Uint16*)stream)[5]
                                );
                        
-                       rem -= 12;
-                       stream += 12;
+                       rem -= 16;
+                       stream = (void*)((tVAddr)stream + 16);
                        break;
                
                }
index 62bb7e0..d24af08 100644 (file)
@@ -81,11 +81,11 @@ void        Mutex_Release(tMutex *Mutex);
 // -- Core Thread --
 // Only used for the core kernel
 tThread        gThreadZero = {
-       Status: THREAD_STAT_ACTIVE,     // Status
-       ThreadName:     (char*)"ThreadZero",    // Name
-       Quantum: DEFAULT_QUANTUM,       // Default Quantum
-       Remaining:      DEFAULT_QUANTUM,        // Current Quantum
-       Priority:       DEFAULT_PRIORITY        // Number of tickets
+       .Status         = THREAD_STAT_ACTIVE,   // Status
+       .ThreadName     = (char*)"ThreadZero",  // Name
+       .Quantum        = DEFAULT_QUANTUM,      // Default Quantum
+       .Remaining      = DEFAULT_QUANTUM,      // Current Quantum
+       .Priority       = DEFAULT_PRIORITY      // Number of tickets
        };
 // -- Processes --
 // --- Locks ---
index 0879ad7..dee50de 100644 (file)
@@ -8,6 +8,8 @@ SAVED_LD_ := $(LD)
 
 include $(ACESSDIR)/Makefile.x86_64.cfg
 
+OBJDUMP := objdump -S
+
 CC := $(SAVED_CC_)
 LD := $(SAVED_LD_)
 
diff --git a/Makefile.x86.cfg b/Makefile.x86.cfg
new file mode 100644 (file)
index 0000000..705fe8a
--- /dev/null
@@ -0,0 +1,2 @@
+
+ASFLAGS = -felf
index 024ef13..f5985c2 100644 (file)
@@ -8,3 +8,5 @@ DYNMOD_CFLAGS := -mcmodel=small -fPIC -mno-red-zone
 
 ARCHDIR = x86_64
 
+ASFLAGS = -felf64
+
index fc7db90..6538078 100644 (file)
@@ -34,18 +34,18 @@ tVFS_Node   *IPStack_Iface_FindDir(tVFS_Node *Node, const char *Name);
 // === GLOBALS ===
 //! Loopback (127.0.0.0/8, ::1) Pseudo-Interface
 tInterface     gIP_LoopInterface = {
-       Node: {
-               ImplPtr: &gIP_LoopInterface,
-               Flags: VFS_FFLAG_DIRECTORY,
-               Size: -1,
-               NumACLs: 1,
-               ACLs: &gVFS_ACL_EveryoneRX,
-               ReadDir: IPStack_Iface_ReadDir,
-               FindDir: IPStack_Iface_FindDir,
-               IOCtl: IPStack_Iface_IOCtl
+       .Node = {
+               .ImplPtr = &gIP_LoopInterface,
+               .Flags = VFS_FFLAG_DIRECTORY,
+               .Size = -1,
+               .NumACLs = 1,
+               .ACLs = &gVFS_ACL_EveryoneRX,
+               .ReadDir = IPStack_Iface_ReadDir,
+               .FindDir = IPStack_Iface_FindDir,
+               .IOCtl = IPStack_Iface_IOCtl
        },
-       Adapter: NULL,
-       Type: 0
+       .Adapter = NULL,
+       .Type = 0
 };
 tShortSpinlock glIP_Interfaces;
 tInterface     *gIP_Interfaces = NULL;
@@ -54,8 +54,8 @@ tInterface    *gIP_Interfaces_Last = NULL;
 tSocketFile    *gIP_FileTemplates;
 
 tAdapter       gIP_LoopAdapter = {
-       DeviceLen: 8,
-       Device: "LOOPBACK"
+       .DeviceLen = 8,
+       .Device = "LOOPBACK"
        };
 tMutex glIP_Adapters;
 tAdapter       *gIP_Adapters = NULL;
index 957f1e1..c37e744 100644 (file)
@@ -32,13 +32,13 @@ tRoute      *IPStack_FindRoute(int AddressType, tInterface *Interface, void *Address)
 tRoute *gIP_Routes;
 tRoute *gIP_RoutesEnd;
 tVFS_Node      gIP_RouteNode = {
-       Flags: VFS_FFLAG_DIRECTORY,
-       Size: -1,
-       NumACLs: 1,
-       ACLs: &gVFS_ACL_EveryoneRX,
-       ReadDir: IPStack_RouteDir_ReadDir,
-       FindDir: IPStack_RouteDir_FindDir,
-       IOCtl: IPStack_RouteDir_IOCtl
+       .Flags = VFS_FFLAG_DIRECTORY,
+       .Size = -1,
+       .NumACLs = 1,
+       .ACLs = &gVFS_ACL_EveryoneRX,
+       .ReadDir = IPStack_RouteDir_ReadDir,
+       .FindDir = IPStack_RouteDir_FindDir,
+       .IOCtl = IPStack_RouteDir_IOCtl
 };
 
 // === CODE ===

UCC git Repository :: git.ucc.asn.au