Skip to content

Commit

Permalink
ptpbuf / 7D: sync "uncacheable" macro with mem.h
Browse files Browse the repository at this point in the history
These shouldn't be in two places, but I'm not fixing it now.
  • Loading branch information
reticulatedpines committed Apr 7, 2024
1 parent 231e959 commit 5a617da
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ptpbuf.h
@@ -1,7 +1,19 @@
#ifndef _ptpbuf_h_
#define _ptpbuf_h_

#define UNCACHEABLE(x) ((void*)(((uint32_t)(x)) | 0x40000000))
/* Cacheable/uncacheable RAM pointers */
// SJE FIXME: why does ptpbuf.h define these as well as mem.h?
// The definitions must be kept in sync for 7D builds, which
// link against ptpbuf.o, or gcc complains about redefinition
// of the define (sensibly).
#ifdef CONFIG_VXWORKS
#define UNCACHEABLE(x) ((void*)(((uint32_t)(x)) | 0x10000000))
#define CACHEABLE(x) ((void*)(((uint32_t)(x)) & ~0x10000000))
#else
#define UNCACHEABLE(x) ((void*)(((uint32_t)(x)) | (((uint32_t)(x)) < 0x40000000 ? 0x40000000 : 0)))
#define CACHEABLE(x) ((void*)(((uint32_t)(x)) & ~0x40000000))
#endif

#define PTPBUF_BUFS 16
#define PTPBUF_BUFSIZE 256
#define PTPBUF_MAGIC 0xEAEA3388
Expand Down

0 comments on commit 5a617da

Please sign in to comment.