Change naming scheme for atasd and ramsd
This commit is contained in:
@ -24,16 +24,15 @@ void storedev_init(void) {
|
||||
ata_probe();
|
||||
}
|
||||
|
||||
size_t ramsd_counter = 0;
|
||||
|
||||
void storedev_register_dev_entry(StoreDev *sd, int32_t sdtype) {
|
||||
char key[20];
|
||||
hal_memset(key, 0, sizeof(key));
|
||||
|
||||
if (sdtype == STOREDEV_RAMSD) {
|
||||
char uniq[5];
|
||||
randcrypto_gen_uniqid(uniq, 4);
|
||||
ksprintf(key, "ramsd-%s", uniq);
|
||||
ksprintf(key, "ramsd-%zu", ramsd_counter++);
|
||||
} else if (sdtype == STOREDEV_ATASD) {
|
||||
ksprintf(key, "atasd-%s", sd->sd.atasd.devno == 0x00 ? "mst" : "slv");
|
||||
ksprintf(key, "atasd-ch0-%c", sd->sd.atasd.devno == 0x00 ? 'M' : 'S');
|
||||
}
|
||||
|
||||
spinlock_acquire(&DEVTABLE.spinlock);
|
||||
|
||||
Reference in New Issue
Block a user