diff --git a/include/ctype.h b/include/ctype.h index 2b97e5c2..5f996a2f 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -4,8 +4,8 @@ #define __CTYPE_H__ #ifdef __cplusplus -extern "C" { -#endif // __cplusplus +extern "C" { +#endif// __cplusplus /** * Check if the given character is alphanumeric. @@ -137,6 +137,6 @@ int toupper(int c); #ifdef __cplusplus } -#endif // __cplusplus +#endif// __cplusplus #endif /* __CTYPE_H__ */ \ No newline at end of file diff --git a/include/smalloc.h b/include/smalloc.h index e4455b18..97a8f71e 100644 --- a/include/smalloc.h +++ b/include/smalloc.h @@ -7,8 +7,8 @@ #include #ifdef __cplusplus -extern "C" { -#endif // __cplusplus +extern "C" { +#endif// __cplusplus struct alloc_struct_t { phys_addr_t address; @@ -54,6 +54,6 @@ void sfree(void *p); #ifdef __cplusplus } -#endif // __cplusplus +#endif// __cplusplus #endif// __SMALLOC_H__ \ No newline at end of file diff --git a/include/sstdlib.h b/include/sstdlib.h index d170a976..9549d8b0 100644 --- a/include/sstdlib.h +++ b/include/sstdlib.h @@ -6,8 +6,8 @@ #include #ifdef __cplusplus -extern "C" { -#endif // __cplusplus +extern "C" { +#endif// __cplusplus /** * Convert a string to an unsigned long integer, with optional base detection. @@ -159,6 +159,6 @@ int simple_abs(int n); #ifdef __cplusplus } -#endif // __cplusplus +#endif// __cplusplus #endif// __STDLIB_H__ \ No newline at end of file diff --git a/include/string.h b/include/string.h index c4f59237..e57ded1e 100644 --- a/include/string.h +++ b/include/string.h @@ -184,7 +184,7 @@ int snprintf(char *buf, size_t n, const char *fmt, ...); */ int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap); -#endif // CONFIG_SPRINTF +#endif// CONFIG_SPRINTF #ifdef __cplusplus } diff --git a/include/uart.h b/include/uart.h index 4378dd1a..2a0338d9 100644 --- a/include/uart.h +++ b/include/uart.h @@ -4,8 +4,8 @@ #define __CLI_UART_H__ #ifdef __cplusplus -extern "C" { -#endif // __cplusplus +extern "C" { +#endif// __cplusplus /** * Writes a single character 'c' to the UART output. @@ -62,6 +62,6 @@ extern int puts(const char *s); #ifdef __cplusplus } -#endif // __cplusplus +#endif// __cplusplus #endif//__CLI_UART_H__ \ No newline at end of file diff --git a/include/xformat.h b/include/xformat.h index e17b92c5..fd00b693 100644 --- a/include/xformat.h +++ b/include/xformat.h @@ -23,8 +23,8 @@ #include #ifdef __cplusplus -extern "C" { -#endif // __cplusplus +extern "C" { +#endif// __cplusplus /** * Define internal parameters as volatile for 8 bit cpu define @@ -68,6 +68,6 @@ unsigned xformat(void (*outchar)(void *arg, char), void *arg, const char *fmt, . #ifdef __cplusplus } -#endif // __cplusplus +#endif// __cplusplus #endif diff --git a/src/smalloc.c b/src/smalloc.c index fe5e86d6..78cfb49b 100644 --- a/src/smalloc.c +++ b/src/smalloc.c @@ -3,8 +3,8 @@ #include #include #include -#include #include +#include #include "smalloc.h" @@ -111,16 +111,16 @@ void sfree(void *p) { ptr = &boot_heap_head; while (ptr && ptr->next) { if (ptr->next->address == (phys_addr_t) p) - break; + break; ptr = ptr->next; } prev = ptr; ptr = ptr->next; - if (!ptr) return; + if (!ptr) return; - prev->next = ptr->next; + prev->next = ptr->next; return; } diff --git a/src/sstdlib.c b/src/sstdlib.c index 56de1831..42bcf529 100644 --- a/src/sstdlib.c +++ b/src/sstdlib.c @@ -45,12 +45,11 @@ long long simple_atoll(const char *nptr) { return (long long) simple_strtoll(nptr, NULL, 10); } -long simple_strtol(const char *cp, char **endp, unsigned int base) -{ - if (*cp == '-') - return -simple_strtoul(cp + 1, endp, base); +long simple_strtol(const char *cp, char **endp, unsigned int base) { + if (*cp == '-') + return -simple_strtoul(cp + 1, endp, base); - return simple_strtoul(cp, endp, base); + return simple_strtoul(cp, endp, base); } unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base) { diff --git a/src/string.c b/src/string.c index e516e60c..67323f98 100644 --- a/src/string.c +++ b/src/string.c @@ -981,4 +981,4 @@ int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap) { return o; } -#endif // CONFIG_SPRINTF \ No newline at end of file +#endif// CONFIG_SPRINTF \ No newline at end of file diff --git a/tools/bin2array.c b/tools/bin2array.c index 82c94d88..448891bd 100644 --- a/tools/bin2array.c +++ b/tools/bin2array.c @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) { FILE *inputFile, *outputFile; char *inputFileName = argv[1]; // Name of the input binary file char *outputFileName = argv[2];// Name of the output C array file - char *funcName = argv[3];// Name of the output C array + char *funcName = argv[3]; // Name of the output C array int fileSize; // Open the input binary file diff --git a/tools/sys-dram.asm.c b/tools/sys-dram.asm.c index c0cde1e0..940bc97b 100644 --- a/tools/sys-dram.asm.c +++ b/tools/sys-dram.asm.c @@ -4,82 +4,80 @@ void mctl_phy_ca_bit_delay_compensation(__dram_para_t *para) { - uint uVar1; - uint chip_id; - uint type; - uint reg_val; - uint i; - - if ((para->dram_tpr10 & 0x10000) != 0) { - if ((REG32(0x03006200) & 0xffff) == 0x800) { - switch(para->dram_type) { - case 3: - uVar1 = para->dram_tpr10; - for (i = 0; i < 0x20; i = i + 1) { - *(uint *)((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; - } - REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; - REG32(0x048307e4) = (para->dram_tpr10 >> 8 & 0xf) << 1; - REG32(0x048307e0) = REG32(0x048307dc); - if ((para->dram_para2 & 0x1000) != 0) { - REG32(0x04832388) = (para->dram_tpr10 >> 0xc & 0xf) << 1; - } - break; - case 4: - case 7: - break; - case 8: - uVar1 = para->dram_tpr10; - for (i = 0; i < 0x20; i = i + 1) { - *(uint *)((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; - } - REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; - REG32(0x048307e4) = (para->dram_tpr10 >> 8 & 0xf) << 1; - REG32(0x048307e0) = REG32(0x048307dc); - if ((para->dram_para2 & 0x1000) != 0) { - REG32(0x04830790) = (para->dram_tpr10 >> 0xc & 0xf) << 1; - } - } - } - else { - switch(para->dram_type) { - case 3: - uVar1 = para->dram_tpr10; - for (i = 0; i < 0x20; i = i + 1) { - *(uint *)((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; - } - REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; - REG32(0x048307b8) = (para->dram_tpr10 >> 8 & 0xf) << 1; - REG32(0x048307e0) = REG32(0x048307dc); - if ((para->dram_para2 & 0x1000) != 0) { - REG32(0x04830784) = (para->dram_tpr10 >> 0xc & 0xf) << 1; - } - break; - case 4: - uVar1 = para->dram_tpr10; - for (i = 0; i < 0x20; i = i + 1) { - *(uint *)((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; - } - REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; - REG32(0x04830784) = (para->dram_tpr10 >> 8 & 0xf) << 1; - REG32(0x048307e0) = REG32(0x048307dc); - break; - case 7: - uVar1 = para->dram_tpr10; - for (i = 0; i < 0x20; i = i + 1) { - *(uint *)((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; - } - REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; - REG32(0x04830788) = (para->dram_tpr10 >> 8 & 0xf) << 1; - REG32(0x048307e0) = REG32(0x048307dc); - if ((para->dram_para2 & 0x1000) != 0) { - REG32(0x04830790) = (para->dram_tpr10 >> 0xc & 0xf) << 1; + uint uVar1; + uint chip_id; + uint type; + uint reg_val; + uint i; + + if ((para->dram_tpr10 & 0x10000) != 0) { + if ((REG32(0x03006200) & 0xffff) == 0x800) { + switch (para->dram_type) { + case 3: + uVar1 = para->dram_tpr10; + for (i = 0; i < 0x20; i = i + 1) { + *(uint *) ((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; + } + REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; + REG32(0x048307e4) = (para->dram_tpr10 >> 8 & 0xf) << 1; + REG32(0x048307e0) = REG32(0x048307dc); + if ((para->dram_para2 & 0x1000) != 0) { + REG32(0x04832388) = (para->dram_tpr10 >> 0xc & 0xf) << 1; + } + break; + case 4: + case 7: + break; + case 8: + uVar1 = para->dram_tpr10; + for (i = 0; i < 0x20; i = i + 1) { + *(uint *) ((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; + } + REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; + REG32(0x048307e4) = (para->dram_tpr10 >> 8 & 0xf) << 1; + REG32(0x048307e0) = REG32(0x048307dc); + if ((para->dram_para2 & 0x1000) != 0) { + REG32(0x04830790) = (para->dram_tpr10 >> 0xc & 0xf) << 1; + } + } + } else { + switch (para->dram_type) { + case 3: + uVar1 = para->dram_tpr10; + for (i = 0; i < 0x20; i = i + 1) { + *(uint *) ((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; + } + REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; + REG32(0x048307b8) = (para->dram_tpr10 >> 8 & 0xf) << 1; + REG32(0x048307e0) = REG32(0x048307dc); + if ((para->dram_para2 & 0x1000) != 0) { + REG32(0x04830784) = (para->dram_tpr10 >> 0xc & 0xf) << 1; + } + break; + case 4: + uVar1 = para->dram_tpr10; + for (i = 0; i < 0x20; i = i + 1) { + *(uint *) ((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; + } + REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; + REG32(0x04830784) = (para->dram_tpr10 >> 8 & 0xf) << 1; + REG32(0x048307e0) = REG32(0x048307dc); + break; + case 7: + uVar1 = para->dram_tpr10; + for (i = 0; i < 0x20; i = i + 1) { + *(uint *) ((i + 0x120c1e0) * 4) = (uVar1 >> 4 & 0xf) << 1; + } + REG32(0x048307dc) = (para->dram_tpr10 & 0xf) << 1; + REG32(0x04830788) = (para->dram_tpr10 >> 8 & 0xf) << 1; + REG32(0x048307e0) = REG32(0x048307dc); + if ((para->dram_para2 & 0x1000) != 0) { + REG32(0x04830790) = (para->dram_tpr10 >> 0xc & 0xf) << 1; + } + break; + case 8: + } } - break; - case 8: - } } - } - return; + return; } -