LCOV - code coverage report
Current view: top level - tango/dcache - fd_dcache_private.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 10 13 76.9 %
Date: 2024-11-13 11:58:15 Functions: 4 8 50.0 %

          Line data    Source code
       1             : #ifndef HEADER_fd_src_tango_fd_dcache_private_h
       2             : #define HEADER_fd_src_tango_fd_dcache_private_h
       3             : 
       4             : #include "fd_dcache.h"
       5             : 
       6             : /* FD_DCACHE_MAGIC is used to signal the layout of shared memory region
       7             :    of a dcache. */
       8             : 
       9          18 : #define FD_DCACHE_MAGIC (0xF17EDA2C37DCA540UL) /* F17E=FIRE,DA2C/37=DANCER,DC/A54=DCASH,0=V0 / FIRE DANCER MCASH V0 */
      10             : 
      11             : /* fd_dcache_private_hdr specifies the detailed layout of the shared
      12             :    memory region. */
      13             : 
      14             : struct __attribute__((aligned(FD_DCACHE_ALIGN))) fd_dcache_private_hdr {
      15             : 
      16             :   /* This point is FD_DCACHE_ALIGN aligned */
      17             : 
      18             :   ulong magic;   /* == FD_DCACHE_MAGIC */
      19             :   ulong data_sz; /* Size of the data region in bytes */
      20             :   ulong app_sz;  /* Size of the application region in bytes */
      21             :   ulong app_off; /* Location of the application region relative to first byte of the header */
      22             : 
      23             :   /* Padding to FD_DCACHE_ALIGN here */
      24             : 
      25             :   uchar __attribute__((aligned(FD_DCACHE_ALIGN))) guard[ FD_DCACHE_GUARD_FOOTPRINT ];
      26             : 
      27             :   /* Padding to FD_DCACHE_ALIGN here (probably zero) */
      28             : 
      29             :   /* data_sz bytes here */
      30             : 
      31             :   /* Padding to FD_DCACHE_ALIGN here */
      32             : 
      33             :   /* app_off points here */
      34             :   /* app_sz byte reserved here */
      35             : 
      36             :   /* Padding to FD_DCACHE_ALIGN here */
      37             : };
      38             : 
      39             : typedef struct fd_dcache_private_hdr fd_dcache_private_hdr_t;
      40             : 
      41             : FD_PROTOTYPES_BEGIN
      42             : 
      43             : FD_FN_CONST static inline uchar const *
      44           0 : fd_dcache_private_cache_const( fd_dcache_private_hdr_t const * dcache ) {
      45           0 :   return (uchar const *)(dcache+1UL);
      46           0 : }
      47             : 
      48             : FD_FN_CONST static inline uchar *
      49          75 : fd_dcache_private_dcache( fd_dcache_private_hdr_t * dcache ) {
      50          75 :   return (uchar *)(dcache+1UL);
      51          75 : }
      52             : 
      53             : FD_FN_CONST static inline fd_dcache_private_hdr_t const *
      54     1206958 : fd_dcache_private_hdr_const( uchar const * dcache ) {
      55     1206958 :   return (fd_dcache_private_hdr_t const *)(((ulong)dcache) - sizeof(fd_dcache_private_hdr_t));
      56     1206958 : }
      57             : 
      58             : FD_FN_CONST static inline fd_dcache_private_hdr_t *
      59           6 : fd_dcache_private_hdr( uchar * dcache ) {
      60           6 :   return (fd_dcache_private_hdr_t *)(((ulong)dcache) - sizeof(fd_dcache_private_hdr_t));
      61           6 : }
      62             : 
      63             : FD_PROTOTYPES_END
      64             : 
      65             : #endif /* HEADER_fd_src_tango_fd_dcache_private_h */

Generated by: LCOV version 1.14