From: Sebastian Date: Wed, 11 Dec 2013 00:13:59 +0000 (+0100) Subject: dol: fix shm_t contain the shm-buffers X-Git-Url: http://sraa.de/git/?a=commitdiff_plain;h=288a00688bd1ef5ffad268212df3c54c7c8c4e30;hp=2858109405a90a4d9df149b10444678d42e41c59;p=jump.git dol: fix shm_t contain the shm-buffers The shared.h file contained the typedefs for all buffers, but did not include the buffers themselves in the shared shm_t structure. --- diff --git a/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java b/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java index 2c0c642..5a053ca 100644 --- a/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java +++ b/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java @@ -264,23 +264,29 @@ public class EpiphanyVisitor extends PNVisitor { 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)) { - shmBufs += + shmBufTypes += "\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(); - sed.sed(filename, "@@SHM_BUF_STRUCTS@@", shmBufs); + sed.sed(filename, "@@SHM_BUF_STRUCTS@@", shmBufTypes); + sed.sed(filename, "@@SHM_BUFS@@", shmBufs); System.out.println("done!"); } diff --git a/dol/src/dol/visitor/epiphany/template/shared.h b/dol/src/dol/visitor/epiphany/template/shared.h index 467b09f..1eb893d 100644 --- a/dol/src/dol/visitor/epiphany/template/shared.h +++ b/dol/src/dol/visitor/epiphany/template/shared.h @@ -26,8 +26,7 @@ typedef struct { typedef struct { int32_t states[NUM_CORES]; coredata_t cores[NUM_CORES]; - buf0_t buf0; - buf1_t buf1; +@@SHM_BUFS@@ } PACKED shm_t; #endif /* _SHARED_H_ */