One user-space repair task per eligible HWE debug-diag / compile-deploy base ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content filter. Each ships a public spec with a check-to-basis table, at least two defects with single-fix fixtures, a symptom-masking fixture and an alternative correct implementation. Claude re-checked all 320: structure, the HWE quality items and trace6 Docker calibration receipts against current digests (320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120 ad-hoc family names; the next batch maps them to the canonical list. The batch's 1,256-line progress log stays in its factory report and the 36-local branch batch15-hwe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75 lines
1.9 KiB
C
75 lines
1.9 KiB
C
#ifndef SCAN_H
|
|
#define SCAN_H
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#define BUS_COUNT 4
|
|
#define ADDRESS_COUNT 128
|
|
#define HANDLE_COUNT 16
|
|
#define SESSION_COUNT 4
|
|
#define ERR_INVALID (-22)
|
|
#define ERR_IO (-5)
|
|
#define ERR_OPEN (-6)
|
|
#define ERR_LIMIT (-24)
|
|
#define ERR_HANDLE (-9)
|
|
typedef struct {
|
|
int active;
|
|
int bus;
|
|
int selected;
|
|
int poisoned;
|
|
} Handle;
|
|
typedef struct {
|
|
int kind;
|
|
int address;
|
|
int remaining;
|
|
} Fault;
|
|
typedef struct {
|
|
uint64_t opens;
|
|
uint64_t closes;
|
|
uint64_t selects;
|
|
uint64_t reads;
|
|
uint64_t errors;
|
|
int live;
|
|
int peak;
|
|
} PortStats;
|
|
typedef struct {
|
|
int values[BUS_COUNT][ADDRESS_COUNT];
|
|
Handle handles[HANDLE_COUNT];
|
|
Fault faults[BUS_COUNT];
|
|
PortStats stats;
|
|
int capacity;
|
|
unsigned seed;
|
|
} Port;
|
|
typedef struct {
|
|
int handle;
|
|
int bus;
|
|
uint64_t sweeps;
|
|
uint64_t discoveries;
|
|
} Session;
|
|
typedef struct {
|
|
Port *port;
|
|
Session sessions[SESSION_COUNT];
|
|
} Scanner;
|
|
typedef struct {
|
|
int visited;
|
|
int found;
|
|
uint64_t digest;
|
|
unsigned char seen[ADDRESS_COUNT];
|
|
int values[ADDRESS_COUNT];
|
|
} ScanResult;
|
|
int port_init(Port *port, int capacity, unsigned seed);
|
|
int port_device(Port *port, int bus, int address, int value);
|
|
int port_fault(Port *port, int bus, int kind, int address, int count);
|
|
int port_open(Port *port, int bus);
|
|
int port_close(Port *port, int handle);
|
|
int port_select(Port *port, int handle, int address);
|
|
int port_read(Port *port, int handle, int *value);
|
|
int port_bus(const Port *port, int handle);
|
|
void port_dump(const Port *port, FILE *output);
|
|
void scanner_init(Scanner *scanner, Port *port);
|
|
int scanner_run(Scanner *scanner, int slot, int bus, int low, int high,
|
|
int reverse, ScanResult *result);
|
|
int scanner_close(Scanner *scanner, int slot);
|
|
void scanner_finish(Scanner *scanner);
|
|
void scanner_dump(const Scanner *scanner, FILE *output);
|
|
#endif
|