summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2858109)
The shared.h file contained the typedefs for all buffers, but
did not include the buffers themselves in the shared shm_t structure.
File fTemplate = new File(template);
copyFile(fTemplate, fFilename);
File fTemplate = new File(template);
copyFile(fTemplate, fFilename);
- /* generate replacement string */
+ /* generate replacement strings */
+ String shmBufTypes = "";
String shmBufs = "";
for(EpiphanyBuffer buf : _buffers) {
if("shm".equals(buf.type)) {
String shmBufs = "";
for(EpiphanyBuffer buf : _buffers) {
if("shm".equals(buf.type)) {
"\ntypedef struct {\n" +
"\tuint32_t rp;\n" +
"\tuint32_t wp;\n" +
"\tuint32_t size;\n" +
"\tchar buf[" + buf.size + "];\n" +
"} PACKED buf" + buf.shmIndex + "_t;\n";
"\ntypedef struct {\n" +
"\tuint32_t rp;\n" +
"\tuint32_t wp;\n" +
"\tuint32_t size;\n" +
"\tchar buf[" + buf.size + "];\n" +
"} PACKED buf" + buf.shmIndex + "_t;\n";
+
+ shmBufs +=
+ "\tbuf" + buf.shmIndex + "_t" +
+ "\tbuf" + buf.shmIndex + ";\n";
}
}
/* do the replace */
Sed sed = new Sed();
}
}
/* do the replace */
Sed sed = new Sed();
- sed.sed(filename, "@@SHM_BUF_STRUCTS@@", shmBufs);
+ sed.sed(filename, "@@SHM_BUF_STRUCTS@@", shmBufTypes);
+ sed.sed(filename, "@@SHM_BUFS@@", shmBufs);
System.out.println("done!");
}
System.out.println("done!");
}
typedef struct {
int32_t states[NUM_CORES];
coredata_t cores[NUM_CORES];
typedef struct {
int32_t states[NUM_CORES];
coredata_t cores[NUM_CORES];
- buf0_t buf0;
- buf1_t buf1;
} PACKED shm_t;
#endif /* _SHARED_H_ */
} PACKED shm_t;
#endif /* _SHARED_H_ */