--- zzzz-none-000/linux-2.6.19.2/init/main.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/init/main.c 2008-07-14 12:52:31.000000000 +0000 @@ -56,6 +56,13 @@ #include #include +#ifdef CONFIG_MIPS_UR8 +#include +#include +#include +#include +#endif + #ifdef CONFIG_X86_LOCAL_APIC #include #endif @@ -101,10 +108,15 @@ #ifdef CONFIG_TC extern void tc_init(void); #endif +extern void grsecurity_init(void); enum system_states system_state; EXPORT_SYMBOL(system_state); +#ifdef CONFIG_AVM_LED +extern int avm_led_load_config(void); +#endif /*--- #ifdef CONFIG_AVM_LED ---*/ + /* * Boot command-line arguments */ @@ -171,6 +183,15 @@ __setup("reset_devices", set_reset_devices); +#ifdef CONFIG_PAX_SOFTMODE +static int __init setup_pax_softmode(char *str) +{ + get_option(&str, &pax_softmode); + return 1; +} +__setup("pax_softmode=", setup_pax_softmode); +#endif + static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; static const char *panic_later, *panic_param; @@ -480,6 +501,14 @@ char * command_line; extern struct kernel_param __start___param[], __stop___param[]; +#ifdef CONFIG_MIPS_UR8 + /*--- union _hw_non_reset *RESET = (union _hw_non_reset *)UR8_RESET_BASE; ---*/ + /*--- RESET->Bits.nwss_unreset = 0; ---*/ + struct ur8_queue_manager *NWSS = (struct ur8_queue_manager *) UR8_NWSS_QUEUE; + + NWSS->soft_reset = 1; + +#endif smp_setup_processor_id(); /* @@ -754,6 +783,8 @@ prepare_namespace(); } + grsecurity_init(); + /* * Ok, we have completed the initial bootup, and * we're essentially up and running. Get rid of the @@ -768,6 +799,10 @@ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) printk(KERN_WARNING "Warning: unable to open an initial console.\n"); +#if defined(CONFIG_AVM_LED) && (defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8)) + avm_led_load_config(); /* HACK! Find a better point to start it! */ +#endif /*--- #if defined(CONFIG_AVM_LED) && (defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8)) ---*/ + (void) sys_dup(0); (void) sys_dup(0); @@ -777,6 +812,19 @@ ramdisk_execute_command); } +#if defined(CONFIG_MIPS_UR8) + { + int envs = 0; + while (envs < MAX_INIT_ARGS && envp_init[envs]) envs++; + if (envs < MAX_INIT_ARGS) { + static char reset_status[] = "reset_status=0"; + reset_status[13] = avm_reset_status() + 0x30; + envp_init[envs] = reset_status; + envp_init[envs+1] = NULL; + } + } +#endif /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ + /* * We try each of these until one succeeds. *