eco32: entry: fix PSW_UP check in SWITCH_TO_KERNEL_STACK

The PSW_UP bit was shifted left instead of right.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: entry: rename LOAD_REGS to RESTORE_REGS

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: add a stub exception handler

This adds a bit of debug information about what exception
occured and dumps the reg contents.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: head: restore $1 before calling page_fault_handler

This path omitted restoring $1, which is clobbered in the
tlbmiss handler.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: entry: omit save/restore of $0

$0 is constant zero, no need to save restore that.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: process: set PSW_UP instead of PSW_UC in start_thread()

PSW will be loaded from regs followed by a rfx, thus we need to
set the bit that will be popped on rfx.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: write 0xc0000000 to unused tlb entries

When the valid bit is not set, accesses to addresses with
matching addresses will cause a TLB invalid exception,
unless the matching address is in the direct map range.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: procees: remove BUG() todo marker

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: add incomplete ret_from_yscall

As the title says, incomplete, but what's actuakky there should
be about correct.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: head: check present bit in pte

Generate a page fault if the present bit isn't set.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
eco32: head: write to random tlb in miss handler

The tbwr instruction will generate a random tlb index and
write what is present in TLB_ENTRY_LOW and TLB_ENTRY_HIGH to
that.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>