|
From: Chunning Ha <de...@hc...> - 2012-12-09 18:39:40
|
Hello, I need to add 64 bit target support to OpenOCD. It is a MIPS64 cpu. And but I found that OpenOCD doesn't support 64 bit target. Adding the support is somewhat difficult. The basic data structures under OpenOCD, such as struct target and lots of structs inside it, contain 32 bit address only. It is hard to add 64 bit address related variables and and structs. I think we have got 4 ways to add 64bit target support. Each gets its advantages and disadvantages in development easiness, memory consumption, maintainability. 1. Define macros to support 32 or 64 bit target; In this way, we have to build openocd32 and openocd64 separately. OpenOCD32 supports 32 bit target only, while OpenOCD64 supports 64 bit target only. No single executable file will for SOC with both 32bit and 64bit cores. 2. Adding a group of new data structures and rewrite the corresponding functions; In this way, we have got to rewrite too much code. And existing code will not be affected. But we have to another set of code, which got very few differences with existing code. 3. Change the "framework" so that 32, 64 bit will be supported. Very hard work. Almost all existing code will be affected seriously. 4. Adding 64bit address variables to the old data structures as redundant variables and structs. This will ensure that all old code can work properly. Thus less work is needed. But RAM will be wasted badly. Does anyone get any suggestions? Chunning Ha |