kernel arm: Quick style cleanup; No functional change
This commit is contained in:
@@ -100,7 +100,8 @@ void
|
||||
arch_cpu_sync_icache(void *address, size_t len)
|
||||
{
|
||||
uint32 Rd = 0;
|
||||
asm volatile ("mcr p15, 0, %[c7format], c7, c5, 0" : : [c7format] "r" (Rd) );
|
||||
asm volatile ("mcr p15, 0, %[c7format], c7, c5, 0"
|
||||
: : [c7format] "r" (Rd) );
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +124,8 @@ arch_cpu_invalidate_TLB_range(addr_t start, addr_t end)
|
||||
{
|
||||
int32 num_pages = end / B_PAGE_SIZE - start / B_PAGE_SIZE;
|
||||
while (num_pages-- >= 0) {
|
||||
asm volatile ("mcr p15, 0, %[c8format], c8, c6, 1" : : [c8format] "r" (start) );
|
||||
asm volatile ("mcr p15, 0, %[c8format], c8, c6, 1"
|
||||
: : [c8format] "r" (start) );
|
||||
start += B_PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
@@ -132,8 +134,10 @@ arch_cpu_invalidate_TLB_range(addr_t start, addr_t end)
|
||||
void
|
||||
arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages)
|
||||
{
|
||||
for (int i = 0; i < num_pages; i++)
|
||||
asm volatile ("mcr p15, 0, %[c8format], c8, c6, 1" : : [c8format] "r" (pages[i]) );
|
||||
for (int i = 0; i < num_pages; i++) {
|
||||
asm volatile ("mcr p15, 0, %[c8format], c8, c6, 1":
|
||||
: [c8format] "r" (pages[i]) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +145,8 @@ void
|
||||
arch_cpu_global_TLB_invalidate(void)
|
||||
{
|
||||
uint32 Rd = 0;
|
||||
asm volatile ("mcr p15, 0, %[c8format], c8, c7, 0" : : [c8format] "r" (Rd) );
|
||||
asm volatile ("mcr p15, 0, %[c8format], c8, c7, 0"
|
||||
: : [c8format] "r" (Rd) );
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +197,8 @@ error:
|
||||
*/
|
||||
|
||||
ssize_t
|
||||
arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr_t *faultHandler)
|
||||
arch_cpu_user_strlcpy(char *to, const char *from,
|
||||
size_t size, addr_t *faultHandler)
|
||||
{
|
||||
#warning WRITEME
|
||||
/*
|
||||
|
||||
@@ -27,8 +27,9 @@ struct stack_frame {
|
||||
#define NUM_PREVIOUS_LOCATIONS 32
|
||||
|
||||
extern struct iframe_stack gBootFrameStack;
|
||||
/*
|
||||
|
||||
|
||||
/*
|
||||
static bool
|
||||
already_visited(uint32 *visited, int32 *_last, int32 *_num, uint32 framePointer)
|
||||
{
|
||||
|
||||
@@ -100,4 +100,3 @@ arch_debug_console_init_settings(kernel_args *args)
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -347,8 +347,9 @@ arch_elf_relocate_rela(struct elf_image_info *image,
|
||||
|
||||
for (i = 0; i * (int)sizeof(struct Elf32_Rela) < rel_len; i++) {
|
||||
#if CHATTY
|
||||
dprintf("looking at rel type %d, offset 0x%lx, sym 0x%lx, addend 0x%lx\n",
|
||||
ELF32_R_TYPE(rel[i].r_info), rel[i].r_offset, ELF32_R_SYM(rel[i].r_info), rel[i].r_addend);
|
||||
dprintf("looking at rel type %d, offset 0x%lx, "
|
||||
"sym 0x%lx, addend 0x%lx\n", ELF32_R_TYPE(rel[i].r_info),
|
||||
rel[i].r_offset, ELF32_R_SYM(rel[i].r_info), rel[i].r_addend);
|
||||
#endif
|
||||
switch (ELF32_R_TYPE(rel[i].r_info)) {
|
||||
#warning ARM:ADDOTHERREL
|
||||
@@ -363,9 +364,9 @@ arch_elf_relocate_rela(struct elf_image_info *image,
|
||||
if (vlErr < 0) {
|
||||
dprintf("%s(): Failed to relocate "
|
||||
"entry index %d, rel type %d, offset 0x%lx, sym 0x%lx, "
|
||||
"addend 0x%lx\n", __FUNCTION__, i, ELF32_R_TYPE(rel[i].r_info),
|
||||
rel[i].r_offset, ELF32_R_SYM(rel[i].r_info),
|
||||
rel[i].r_addend);
|
||||
"addend 0x%lx\n", __FUNCTION__, i,
|
||||
ELF32_R_TYPE(rel[i].r_info), rel[i].r_offset,
|
||||
ELF32_R_SYM(rel[i].r_info), rel[i].r_addend);
|
||||
return vlErr;
|
||||
}
|
||||
break;
|
||||
@@ -382,12 +383,11 @@ arch_elf_relocate_rela(struct elf_image_info *image,
|
||||
|
||||
default:
|
||||
dprintf("arch_elf_relocate_rela(): unhandled "
|
||||
"relocation type %d!\n",
|
||||
ELF32_R_TYPE(rel[i].r_info));
|
||||
"relocation type %d!\n", ELF32_R_TYPE(rel[i].r_info));
|
||||
return B_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
#warning ARM: FIXME!!!!!!!
|
||||
return B_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include <vm/VMAddressSpace.h>
|
||||
#include <string.h>
|
||||
|
||||
#warning M68K: writeme!
|
||||
|
||||
|
||||
//#define TRACE_ARCH_INT
|
||||
#ifdef TRACE_ARCH_INT
|
||||
@@ -99,13 +97,17 @@ arch_int_disable_io_interrupt(int irq)
|
||||
static void
|
||||
print_iframe(struct iframe *frame)
|
||||
{
|
||||
/*
|
||||
dprintf("r0-r3: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r0, frame->r1, frame->r2, frame->r3);
|
||||
dprintf("r4-r7: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r4, frame->r5, frame->r6, frame->r7);
|
||||
dprintf("r8-r11: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r8, frame->r9, frame->r10, frame->r11);
|
||||
dprintf("r12-r15: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r12, frame->r13, frame->a6, frame->a7);
|
||||
#if 0
|
||||
dprintf("r0-r3: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r0, frame->r1,
|
||||
frame->r2, frame->r3);
|
||||
dprintf("r4-r7: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r4, frame->r5,
|
||||
frame->r6, frame->r7);
|
||||
dprintf("r8-r11: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r8, frame->r9,
|
||||
frame->r10, frame->r11);
|
||||
dprintf("r12-r15: 0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", frame->r12, frame->r13,
|
||||
frame->a6, frame->a7);
|
||||
dprintf(" pc 0x%08lx sr 0x%08lx\n", frame->pc, frame->sr);
|
||||
*/
|
||||
#endif
|
||||
|
||||
#warning ARM WRITEME
|
||||
}
|
||||
@@ -114,19 +116,21 @@ print_iframe(struct iframe *frame)
|
||||
status_t
|
||||
arch_int_init(kernel_args *args)
|
||||
{
|
||||
#if 0
|
||||
status_t err;
|
||||
addr_t vbr;
|
||||
int i;
|
||||
|
||||
// gExceptionVectors = (m68k_exception_handler *)args->arch_args.vir_vbr;
|
||||
gExceptionVectors = (m68k_exception_handler *)args->arch_args.vir_vbr;
|
||||
|
||||
/* fill in the vector table */
|
||||
// for (i = 0; i < M68K_EXCEPTION_VECTOR_COUNT; i++)
|
||||
// gExceptionVectors[i] = &__m68k_exception_common;
|
||||
for (i = 0; i < M68K_EXCEPTION_VECTOR_COUNT; i++)
|
||||
gExceptionVectors[i] = &__m68k_exception_common;
|
||||
|
||||
// vbr = args->arch_args.phys_vbr;
|
||||
vbr = args->arch_args.phys_vbr;
|
||||
/* point VBR to the new table */
|
||||
// asm volatile ("movec %0,%%vbr" : : "r"(vbr):);
|
||||
asm volatile ("movec %0,%%vbr" : : "r"(vbr):);
|
||||
#endif
|
||||
#warning ARM WRITEME
|
||||
|
||||
return B_OK;
|
||||
@@ -159,5 +163,3 @@ arch_int_init_post_device_manager(struct kernel_args *args)
|
||||
|
||||
return B_ENTRY_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
#include <real_time_clock.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
/*
|
||||
|
||||
#if 0
|
||||
static M68KPlatform *sM68KPlatform;
|
||||
|
||||
|
||||
@@ -29,11 +30,13 @@ M68KPlatform::M68KPlatform(platform_type platformType,
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// destructor
|
||||
M68KPlatform::~M68KPlatform()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Default
|
||||
M68KPlatform *
|
||||
M68KPlatform::Default()
|
||||
@@ -43,13 +46,12 @@ M68KPlatform::Default()
|
||||
|
||||
|
||||
// # pragma mark -
|
||||
*/
|
||||
#endif
|
||||
|
||||
status_t
|
||||
arch_platform_init(struct kernel_args *kernelArgs)
|
||||
{
|
||||
#warning ARM:WRITEME
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -57,9 +59,9 @@ arch_platform_init(struct kernel_args *kernelArgs)
|
||||
status_t
|
||||
arch_platform_init_post_vm(struct kernel_args *kernelArgs)
|
||||
{
|
||||
return B_OK;
|
||||
#warning ARM:WRITEME
|
||||
//sM68KPlatform->InitPostVM(kernelArgs);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include <arch/real_time_clock.h>
|
||||
|
||||
#include <real_time_clock.h>
|
||||
#include <real_time_data.h>
|
||||
#include <smp.h>
|
||||
|
||||
|
||||
status_t
|
||||
arch_rtc_init(kernel_args *args, struct real_time_data *data)
|
||||
{
|
||||
|
||||
@@ -43,4 +43,3 @@ arch_smp_send_broadcast_ici()
|
||||
{
|
||||
panic("called arch_smp_send_broadcast_ici\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include <arch_cpu.h>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#warning M68K: writeme!
|
||||
|
||||
// Valid initial arch_thread state. We just memcpy() it when initializing
|
||||
// a new thread structure.
|
||||
static struct arch_thread sInitialState;
|
||||
@@ -82,17 +82,20 @@ arch_thread_init_tls(Thread *thread)
|
||||
void
|
||||
arch_thread_context_switch(Thread *from, Thread *to)
|
||||
{
|
||||
/* addr_t newPageDirectory;
|
||||
#if 0
|
||||
addr_t newPageDirectory;
|
||||
|
||||
newPageDirectory = (addr_t)m68k_next_page_directory(from, to);
|
||||
|
||||
if ((newPageDirectory % B_PAGE_SIZE) != 0)
|
||||
panic("arch_thread_context_switch: bad pgdir 0x%lx\n", newPageDirectory);
|
||||
panic("arch_thread_context_switch: bad pgdir 0x%lx\n",
|
||||
newPageDirectory);
|
||||
#warning M68K: export from arch_vm.c
|
||||
m68k_set_pgdir(newPageDirectory);
|
||||
m68k_context_switch(&from->arch_info.sp, to->arch_info.sp);*/
|
||||
#warning ARM:WRITEME
|
||||
m68k_context_switch(&from->arch_info.sp, to->arch_info.sp);
|
||||
#endif
|
||||
|
||||
#warning ARM:WRITEME
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +109,8 @@ arch_thread_dump_info(void *info)
|
||||
|
||||
|
||||
status_t
|
||||
arch_thread_enter_userspace(Thread *thread, addr_t entry, void *arg1, void *arg2)
|
||||
arch_thread_enter_userspace(Thread *thread, addr_t entry,
|
||||
void *arg1, void *arg2)
|
||||
{
|
||||
panic("arch_thread_enter_uspace(): not yet implemented\n");
|
||||
return B_ERROR;
|
||||
@@ -145,7 +149,6 @@ arch_check_syscall_restart(Thread *thread)
|
||||
* arch_fork_arg structure to be passed to arch_restore_fork_frame().
|
||||
* Also makes sure to return the right value.
|
||||
*/
|
||||
|
||||
void
|
||||
arch_store_fork_frame(struct arch_fork_arg *arg)
|
||||
{
|
||||
@@ -159,9 +162,7 @@ arch_store_fork_frame(struct arch_fork_arg *arg)
|
||||
* This function does not return to the caller, but will enter userland
|
||||
* in the child team at the same position where the parent team left of.
|
||||
*/
|
||||
|
||||
void
|
||||
arch_restore_fork_frame(struct arch_fork_arg *arg)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ void
|
||||
arch_timer_set_hardware_timer(bigtime_t timeout)
|
||||
{
|
||||
#warning ARM:WRITEME
|
||||
|
||||
// M68KPlatform::Default()->SetHardwareTimer(timeout);
|
||||
}
|
||||
|
||||
@@ -40,8 +39,7 @@ int
|
||||
arch_init_timer(kernel_args *args)
|
||||
{
|
||||
#warning ARM:WRITEME
|
||||
|
||||
return 0;
|
||||
// M68KPlatform::Default()->InitTimer(args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
|
||||
#warning ARM: WRITEME
|
||||
|
||||
|
||||
void
|
||||
arch_clear_team_debug_info(struct arch_team_debug_info *info)
|
||||
{
|
||||
@@ -65,7 +67,6 @@ arch_get_thread_debug_cpu_state(Thread *thread, debug_cpu_state *cpuState)
|
||||
}
|
||||
|
||||
|
||||
|
||||
status_t
|
||||
arch_set_breakpoint(void *address)
|
||||
{
|
||||
@@ -93,6 +94,7 @@ arch_clear_watchpoint(void *address)
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
arch_has_breakpoints(struct arch_team_debug_info *info)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
|
||||
#include <kernel.h>
|
||||
@@ -27,7 +28,8 @@
|
||||
# define TRACE(x) ;
|
||||
#endif
|
||||
|
||||
#warning M68K: WRITEME
|
||||
#warning ARM: WRITEME
|
||||
|
||||
|
||||
status_t
|
||||
arch_vm_init(kernel_args *args)
|
||||
@@ -43,7 +45,7 @@ arch_vm_init2(kernel_args *args)
|
||||
// int i;
|
||||
|
||||
/**/
|
||||
#warning M68K: disable TT0 and TT1, set up pmmu
|
||||
#warning ARM: WRITEME
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
@@ -59,8 +61,7 @@ arch_vm_init_post_area(kernel_args *args)
|
||||
status_t
|
||||
arch_vm_init_end(kernel_args *args)
|
||||
{
|
||||
|
||||
#warning M68K: unset TT0 now
|
||||
#warning ARM: WRITEME
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ arch_vm_translation_map_init(kernel_args *args,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if B_HAIKU_PHYSICAL_BITS == 64 //IRA: Check all 64 bit code and adjust for ARM
|
||||
#if B_HAIKU_PHYSICAL_BITS == 64 //IRA: Check 64 bit code and adjust for ARM
|
||||
bool paeAvailable = x86_check_feature(IA32_FEATURE_PAE, FEATURE_COMMON);
|
||||
bool paeNeeded = false;
|
||||
for (uint32 i = 0; i < args->num_physical_memory_ranges; i++) {
|
||||
|
||||
@@ -20,35 +20,45 @@
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include <debug.h>
|
||||
#include <arch/arm/reg.h>
|
||||
#include <arch/arm/uart.h>
|
||||
#include <board_config.h>
|
||||
//#include <target/debugconfig.h>
|
||||
|
||||
|
||||
#define DEBUG_UART BOARD_DEBUG_UART
|
||||
|
||||
|
||||
struct uart_stat {
|
||||
addr_t base;
|
||||
uint shift;
|
||||
};
|
||||
|
||||
|
||||
static struct uart_stat uart[3] = {
|
||||
{ BOARD_UART1_BASE, 2 },
|
||||
{ BOARD_UART2_BASE, 2 },
|
||||
{ BOARD_UART3_BASE, 2 },
|
||||
};
|
||||
|
||||
|
||||
static inline void write_uart_reg(int port, uint reg, unsigned char data)
|
||||
{
|
||||
*(volatile unsigned char *)(uart[port].base + (reg << uart[port].shift)) = data;
|
||||
*(volatile unsigned char *)(uart[port].base + (reg << uart[port].shift))
|
||||
= data;
|
||||
}
|
||||
|
||||
|
||||
static inline unsigned char read_uart_reg(int port, uint reg)
|
||||
{
|
||||
return *(volatile unsigned char *)(uart[port].base + (reg << uart[port].shift));
|
||||
return *(volatile unsigned char *)(uart[port].base
|
||||
+ (reg << uart[port].shift));
|
||||
}
|
||||
|
||||
|
||||
#define LCR_8N1 0x03
|
||||
|
||||
#define FCR_FIFO_EN 0x01 /* Fifo enable */
|
||||
@@ -87,6 +97,7 @@ static inline unsigned char read_uart_reg(int port, uint reg)
|
||||
|
||||
#define V_NS16550_CLK (48000000) /* 48MHz (APLL96/2) */
|
||||
|
||||
|
||||
int uart_debug_port(void)
|
||||
{
|
||||
return DEBUG_UART;
|
||||
@@ -111,6 +122,7 @@ void uart_init_port(int port, uint baud)
|
||||
// write_uart_reg(port, UART_LCR, LCRVAL); // operational mode
|
||||
}
|
||||
|
||||
|
||||
void uart_init_early(void)
|
||||
{
|
||||
#if BOARD_CPU_OMAP3
|
||||
@@ -129,28 +141,29 @@ void uart_init_early(void)
|
||||
#warning INTITIALIZE UART!!!!!
|
||||
#endif
|
||||
|
||||
|
||||
uart_init_port(DEBUG_UART, 115200);
|
||||
}
|
||||
|
||||
|
||||
void uart_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int uart_putc(int port, char c )
|
||||
{
|
||||
|
||||
while (!(read_uart_reg(port, UART_LSR) & (1<<6))) // wait for the last char to get out
|
||||
;
|
||||
while (!(read_uart_reg(port, UART_LSR) & (1<<6)));
|
||||
// wait for the last char to get out
|
||||
write_uart_reg(port, UART_THR, c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int uart_getc(int port, bool wait) /* returns -1 if no data available */
|
||||
{
|
||||
if (wait) {
|
||||
while (!(read_uart_reg(port, UART_LSR) & (1<<0))) // wait for data to show up in the rx fifo
|
||||
;
|
||||
while (!(read_uart_reg(port, UART_LSR) & (1<<0)));
|
||||
// wait for data to show up in the rx fifo
|
||||
} else {
|
||||
if (!(read_uart_reg(port, UART_LSR) & (1<<0)))
|
||||
return -1;
|
||||
@@ -158,12 +171,14 @@ int uart_getc(int port, bool wait) /* returns -1 if no data available */
|
||||
return read_uart_reg(port, UART_RHR);
|
||||
}
|
||||
|
||||
|
||||
void uart_flush_tx(int port)
|
||||
{
|
||||
while (!(read_uart_reg(port, UART_LSR) & (1<<6))) // wait for the last char to get out
|
||||
;
|
||||
while (!(read_uart_reg(port, UART_LSR) & (1<<6)));
|
||||
// wait for the last char to get out
|
||||
}
|
||||
|
||||
|
||||
void uart_flush_rx(int port)
|
||||
{
|
||||
// empty the rx fifo
|
||||
@@ -172,5 +187,3 @@ void uart_flush_rx(int port)
|
||||
(void)c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user