From 5deb3317cb51ac52de922bb55f8492624018906d Mon Sep 17 00:00:00 2001 From: Roman Yeryomin Date: Thu, 13 Sep 2012 00:40:35 +0300 Subject: Add realtek target files Signed-off-by: Roman Yeryomin --- .../realtek/patches-2.6.30/005-tls-support.diff | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 target/linux/realtek/patches-2.6.30/005-tls-support.diff (limited to 'target/linux/realtek/patches-2.6.30/005-tls-support.diff') diff --git a/target/linux/realtek/patches-2.6.30/005-tls-support.diff b/target/linux/realtek/patches-2.6.30/005-tls-support.diff new file mode 100644 index 000000000..2b3ce831d --- /dev/null +++ b/target/linux/realtek/patches-2.6.30/005-tls-support.diff @@ -0,0 +1,78 @@ +Index: linux-2.6.30.9/arch/rlx/kernel/traps.c +=================================================================== +--- linux-2.6.30.9.orig/arch/rlx/kernel/traps.c 2011-12-04 15:31:07.000000000 +0000 ++++ linux-2.6.30.9/arch/rlx/kernel/traps.c 2011-12-04 15:31:39.000000000 +0000 +@@ -451,6 +451,55 @@ + } + #endif + ++ ++/* ++ * Simulate trapping 'rdhwr' instructions to provide user accessible ++ * registers not implemented in hardware. ++ */ ++static int simulate_rdhwr(struct pt_regs *regs, unsigned int opcode) ++{ ++ struct thread_info *ti = task_thread_info(current); ++ ++ if ((opcode & OPCODE) == SPEC3 && (opcode & FUNC) == RDHWR) { ++ int rd = (opcode & RD) >> 11; ++ int rt = (opcode & RT) >> 16; ++ switch (rd) { ++ case 0: /* CPU number */ ++ regs->regs[rt] = smp_processor_id(); ++ return 0; ++ case 1: /* SYNCI length */ ++ regs->regs[rt] = min(current_cpu_data.dcache.linesz, ++ current_cpu_data.icache.linesz); ++ return 0; ++ case 2: /* Read count register */ ++ regs->regs[rt] = read_c0_count(); ++ return 0; ++ case 3: /* Count register resolution */ ++ switch (current_cpu_data.cputype) { ++#if 0 ++ case CPU_20KC: ++ case CPU_25KF: ++ regs->regs[rt] = 1; ++ break; ++#endif ++ default: ++ regs->regs[rt] = 2; ++ } ++ return 0; ++ case 29: ++ regs->regs[rt] = ti->tp_value; ++ return 0; ++ default: ++ return -1; ++ } ++ } ++ ++ /* Not ours. */ ++ return -1; ++} ++ ++ ++ + #ifndef CONFIG_CPU_HAS_SYNC + static int simulate_sync(struct pt_regs *regs, unsigned int opcode) + { +@@ -567,7 +616,7 @@ + status = simulate_llsc(regs, opcode); + #endif + +-#if 0 ++#if 1 + if (status < 0) + status = simulate_rdhwr(regs, opcode); + #endif +@@ -616,7 +665,7 @@ + status = simulate_llsc(regs, opcode); + #endif + +-#if 0 ++#if 1 + if (status < 0) + status = simulate_rdhwr(regs, opcode); + #endif -- cgit v1.2.3