StoreFBClockDataV2 writes the primary anchor section. The two sections are independent seqlock sections on separate cache lines, mirroring the C fbclock_shmdata_v2 layout, so each is written by its own call.
(fd uintptr, d DataV2)
| 239 | // independent seqlock sections on separate cache lines, mirroring the C |
| 240 | // fbclock_shmdata_v2 layout, so each is written by its own call. |
| 241 | func StoreFBClockDataV2(fd uintptr, d DataV2) error { |
| 242 | data, err := unix.Mmap(int(fd), 0, shmDataV2Size, unix.PROT_READ|unix.PROT_WRITE, unix.MAP_SHARED) //nolint:gosec |
| 243 | if err != nil { |
| 244 | return fmt.Errorf("mmap failed: %w", err) |
| 245 | } |
| 246 | defer func() { _ = unix.Munmap(data) }() |
| 247 | |
| 248 | return storeSeqlockSection(data, shmV2PrimarySeqOff, func(buf []byte) { |
| 249 | writeClockDataV2(buf, d) |
| 250 | }) |
| 251 | } |
| 252 | |
| 253 | // StoreFBClockDataRealtime writes the realtime anchor section, used on hosts |
| 254 | // whose primary is MONOTONIC_RAW. Separate call from StoreFBClockDataV2 so the |
no test coverage detected
searching dependent graphs…