typedef struct { u16_t port; u32_t value; } pvl_pair_t;
/* Macro shorthand to set (port,value)-pair. */
-#define pv_set(pv, p, v) ((pv).port = (p), (pv).value = (v))
-#define pv_ptr_set(pv_ptr, p, v) ((pv_ptr)->port = (p), (pv_ptr)->value = (v))
+#define pv_set(pv, p, v) do { \
+ u32_t _p = (p), _v = (v); \
+ (pv).port = _p; \
+ (pv).value = _v; \
+ if((pv).port != _p || (pv).value != _v) { \
+ printf("%s:%d: actual port: %x != %x || " \
+ "actual value: %x != %x\n", \
+ __FILE__, __LINE__, (pv).port, _p, (pv).value, _v); \
+ panic(__FILE__, "pv_set(" #pv ", " #p ", " #v ")", NO_NUM); \
+ } \
+} while(0)
#if 0 /* no longer in use !!! */
/* Define a number of flags to indicate granularity we are using. */
$(CC) -o $@ $(LDFLAGS) $(UTIL_OBJ) $(UTIL_LIBS)
$(SERVER): $(OBJ)
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
- install -S 110k $@
+ install -S 120k $@
# install with other servers
install: /bin/$(UTIL) /usr/sbin/$(SERVER)
}
else if (strcmp(argv[i], ARG_DEV)==0) {
if (stat(argv[i+1], &stat_buf) == -1) {
+ perror(argv[i+1]);
print_usage(argv[ARG_NAME], "couldn't get status of device");
exit(errno);
}