git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2acc729
)
Misc - Changes to allow warning-less compilation with clang
author
John Hodge (sonata)
<
[email protected]
>
Tue, 13 Nov 2012 03:59:00 +0000
(11:59 +0800)
committer
John Hodge (sonata)
<
[email protected]
>
Tue, 13 Nov 2012 03:59:00 +0000
(11:59 +0800)
KernelLand/Kernel/binary.c
patch
|
blob
|
history
KernelLand/Kernel/lib.c
patch
|
blob
|
history
KernelLand/Kernel/libc.c
patch
|
blob
|
history
KernelLand/Modules/USB/Core/usb.c
patch
|
blob
|
history
KernelLand/Modules/USB/Core/usb.h
patch
|
blob
|
history
KernelLand/Modules/USB/Core/usb_lowlevel.c
patch
|
blob
|
history
Usermode/Libraries/ld-acess.so_src/elf.c
patch
|
blob
|
history
diff --git
a/KernelLand/Kernel/binary.c
b/KernelLand/Kernel/binary.c
index
a15db0b
..
208ab95
100644
(file)
--- a/
KernelLand/Kernel/binary.c
+++ b/
KernelLand/Kernel/binary.c
@@
-194,7
+194,7
@@
int Proc_SysSpawn(const char *Binary, const char **ArgV, const char **EnvP, int
Proc_Execve(Binary, ArgV, EnvP, size);
for(;;);
}
Proc_Execve(Binary, ArgV, EnvP, size);
for(;;);
}
- if( ret
< 0
)
+ if( ret
== -1
)
{
VFS_FreeSavedHandles(nFD, handles);
free(cachebuf);
{
VFS_FreeSavedHandles(nFD, handles);
free(cachebuf);
diff --git
a/KernelLand/Kernel/lib.c
b/KernelLand/Kernel/lib.c
index
36b877c
..
5f302d4
100644
(file)
--- a/
KernelLand/Kernel/lib.c
+++ b/
KernelLand/Kernel/lib.c
@@
-287,23
+287,23
@@
Sint64 timestamp(int sec, int min, int hrs, int day, int month, int year)
return stamp * 1000;
}
return stamp * 1000;
}
+static Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R);
+
+static Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R)
+{
+ int sign = (N < 0) != (D < 0);
+ if(N < 0) N = -N;
+ if(D < 0) D = -D;
+ if(sign)
+ return -DivMod64U(N, D, (Uint64*)R);
+ else
+ return DivMod64U(N, D, (Uint64*)R);
+}
+
void format_date(tTime TS, int *year, int *month, int *day, int *hrs, int *mins, int *sec, int *ms)
{
int is_leap = 0, i;
void format_date(tTime TS, int *year, int *month, int *day, int *hrs, int *mins, int *sec, int *ms)
{
int is_leap = 0, i;
- auto Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R);
-
- Sint64 DivMod64(Sint64 N, Sint64 D, Sint64 *R)
- {
- int sign = (N < 0) != (D < 0);
- if(N < 0) N = -N;
- if(D < 0) D = -D;
- if(sign)
- return -DivMod64U(N, D, (Uint64*)R);
- else
- return DivMod64U(N, D, (Uint64*)R);
- }
-
// Get time
// TODO: Leap-seconds?
{
// Get time
// TODO: Leap-seconds?
{
diff --git
a/KernelLand/Kernel/libc.c
b/KernelLand/Kernel/libc.c
index
ef94426
..
ea70579
100644
(file)
--- a/
KernelLand/Kernel/libc.c
+++ b/
KernelLand/Kernel/libc.c
@@
-184,7
+184,12
@@
void itoa(char *buf, Uint64 num, int base, int minLength, char pad)
/**
* \brief Append a character the the vsnprintf output
*/
/**
* \brief Append a character the the vsnprintf output
*/
-#define PUTCH(c) _putch(c)
+#define PUTCH(ch) do { \
+ if(pos < __maxlen) { \
+ if(__s) __s[pos] = ch; \
+ } \
+ pos ++; \
+ } while(0)
#define GETVAL() do {\
if(isLongLong) val = va_arg(args, Uint64);\
else val = va_arg(args, unsigned int);\
#define GETVAL() do {\
if(isLongLong) val = va_arg(args, Uint64);\
else val = va_arg(args, unsigned int);\
@@
-203,17
+208,6
@@
int vsnprintf(char *__s, size_t __maxlen, const char *__format, va_list args)
size_t pos = 0;
// Flags
int bPadLeft = 0;
size_t pos = 0;
// Flags
int bPadLeft = 0;
-
- auto void _putch(char ch);
-
- void _putch(char ch)
- {
- if(pos < __maxlen)
- {
- if(__s) __s[pos] = ch;
- }
- pos ++;
- }
while((c = *__format++) != 0)
{
while((c = *__format++) != 0)
{
diff --git
a/KernelLand/Modules/USB/Core/usb.c
b/KernelLand/Modules/USB/Core/usb.c
index
3234a77
..
eb1aa39
100644
(file)
--- a/
KernelLand/Modules/USB/Core/usb.c
+++ b/
KernelLand/Modules/USB/Core/usb.c
@@
-31,7
+31,7
@@
tUSBHub *USB_RegisterHost(tUSBHostDef *HostDef, void *ControllerPtr, int nPorts)
{
tUSBHost *host;
{
tUSBHost *host;
- host = malloc(sizeof(tUSBHost) + nPorts*sizeof(tUSBHubPort));
+ host = malloc(sizeof(tUSBHost) +
sizeof(tUSBDevice) + sizeof(tUSBInterface) +
nPorts*sizeof(tUSBHubPort));
if(!host) {
// Oh, bugger.
return NULL;
if(!host) {
// Oh, bugger.
return NULL;
@@
-40,19
+40,21
@@
tUSBHub *USB_RegisterHost(tUSBHostDef *HostDef, void *ControllerPtr, int nPorts)
host->Ptr = ControllerPtr;
memset(host->AddressBitmap, 0, sizeof(host->AddressBitmap));
host->Ptr = ControllerPtr;
memset(host->AddressBitmap, 0, sizeof(host->AddressBitmap));
- host->RootHubDev.ParentHub = NULL;
- host->RootHubDev.Host = host;
- host->RootHubDev.Address = 0;
+ host->RootHubDev = (void*)(host + 1);
+ host->RootHubDev->ParentHub = NULL;
+ host->RootHubDev->Host = host;
+ host->RootHubDev->Address = 0;
ASSERT(HostDef->InitControl);
ASSERT(HostDef->InitControl);
- host->RootHubDev
.
EndpointHandles[0] = HostDef->InitControl(ControllerPtr, 0, 64);
+ host->RootHubDev
->
EndpointHandles[0] = HostDef->InitControl(ControllerPtr, 0, 64);
-// host->RootHubIf.Next = NULL;
- host->RootHubIf.Dev = &host->RootHubDev;
- host->RootHubIf.Driver = NULL;
- host->RootHubIf.Data = NULL;
- host->RootHubIf.nEndpoints = 0;
+ host->RootHubIf = (void*)(host->RootHubDev + 1);
+// host->RootHubIf->Next = NULL;
+ host->RootHubIf->Dev = host->RootHubDev;
+ host->RootHubIf->Driver = NULL;
+ host->RootHubIf->Data = NULL;
+ host->RootHubIf->nEndpoints = 0;
- host->RootHub.Interface =
&
host->RootHubIf;
+ host->RootHub.Interface = host->RootHubIf;
host->RootHub.nPorts = nPorts;
memset(host->RootHub.Ports, 0, sizeof(tUSBHubPort)*nPorts);
host->RootHub.nPorts = nPorts;
memset(host->RootHub.Ports, 0, sizeof(tUSBHubPort)*nPorts);
diff --git
a/KernelLand/Modules/USB/Core/usb.h
b/KernelLand/Modules/USB/Core/usb.h
index
c5c8cad
..
2de6985
100644
(file)
--- a/
KernelLand/Modules/USB/Core/usb.h
+++ b/
KernelLand/Modules/USB/Core/usb.h
@@
-101,8
+101,8
@@
struct sUSBHost
Uint8 AddressBitmap[128/8];
Uint8 AddressBitmap[128/8];
- tUSBDevice RootHubDev;
- tUSBInterface RootHubIf;
+ tUSBDevice
*
RootHubDev;
+ tUSBInterface
*
RootHubIf;
tUSBHub RootHub;
};
tUSBHub RootHub;
};
diff --git
a/KernelLand/Modules/USB/Core/usb_lowlevel.c
b/KernelLand/Modules/USB/Core/usb_lowlevel.c
index
57948ce
..
27bad3e
100644
(file)
--- a/
KernelLand/Modules/USB/Core/usb_lowlevel.c
+++ b/
KernelLand/Modules/USB/Core/usb_lowlevel.c
@@
-84,7
+84,7
@@
void USB_int_WakeThread(void *Thread, void *Data, size_t Length)
int USB_int_SendSetupSetAddress(tUSBHost *Host, int Address)
{
int USB_int_SendSetupSetAddress(tUSBHost *Host, int Address)
{
- USB_int_Request(
&
Host->RootHubDev, 0, 0x00, 5, Address & 0x7F, 0, 0, NULL);
+ USB_int_Request(Host->RootHubDev, 0, 0x00, 5, Address & 0x7F, 0, 0, NULL);
return 0;
}
return 0;
}
diff --git
a/Usermode/Libraries/ld-acess.so_src/elf.c
b/Usermode/Libraries/ld-acess.so_src/elf.c
index
0b3656b
..
4a87896
100644
(file)
--- a/
Usermode/Libraries/ld-acess.so_src/elf.c
+++ b/
Usermode/Libraries/ld-acess.so_src/elf.c
@@
-214,7
+214,6
@@
void *Elf32Relocate(void *Base, char **envp, const char *Filename)
char *dynstrtab = NULL; // .dynamic String Table
Elf32_Sym *dynsymtab;
int (*do_relocate)(uint32_t t_info, uint32_t *ptr, Elf32_Addr addend, int Type, int bRela, const char *Sym, intptr_t iBaseDiff);
char *dynstrtab = NULL; // .dynamic String Table
Elf32_Sym *dynsymtab;
int (*do_relocate)(uint32_t t_info, uint32_t *ptr, Elf32_Addr addend, int Type, int bRela, const char *Sym, intptr_t iBaseDiff);
- auto int _doRelocate(uint32_t r_info, uint32_t *ptr, int bRela, Elf32_Addr addend);
DEBUGS("ElfRelocate: (Base=0x%x)", Base);
DEBUGS("ElfRelocate: (Base=0x%x)", Base);
@@
-363,14
+362,6
@@
void *Elf32Relocate(void *Base, char **envp, const char *Filename)
DEBUGS(" elf_relocate: Beginning Relocation");
DEBUGS(" elf_relocate: Beginning Relocation");
- int _doRelocate(uint32_t r_info, uint32_t *ptr, int bRela, Elf32_Addr addend)
- {
- int type = ELF32_R_TYPE(r_info);
- int sym = ELF32_R_SYM(r_info);
- const char *symname = dynstrtab + dynsymtab[sym].nameOfs;
- return do_relocate(r_info, ptr, addend, type, bRela, symname, iBaseDiff);
- }
-
switch(hdr->machine)
{
case EM_386:
switch(hdr->machine)
{
case EM_386:
@@
-389,6
+380,10
@@
void *Elf32Relocate(void *Base, char **envp, const char *Filename)
int fail = 0;
int fail = 0;
+ #define _doRelocate(r_info, ptr, bRela, addend) \
+ do_relocate(r_info, ptr, addend, ELF32_R_TYPE(r_info), bRela, \
+ dynstrtab + dynsymtab[ELF32_R_SYM(r_info)].nameOfs, iBaseDiff);
+
// Parse Relocation Entries
if(rel && relSz)
{
// Parse Relocation Entries
if(rel && relSz)
{
@@
-461,6
+456,8
@@
void *Elf32Relocate(void *Base, char **envp, const char *Filename)
return NULL;
}
return NULL;
}
+ #undef _doRelocate
+
DEBUGS("ElfRelocate: RETURN 0x%x to %p", hdr->entrypoint + iBaseDiff, __builtin_return_address(0));
return (void*)(intptr_t)( hdr->entrypoint + iBaseDiff );
}
DEBUGS("ElfRelocate: RETURN 0x%x to %p", hdr->entrypoint + iBaseDiff, __builtin_return_address(0));
return (void*)(intptr_t)( hdr->entrypoint + iBaseDiff );
}
UCC
git Repository :: git.ucc.asn.au