Index: sw/rvl/os/di/dvd_driver.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/di/dvd_driver.c,v retrieving revision 1.53 retrieving revision 1.53.4.1 diff -r1.53 -r1.53.4.1 1c1 < #ident "$Id: dvd_driver.c,v 1.53 2008/01/27 07:21:00 cnguyen Exp $" --- > #ident "$Id: dvd_driver.c,v 1.53.4.1 2008/04/24 18:17:16 cnguyen Exp $" 454a455,464 > case DI_GET_CONTROL_REGISTER_CMD: > DPRINT("Doing DI_GET_CONTROL_REGISTER_CMD\n"); > if (ioctlMesg->outLen < sizeof(u32)) { > ioctlReturn = DVD_INTTYPE_SECURITY_ERROR; > } > else { > * (u32 *) ioctlMesg->outPtr = readDIRegister(DI_CONTROL_ADDR); > } > break; > 857a868,871 > #if !defined(BOOT_CACHE) > return(DVD_INTTYPE_CALLER); > #endif > 932a947,950 > #if !defined(BOOT_CACHE) > return(DVD_INTTYPE_CALLER); > #endif > 1056a1075,1078 > #if !defined(BOOT_CACHE) > return(DVD_INTTYPE_CALLER); > #endif > Index: sw/rvl/os/di/dvd_hw.h =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/di/dvd_hw.h,v retrieving revision 1.17 retrieving revision 1.17.10.1 diff -r1.17 -r1.17.10.1 1c1 < #ident "$Id: dvd_hw.h,v 1.17 2007/04/10 02:52:04 craig Exp $" --- > #ident "$Id: dvd_hw.h,v 1.17.10.1 2008/04/24 18:18:37 cnguyen Exp $" 103a104 > #define DI_GET_CONTROL_REGISTER_CMD 0x96 Index: sw/rvl/os/di/dvd_low.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/di/dvd_low.c,v retrieving revision 1.66 retrieving revision 1.66.4.1 diff -r1.66 -r1.66.4.1 1c1 < #ident "$Id: dvd_low.c,v 1.66 2008/01/23 20:59:05 cnguyen Exp $" --- > #ident "$Id: dvd_low.c,v 1.66.4.1 2008/04/24 18:19:55 cnguyen Exp $" 570a571,574 > > /* Make sure main DI interrupt is enabled */ > IOS_ClearAndEnableDIIntr(); > 1097c1101,1102 < else if (isErrorInterruptSet()) { --- > /* Need to check for error interrupt as well */ > if (isErrorInterruptSet()) { 1269,1270c1274,1275 < diCommand_t diCommand; < u32 commandResult; --- > // diCommand_t diCommand; > // u32 commandResult; 1274,1277c1279,1284 < diCommand.theCommand = DI_REQUEST_ERROR_CMD; < < commandResult = handleDiCommand(&diCommand, wordArray, sizeof(wordArray)); < return(commandResult); --- > // there is no need to issue request error command. > // diCommand.theCommand = DI_REQUEST_ERROR_CMD; > // > // commandResult = handleDiCommand(&diCommand, wordArray, sizeof(wordArray)); > // return(commandResult); > return DI_ERR_NO_ERROR; Index: sw/rvl/os/ios/Makefile =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/ios/Makefile,v retrieving revision 1.50 retrieving revision 1.50.4.2 diff -r1.50 -r1.50.4.2 7c7 < # To transition to use ios_crypto as the default IOS, ios.elf is now --- > # To transition to use ios_crypto as the default IOS, ios_real.elf is now 12a13 > OS_CSL = ios_csl.elf 13a15 > OS_REAL_CSL = ios_real_csl.elf 15a18 > OS_PROFILE = ios_profile.elf 23,24c26,28 < OS_TARGETS = $(OS) $(OS_CRYPTO) $(OS_REAL) $(BOOT2_OS_REAL) \ < $(OS_SKIPEF) $(PROD_OS_REAL) $(PROD_BOOT2_OS_REAL) --- > OS_TARGETS = $(OS) $(OS_CRYPTO) $(OS_REAL) $(OS_PROFILE) $(BOOT2_OS_REAL) \ > $(OS_SKIPEF) $(PROD_OS_REAL) $(PROD_BOOT2_OS_REAL) \ > $(OS_CSL) $(OS_REAL_CSL) 33d36 < except.s \ 105a109,111 > thread_profile.o: thread.c > $(CC) -mlong-calls -DENABLE_CRYPTO -DENABLE_ELF_MERGE -DENABLE_THREAD_PROFILE $(CFLAGS) -c $^ -o $@ > 108a115,117 > except_profile.o: except.s > $(AS) -DENABLE_THREAD_PROFILE $(ASFLAGS) -c $^ -o $@ > 209c218 < CRYPTO_OBJS = init.o initc_crypto.o swi_crypto.o thread_crypto.o version.o root_devel.o nvram.o keyglobals.o $(OBJECTS) --- > CRYPTO_OBJS = init.o initc_crypto.o swi_crypto.o thread_crypto.o version.o root_devel.o nvram.o keyglobals.o except.o $(OBJECTS) 215a225,228 > # Real image with crypto, cslrsa and shell > $(OS_CSL): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa.o shell_objs $(CRYPTO_OBJS) > $(CC) $(CFLAGS) -o $(OS_CSL) $(CRYPTO_OBJS) crypto_tmp/*.o shell_tmp/*.o $(LDFLAGS) $(LDLIBS) -T $(CRYPTO_LINKER_FILE) > 217c230 < IOS_OBJS = init.o swi.o initc.o thread.o version.o nvram.o $(OBJECTS) --- > IOS_OBJS = init.o swi.o initc.o thread.o version.o nvram.o except.o $(OBJECTS) 222c235 < NOSHELL_OBJS = init.o swi.o initc.o thread_noshell.o version.o nvram.o $(OBJECTS) --- > NOSHELL_OBJS = init.o swi.o initc.o thread_noshell.o version.o nvram.o except.o $(OBJECTS) 227c240 < REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_real.o version.o root_devel.o nvram.o keyglobals.o $(OBJECTS) --- > REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_real.o version.o root_devel.o nvram.o keyglobals.o except.o $(OBJECTS) 230a244,252 > # Real image with crypto, cslrsa and no shell > $(OS_REAL_CSL): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa.o $(REAL_OBJS) > $(CC) $(CFLAGS) -o $(OS_REAL_CSL) $(REAL_OBJS) crypto_tmp/*.o $(LDFLAGS) $(LDLIBS) -T $(CRYPTO_LINKER_FILE) > > # Real image with crypto, profile and no shell > PROFILE_OBJS = init.o initc_crypto.o swi_crypto.o thread_profile.o version.o root_devel.o nvram.o keyglobals.o except_profile.o $(OBJECTS) > $(OS_PROFILE): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa_dev.o $(PROFILE_OBJS) > $(CC) $(CFLAGS) -o $(OS_PROFILE) $(PROFILE_OBJS) crypto_tmp/*.o $(LDFLAGS) $(LDLIBS) -T $(CRYPTO_LINKER_FILE) > 232c254 < SKIPEF_OBJS = init.o initc_crypto.o swi_crypto.o thread_real.o version.o root_prod.o nvram_skipef.o keyglobals.o $(OBJECTS) --- > SKIPEF_OBJS = init.o initc_crypto.o swi_crypto.o thread_real.o version.o root_prod.o nvram_skipef.o keyglobals.o except.o $(OBJECTS) 237c259 < BOOT2_REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_real.o version_boot2.o root_devel.o nvram.o keyglobals.o $(OBJECTS) --- > BOOT2_REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_real.o version_boot2.o root_devel.o nvram.o keyglobals.o except.o $(OBJECTS) 242c264 < PROD_REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_prod.o version.o root_prod.o nvram_prod.o keyglobals.o $(OBJECTS) --- > PROD_REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_prod.o version.o root_prod.o nvram_prod.o keyglobals.o except.o $(OBJECTS) 247c269 < PROD_BOOT2_REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_prod.o version_boot2.o root_prod.o nvram_prod.o keyglobals.o $(OBJECTS) --- > PROD_BOOT2_REAL_OBJS = init.o initc_crypto.o swi_crypto.o thread_prod.o version_boot2.o root_prod.o nvram_prod.o keyglobals.o except.o $(OBJECTS) Index: sw/rvl/os/ios/ipcsrv.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/ios/ipcsrv.c,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -r1.24 -r1.24.2.1 44c44 < if (!REGION_IN_RANGE((u32)ptr, (u32)(ptr+ len) , \ --- > if (!REGION_IN_RANGE((u32)ptr, (u32)((u32)ptr + len) , \ 46c46 < && !REGION_IN_RANGE((u32)ptr, (u32) (ptr + len), \ --- > && !REGION_IN_RANGE((u32)ptr, (u32) ((u32)ptr + len), \ Index: sw/rvl/os/ios/thread.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/ios/thread.c,v retrieving revision 1.83 retrieving revision 1.83.4.2 diff -r1.83 -r1.83.4.2 580,581c580,584 < printf("Num scheduled: %d (%d%%)\n", t->numScheduled, t->numScheduled*100/__totalScheduled); < printf("Time scheduled: %d (%d%%), %d/iter\n", t->timeScheduled, t->timeScheduled*100/__totalTimeScheduled, t->timeScheduled/t->numScheduled); --- > printf("Num scheduled: %u (%d%%)\n", t->numScheduled, > (u32)(t->numScheduled*100/__totalScheduled)); > printf("Time scheduled: %u (%d%%), %d/iter\n", t->timeScheduled, > (u32)(t->timeScheduled*100/__totalTimeScheduled), > t->timeScheduled/t->numScheduled); 593a597 > /* Thread 0 is used to capture IRQs profiling data */ 610a615 > 614a620,642 > > static void > __printThreadProfiles() > { > u32 i; > > for (i = 0; i < IOS_THREAD_MAX; ++i) { > IOSThread *t = __threads + i; > /* Only print threads that are active and have been scheduled */ > if ((t->state != IOS_STATE_FREE) && > (t->numScheduled > 0 )) { > printf("* T %2d: S:%1d Pri:%3d PID:%3d (%7s)" > " Sched:%7u (%2d%%) Time:%9u (%2d%%), %3d/iter\n", > i, t->state, t->priority, t->pid, > __processes[t->pid], t->numScheduled, > (u32)(t->numScheduled/(__totalScheduled/100)), > t->timeScheduled, > (u32)(t->timeScheduled/(__totalTimeScheduled/100)), > t->timeScheduled/t->numScheduled); > } /* if */ > } /* for */ > } > 616c644 < __iosPerfIoctlv(IOSResourceRequest *req) --- > __iosProfIoctlv(IOSResourceRequest *req) 622d649 < extern void iosGetUsage(u32 usage); 624a652 > printf("IOS Profile: RESET(%d)\n", args->cmd); 631a660 > printf("IOS Profile: START(%d)\n", args->cmd); 636a666 > printf("IOS Profile: STOP(%d)\n", args->cmd); 640c670,709 < iosGetUsage(1); --- > printf("IOS Profile: DUMP(%d)\n", args->cmd); > > __totalScheduled = 0; > __totalTimeScheduled = 0; > /* Thread 0 is used to capture IRQs profiling data */ > for (i = 0; i < IOS_THREAD_MAX; ++i) { > IOSThread *t = __threads + i; > __totalScheduled = __totalScheduled + t->numScheduled; > __totalTimeScheduled = __totalTimeScheduled + t->timeScheduled; > } > printf("\nTotal Scheduled: 0x%llx, Total Time Scheduled: 0x%llx\n", > __totalScheduled, __totalTimeScheduled); > > if (args->writeCount > 0) { > void *buf = args->vector[0].base; > u32 size = args->vector[0].length; > > printf("-> Args: buf: 0x%x size: %d\n", buf, size); > > /* Copy thread profile info to valid user buffer */ > if ((buf != NULL) && > (size >= (IOS_THREAD_MAX * sizeof(IOSThreadProfile)))) { > IOSThreadProfile *p = (IOSThreadProfile *)buf; > for (i = 0; i < IOS_THREAD_MAX; ++i) { > IOSThread *t = __threads + i; > p = (IOSThreadProfile *)(buf+(i*sizeof(IOSThreadProfile))); > if (t->state != IOS_STATE_FREE) { > p->pid = t->pid; > p->priority = t->priority; > p->state = t->state; > p->numScheduled = t->numScheduled; > p->timeScheduled = t->timeScheduled; > > } /* if */ > } /* for */ > } /* if */ > } /* if */ > > __printThreadProfiles(); > 646a716 > 656c726 < /* Create queue and register for perf rm requests */ --- > /* Create queue and register for profile rm requests */ 658c728 < __iosPanic("Unable to create perf rm queue: %d\n", mq); --- > __iosPanic("Unable to create profile rm queue: %d\n", mq); 660,661c730,731 < if ((rv = iosRegisterResourceManager("/dev/perf", mq)) != IOS_ERROR_OK) { < __iosPanic("Unable to register resource manager: %d\n", rv); --- > if ((rv = iosRegisterResourceManager("/dev/prof", mq)) != IOS_ERROR_OK) { > __iosPanic("Unable to register profile resource manager: %d\n", rv); 670,671c740,741 < printf("got an IOS_OPEN\n"); < if (memcmp(req->args.open.path, "/dev/perf", sizeof("/dev/perf"))) { --- > printf("IOS Profile: OPEN\n"); > if (memcmp(req->args.open.path, "/dev/prof", sizeof("/dev/prof"))) { 681,682c751 < printf("got an IOS_IOCTLV\n"); < rv = __iosPerfIoctlv(req); --- > rv = __iosProfIoctlv(req); 688d756 < printf("returning: %d\n", rv); 997c1065 < printf("Use threads[0] as irq\n"); --- > printf("IOS Profile: Use threads[0] as irq\n"); Index: sw/rvl/os/ios/thread.h =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/ios/thread.h,v retrieving revision 1.20 retrieving revision 1.20.6.1 diff -r1.20 -r1.20.6.1 88a89,98 > #if defined(ENABLE_THREAD_PROFILE) > typedef struct _IOSThreadProfile { > u32 pid; > s32 priority; > u32 state; > u32 numScheduled; > u32 timeScheduled; > } IOSThreadProfile; > #endif > Index: sw/rvl/os/mini_ios/compat_thread.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/mini_ios/compat_thread.c,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -r1.8 -r1.8.4.1 594,706d593 < /* do minimal check on the program header table, returns its length. */ < static u32 < __checkProgramHeaders(const Elf32_Phdr* phdr) < { < if (phdr->p_type != PT_PHDR || < (u32)phdr != phdr->p_vaddr || < phdr->p_vaddr != phdr->p_paddr || < (phdr->p_memsz/sizeof(Elf32_Phdr)) < 2) { < return 0; < } < < u32 n = phdr->p_memsz / sizeof(Elf32_Phdr); < int i; < < /* minimal consistency check */ < for (i = 1; i < n; ++i) { < if (phdr[i].p_type == PT_LOAD || phdr[i].p_type == PT_NOTE) { < if (/*phdr[i].p_vaddr != phdr[i].p_paddr ||*/ < phdr[i].p_memsz < phdr[i].p_filesz || < (phdr[i].p_vaddr & (phdr[i].p_align - 1))) { < return 0; < } < } < } < return n; < } /* __checkProgramHeaders */ < < static const Elf32_auxv_t* < __getEntryPoints(const Elf32_Phdr* phdr, u32* num_entries) < { < *num_entries = 0; < < /* The PT_NOTE (4) segment, if present, must be the second entry. */ < ++phdr; < if (phdr->p_type != PT_NOTE || (phdr->p_vaddr & 0x3)) { < return NULL; < } < < /* < * See The Elf spec for the definition of the note section. In short, < * word #1: name size (which we ignore) < * word #2: descriptor size in bytes < * word #3: note type < * word #4- : name string padded to word boundary < * after the name string is the entry point vector. < */ < < u32* note_desc = (u32*) phdr->p_vaddr; < if (note_desc[2] != NT_AUXV) < return NULL; < *num_entries = note_desc[1] / sizeof(Elf32_auxv_t); < < return (const Elf32_auxv_t*) < (note_desc + 3 + ((note_desc[0] + 3) / sizeof(u32))); < < } /* __getEntryPoints */ < static void < __iosInitOSThreads(void) < { < const Elf32_Phdr* phdr = (const Elf32_Phdr*) SHARED_SP_START; < u32 segLen = __checkProgramHeaders(phdr); < int i; < < /* set up all memory segments */ < for (i = 1; i < segLen; ++i) { < if (phdr[i].p_type != PT_LOAD) { < continue; < } < < /* skip kernel segment */ < if ((phdr[i].p_flags & PF_MASKOS) == 0) { < continue; < } < < /* skip shared heap region */ < if (phdr[i].p_vaddr == SHARED_SP_START) { < continue; < } < < < printf("load segment @ [%08x, %08x] (%d bytes)\n", phdr[i].p_vaddr, phdr[i].p_vaddr+phdr[i].p_memsz, phdr[i].p_memsz); < < if (phdr[i].p_memsz > phdr[i].p_filesz) { < memset((void*) (phdr[i].p_vaddr + phdr[i].p_filesz), < 0, < phdr[i].p_memsz - phdr[i].p_filesz); < } < } < /* Look for the entry point vector, if present */ < u32 ev_size; < const Elf32_auxv_t* ev = < __getEntryPoints((const Elf32_Phdr*) SHARED_SP_START, &ev_size); < < for (i = 0; i < ev_size; i += 5) { < if (i + 1 >= ev_size) { < break; < } < < u32 pid = ev[i].a_un.a_val & 0xff; < void* entry = (void *)((u32)(ev[i+1].a_un.a_ptr)); < u32 priority = ev[i+2].a_un.a_val; < u32 stackSize = ev[i+3].a_un.a_val; < void *stackPtr = (void *)ev[i+4].a_un.a_ptr; < printf("priority = %d, stackSize = %d, stackPtr = %08x\n", priority, stackSize, stackPtr); < /* Create thread */ < printf("starting thread entry: 0x%08x\n", entry); < u32 id = iosCreateThread((IOSEntryProc) entry, (void*)pid, stackPtr, stackSize, priority, IOS_THREAD_CREATE_DETACHED); < __threads[id].pid = pid; < iosStartThread(id); < } < } < < 720c607 < __iosInitOSThreads(); --- > /* No OS threads to start */ Index: sw/rvl/os/sdi/sdi_mgr.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/sdi/sdi_mgr.c,v retrieving revision 1.40 retrieving revision 1.40.4.1 diff -r1.40 -r1.40.4.1 16c16 < #ident "$Id: sdi_mgr.c,v 1.40 2008/01/25 23:13:16 cnguyen Exp $" --- > #ident "$Id: sdi_mgr.c,v 1.40.4.1 2008/05/07 08:24:55 cnguyen Exp $" 356c356 < if ((endAddr < IOP_GDDR3_START) || ((!__sdiPpcReq) && --- > if ((endAddr <= IOP_GDDR3_START) || ((!__sdiPpcReq) &&