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>
82 lines
2.3 KiB
C
82 lines
2.3 KiB
C
#ifndef TX_H
|
|
#define TX_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#define TX_SLOTS 4
|
|
#define TX_CAPACITY 256
|
|
#define TX_OK 0
|
|
#define TX_INVALID -1
|
|
#define TX_ABSENT -2
|
|
#define TX_BUSY -3
|
|
#define TX_INCOMPLETE -4
|
|
#define TX_DRAFT 1
|
|
#define TX_PENDING 2
|
|
struct port_descriptor {
|
|
int active;
|
|
int id;
|
|
int slot;
|
|
size_t length;
|
|
};
|
|
struct memory_port {
|
|
size_t line;
|
|
uint8_t cpu[TX_SLOTS][TX_CAPACITY];
|
|
uint8_t memory[TX_SLOTS][TX_CAPACITY];
|
|
struct port_descriptor queue[TX_SLOTS];
|
|
};
|
|
struct tx_slot {
|
|
int state;
|
|
int id;
|
|
size_t length;
|
|
uint8_t covered[TX_CAPACITY];
|
|
uint64_t order;
|
|
};
|
|
struct tx_stats {
|
|
uint64_t begins;
|
|
uint64_t writes;
|
|
uint64_t submits;
|
|
uint64_t completed;
|
|
uint64_t failures;
|
|
uint64_t cancelled;
|
|
uint64_t bytes;
|
|
unsigned drafts;
|
|
unsigned pending;
|
|
};
|
|
struct tx_frame {
|
|
int state;
|
|
int slot;
|
|
size_t length;
|
|
size_t covered;
|
|
};
|
|
struct tx_completion {
|
|
int id;
|
|
size_t length;
|
|
uint8_t data[TX_CAPACITY];
|
|
};
|
|
struct tx_engine {
|
|
struct memory_port port;
|
|
struct tx_slot slots[TX_SLOTS];
|
|
struct tx_stats totals;
|
|
uint64_t next_order;
|
|
};
|
|
int port_init(struct memory_port *p, int line);
|
|
int port_write(struct memory_port *p, int slot, size_t offset,
|
|
const uint8_t *data, size_t length);
|
|
int port_fill(struct memory_port *p, int slot, size_t offset,
|
|
size_t length, uint8_t value);
|
|
int port_clean(struct memory_port *p, int slot, size_t offset, size_t length);
|
|
int port_queue(struct memory_port *p, int slot, int id, size_t length);
|
|
int port_complete(struct memory_port *p, int id, int status,
|
|
struct tx_completion *out);
|
|
int tx_init(struct tx_engine *e, int line);
|
|
int tx_begin(struct tx_engine *e, int id, int length);
|
|
int tx_write(struct tx_engine *e, int id, int offset,
|
|
const uint8_t *data, int length);
|
|
int tx_fill(struct tx_engine *e, int id, int offset, int length, int value);
|
|
int tx_send(struct tx_engine *e, int id);
|
|
int tx_complete(struct tx_engine *e, int id, int status,
|
|
struct tx_completion *out);
|
|
int tx_cancel(struct tx_engine *e, int id);
|
|
int tx_inspect(const struct tx_engine *e, int id, struct tx_frame *out);
|
|
void tx_statistics(const struct tx_engine *e, struct tx_stats *out);
|
|
#endif
|