+static int sd_error(KBlock *b)
+{
+ Sd *sd = SD_CAST(b);
+ return sd->r1;
+}
+
+static int sd_clearerr(KBlock *b)
+{
+ Sd *sd = SD_CAST(b);
+ sd->r1 = 0;
+ return 0;
+}
+
+static const KBlockVTable sd_unbuffered_vt =
+{
+ .readDirect = sd_readDirect,
+ .writeBlock = sd_writeBlock,
+
+ .error = sd_error,
+ .clearerr = sd_clearerr,
+};
+
+static const KBlockVTable sd_buffered_vt =
+{
+ .readDirect = sd_readDirect,
+ .writeBlock = sd_writeBlock,
+
+ .readBuf = kblock_swReadBuf,
+ .writeBuf = kblock_swWriteBuf,
+ .load = kblock_swLoad,
+ .store = kblock_swStore,
+
+ .error = sd_error,
+ .clearerr = sd_clearerr,
+};
+