Mercurial > hg > Game > Cerium
changeset 873:c50f39fbb6ca draft
fix hash problem ( unsigned int-> long overflow )
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 04 Jul 2010 19:01:24 +0900 |
parents | d7b0c0f8514c |
children | 188e8bc16aca |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Makefile.cell TaskManager/kernel/memory/MemHash.cc TaskManager/kernel/schedule/Scheduler.cc |
diffstat | 4 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sun Jul 04 17:59:53 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Sun Jul 04 19:01:24 2010 +0900 @@ -46,6 +46,7 @@ ppeManager = new FifoTaskManagerImpl(machineNum); // 大半のTaskQueueInfoは、共有される MainScheduler *mscheduler = new MainScheduler; + set_scheduler(mscheduler); ppeManager->init(mscheduler, this); // ここで HTaskInfo が共有される。 ppeManager->get_scheduler()->set_manager(this);
--- a/TaskManager/Makefile.cell Sun Jul 04 17:59:53 2010 +0900 +++ b/TaskManager/Makefile.cell Sun Jul 04 19:01:24 2010 +0900 @@ -57,7 +57,7 @@ $(SPETARGET): $(CELL_SPE_OBJS) ar crus $@ $(CELL_SPE_OBJS) -$(CELL_SPE_SCHEDULE_SRC): kernel/schedule/*.cc +$(CELL_SPE_SCHEDULE_SRC): kernel/schedule/*.cc kernel/memory/*.cc kernel/ppe/*.cc cp kernel/schedule/*.cc $(CELL_SPE_DIR)/ cp kernel/memory/*.cc $(CELL_SPE_DIR)/ cp kernel/ppe/{TaskQueue.cc,Task.cc} $(CELL_SPE_DIR)/
--- a/TaskManager/kernel/memory/MemHash.cc Sun Jul 04 17:59:53 2010 +0900 +++ b/TaskManager/kernel/memory/MemHash.cc Sun Jul 04 19:01:24 2010 +0900 @@ -10,7 +10,7 @@ int MemHash::hash(memaddr data0) { - long data = (long)data0; + unsigned long data = (unsigned long)data0; int value = 0; int n = 0; long key; @@ -20,6 +20,7 @@ value += key * PRIME[n++ & 7]; data >>= 4; } +printf("hash value %0x => %0x\n",data0, value); return value % hashSize; } @@ -57,6 +58,7 @@ if (table[index] != NULL && table[index]->address == key) { +printf("get hash value %0x\n",index); return table[index]; } }
--- a/TaskManager/kernel/schedule/Scheduler.cc Sun Jul 04 17:59:53 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Sun Jul 04 19:01:24 2010 +0900 @@ -229,11 +229,12 @@ task_list[task_id].entry_offset); task_list[task_id].run = run; #if 1 - m->printf("loadng task id %d at 0x%x entry 0x%x\n",task_id, + m->printf("loadng task id %d at 0x%x entry 0x%x location 0x%x\n",task_id, (unsigned int)(task_list[task_id].segment->data ), (unsigned int)( (char*)task_list[task_id].segment->data + - task_list[task_id].entry_offset)); + task_list[task_id].entry_offset), + task_list[task_id].location); #endif }