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 (parent:
1501fe5
)
Fixing Tegra2 build
author
John Hodge
<
[email protected]
>
Sat, 7 Jan 2012 10:07:52 +0000
(18:07 +0800)
committer
John Hodge
<
[email protected]
>
Sat, 7 Jan 2012 10:07:52 +0000
(18:07 +0800)
Kernel/arch/armv7/Makefile
patch
|
blob
|
history
Kernel/arch/armv7/debug.c
patch
|
blob
|
history
Kernel/arch/armv7/include/lock.h
patch
|
blob
|
history
Kernel/arch/armv7/link.ld
patch
|
blob
|
history
Kernel/arch/armv7/main.c
patch
|
blob
|
history
Kernel/arch/armv7/mm_phys.c
patch
|
blob
|
history
Kernel/arch/armv7/start.S
patch
|
blob
|
history
Kernel/debug.c
patch
|
blob
|
history
Kernel/lib.c
patch
|
blob
|
history
Modules/Input/PS2KbMouse/pl050.c
patch
|
blob
|
history
diff --git
a/Kernel/arch/armv7/Makefile
b/Kernel/arch/armv7/Makefile
index
4e36774
..
fad1b55
100644
(file)
--- a/
Kernel/arch/armv7/Makefile
+++ b/
Kernel/arch/armv7/Makefile
@@
-15,4
+15,6
@@
A_OBJ += mm_phys.o mm_virt.o proc.o proc.ao
#main.c: Makefile.BuildNum.$(ARCH)
#main.c: Makefile.BuildNum.$(ARCH)
-POSTBUILD = arm-elf-objcopy $(BIN) -O binary $(BIN)
+ifeq ($(PLATFORM),tegra2)
+ POSTBUILD = arm-elf-objcopy $(BIN) -O binary $(BIN)
+endif
diff --git
a/Kernel/arch/armv7/debug.c
b/Kernel/arch/armv7/debug.c
index
d75048e
..
7b9e55d
100644
(file)
--- a/
Kernel/arch/armv7/debug.c
+++ b/
Kernel/arch/armv7/debug.c
@@
-23,8
+23,14
@@
void StartupPrint(const char *str);
// === CODE ===
void Debug_PutCharDebug(char ch)
{
// === CODE ===
void Debug_PutCharDebug(char ch)
{
-// while( *(volatile Uint32*)(SERIAL_BASE + SERIAL_REG_FLAG) & SERIAL_FLAG_FULL )
+ if(ch == '\n')
+ Debug_PutCharDebug('\r');
+
+ #if PLATFORM_is_tegra2
+ // Tegra2
+ while( !(*(volatile Uint32*)(UART0_BASE + 0x14) & (1 << 5)) )
;
;
+ #endif
// *(volatile Uint32*)(SERIAL_BASE + SERIAL_REG_DATA) = ch;
*(volatile Uint32*)(UART0_BASE) = ch;
// *(volatile Uint32*)(SERIAL_BASE + SERIAL_REG_DATA) = ch;
*(volatile Uint32*)(UART0_BASE) = ch;
diff --git
a/Kernel/arch/armv7/include/lock.h
b/Kernel/arch/armv7/include/lock.h
index
627726b
..
6688af4
100644
(file)
--- a/
Kernel/arch/armv7/include/lock.h
+++ b/
Kernel/arch/armv7/include/lock.h
@@
-26,7
+26,7
@@
static inline int CPU_HAS_LOCK(struct sShortSpinlock *Lock)
static inline int SHORTLOCK(struct sShortSpinlock *Lock)
{
static inline int SHORTLOCK(struct sShortSpinlock *Lock)
{
- #if
1
+ #if
0
// Coped from linux, yes, but I know what it does now :)
Uint tmp;
__asm__ __volatile__ (
// Coped from linux, yes, but I know what it does now :)
Uint tmp;
__asm__ __volatile__ (
@@
-39,11
+39,14
@@
static inline int SHORTLOCK(struct sShortSpinlock *Lock)
: "r" (&Lock->Lock), "r" (1)
: "cc" // Condition codes clobbered
);
: "r" (&Lock->Lock), "r" (1)
: "cc" // Condition codes clobbered
);
+ #elif 1
+ while( *(volatile int*)&Lock->Lock ) ;
+ Lock->Lock = 1;
#else
int v = 1;
while( v )
__asm__ __volatile__ (
#else
int v = 1;
while( v )
__asm__ __volatile__ (
- "swp %0, [%1]"
+ "swp %0,
%0,
[%1]"
: "=r" (v) : "r" (&Lock->Lock)
: "cc"
);
: "=r" (v) : "r" (&Lock->Lock)
: "cc"
);
diff --git
a/Kernel/arch/armv7/link.ld
b/Kernel/arch/armv7/link.ld
index
bf07b4c
..
d10dcc4
100644
(file)
--- a/
Kernel/arch/armv7/link.ld
+++ b/
Kernel/arch/armv7/link.ld
@@
-44,10
+44,12
@@
SECTIONS
}
.bss : AT( ADDR(.bss) - _kernel_base )
{
}
.bss : AT( ADDR(.bss) - _kernel_base )
{
+ bss_start = .;
*(.bss*)
*(COMMON*)
. = ALIGN(0x1000);
*(.pabss)
*(.bss*)
*(COMMON*)
. = ALIGN(0x1000);
*(.pabss)
+ bss_end = .;
}
gKernelEnd = .;
}
}
gKernelEnd = .;
}
diff --git
a/Kernel/arch/armv7/main.c
b/Kernel/arch/armv7/main.c
index
20d65d1
..
eb9f1a6
100644
(file)
--- a/
Kernel/arch/armv7/main.c
+++ b/
Kernel/arch/armv7/main.c
@@
-24,8
+24,8
@@
Uint32 ARMv7_int_HandleSyscalls(Uint32 Num, Uint32 *Args);
int kmain(void)
{
LogF("Acess2 ARMv7 v"EXPAND_STR(KERNEL_VERSION)"\n");
int kmain(void)
{
LogF("Acess2 ARMv7 v"EXPAND_STR(KERNEL_VERSION)"\n");
- LogF("
Build %i, Git Hash %s\n", BUILD_NUM
, gsGitHash);
-
// Interrupts_Setup(
);
+ LogF("
Git Hash %s\n"
, gsGitHash);
+
LogF(" Build %i\n", BUILD_NUM
);
MM_SetupPhys();
MM_SetupPhys();
diff --git
a/Kernel/arch/armv7/mm_phys.c
b/Kernel/arch/armv7/mm_phys.c
index
53c5731
..
5e4a242
100644
(file)
--- a/
Kernel/arch/armv7/mm_phys.c
+++ b/
Kernel/arch/armv7/mm_phys.c
@@
-32,6
+32,7
@@
extern char gKernelEnd[];
void MM_SetupPhys(void)
{
void MM_SetupPhys(void)
{
+ LogF("MM_SetupPhys: ()\n");
MM_Tpl_InitPhys( REALVIEW_LOWRAM_SIZE/0x1000, NULL );
}
MM_Tpl_InitPhys( REALVIEW_LOWRAM_SIZE/0x1000, NULL );
}
diff --git
a/Kernel/arch/armv7/start.S
b/Kernel/arch/armv7/start.S
index
7c1be8c
..
3f53cc2
100644
(file)
--- a/
Kernel/arch/armv7/start.S
+++ b/
Kernel/arch/armv7/start.S
@@
-87,13
+87,27
@@
_start:
str r1, [r2]
mov r1, #'m'
str r1, [r2]
str r1, [r2]
mov r1, #'m'
str r1, [r2]
+ mov r1, #13
+ str r1, [r2]
+ mov r1, #10
+ str r1, [r2]
- ldr sp, =0x80000000-4 @ Set up stack (top of user range)
+.extern bss_start
+.extern bss_size_div_4
+.zero_bss:
+ ldr r0, =bss_start
+ ldr r1, =bss_end
+ mov r3, #0
+.zero_bss_loop:
+ str r3, [r0],#4
+ cmp r0, r1
+ bls .zero_bss_loop
+
+.goto_c:
+ ldr sp, =0x80000000-8 @ Set up stack (top of user range)
ldr r0, =kmain
mov pc, r0
1: b 1b @ Infinite loop
ldr r0, =kmain
mov pc, r0
1: b 1b @ Infinite loop
-_ptr_kmain:
- .long kmain
.comm irqstack, 0x1000 @ ; 4KiB Stack
.comm abortstack, 0x1000 @ ; 4KiB Stack
.comm irqstack, 0x1000 @ ; 4KiB Stack
.comm abortstack, 0x1000 @ ; 4KiB Stack
diff --git
a/Kernel/debug.c
b/Kernel/debug.c
index
379f676
..
25ffda1
100644
(file)
--- a/
Kernel/debug.c
+++ b/
Kernel/debug.c
@@
-9,7
+9,7
@@
#define DEBUG_MAX_LINE_LEN 256
#define DEBUG_MAX_LINE_LEN 256
-#define LOCK_DEBUG_OUTPUT
1
+#define LOCK_DEBUG_OUTPUT
0
#define TRACE_TO_KTERM 0
#define TRACE_TO_KTERM 0
@@
-37,7
+37,7
@@
tShortSpinlock glDebug_Lock;
// === CODE ===
static void Debug_Putchar(char ch)
// === CODE ===
static void Debug_Putchar(char ch)
-{
+{
Debug_PutCharDebug(ch);
if( !gbDebug_IsKPanic )
{
Debug_PutCharDebug(ch);
if( !gbDebug_IsKPanic )
{
diff --git
a/Kernel/lib.c
b/Kernel/lib.c
index
2b786ec
..
953264b
100644
(file)
--- a/
Kernel/lib.c
+++ b/
Kernel/lib.c
@@
-191,11
+191,7
@@
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) do{\
- char ch=(c);\
- if(pos==__maxlen){return pos;}\
- if(__s){__s[pos++]=ch;}else{pos++;}\
- }while(0)
+#define PUTCH(c) _putch(c)
#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);\
@@
-214,16
+210,23
@@
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;
-
- //Log("vsnprintf: (__s=%p, __maxlen=%i, __format='%s', ...)", __s, __maxlen, __format);
-
+
+ inline void _putch(char ch)
+ {
+ if(pos < __maxlen)
+ {
+ if(__s) __s[pos] = ch;
+ pos ++;
+ }
+ }
+
while((c = *__format++) != 0)
{
// Non control character
if(c != '%') { PUTCH(c); continue; }
while((c = *__format++) != 0)
{
// Non control character
if(c != '%') { PUTCH(c); continue; }
-
+
c = *__format++;
c = *__format++;
-
//Log("pos = %i", pos)
;
+
if(c == '\0') break
;
// Literal %
if(c == '%') { PUTCH('%'); continue; }
// Literal %
if(c == '%') { PUTCH('%'); continue; }
@@
-232,9
+235,9
@@
int vsnprintf(char *__s, size_t __maxlen, const char *__format, va_list args)
if(c == 'p') {
Uint ptr = va_arg(args, Uint);
PUTCH('*'); PUTCH('0'); PUTCH('x');
if(c == 'p') {
Uint ptr = va_arg(args, Uint);
PUTCH('*'); PUTCH('0'); PUTCH('x');
- itoa(tmpBuf, ptr, 16, BITS/4, '0');
-
p = tmpBuf
;
-
goto printString
;
+ for( len = BITS/4; len --; )
+
PUTCH( cUCDIGITS[ (ptr>>(len*4))&15 ] )
;
+
continue
;
}
// - Padding Side Flag
}
// - Padding Side Flag
diff --git
a/Modules/Input/PS2KbMouse/pl050.c
b/Modules/Input/PS2KbMouse/pl050.c
index
5a0a32a
..
839c0bd
100644
(file)
--- a/
Modules/Input/PS2KbMouse/pl050.c
+++ b/
Modules/Input/PS2KbMouse/pl050.c
@@
-86,7
+86,7
@@
static inline void PL050_WriteMouseData(Uint8 Data)
ENTER("xData", Data);
ENTER("xData", Data);
- while( --timeout &&
gpPL050_MouseBase[1] & PL050_TXBUSY
);
+ while( --timeout &&
(gpPL050_MouseBase[1] & PL050_TXBUSY)
);
if(timeout)
gpPL050_MouseBase[2] = Data;
else
if(timeout)
gpPL050_MouseBase[2] = Data;
else
UCC
git Repository :: git.ucc.asn.au