Use a big-lock for kernel sychronization instead of fine-grained locking
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 2m21s
Build documentation / build-and-deploy (push) Successful in 54s

This commit is contained in:
2026-04-27 18:06:02 +02:00
parent 68cdd8d6d2
commit e5ebd7f3ba
56 changed files with 212 additions and 1206 deletions

View File

@@ -31,8 +31,6 @@ DEFINE_DEVICE_FINI(partdrv_fini) {
}
DEFINE_DEVICE_OP(partdrv_read) {
uint64_t fs;
if (a1 == NULL || a2 == NULL || a3 == NULL)
return -ST_BAD_ADDRESS_SPACE;
@@ -43,16 +41,12 @@ DEFINE_DEVICE_OP(partdrv_read) {
size_t sector_count = *(size_t*)a2;
uint8_t* buffer = a3;
spin_lock(&super->lock, &fs);
int ret = device_op(super, XDRV_READ, proc, rctx, &fs, &sector, &sector_count, buffer);
spin_unlock(&super->lock, fs);
int ret = device_op(super, XDRV_READ, proc, rctx, &sector, &sector_count, buffer);
return ret;
}
DEFINE_DEVICE_OP(partdrv_write) {
uint64_t fs;
if (a1 == NULL || a2 == NULL || a3 == NULL)
return -ST_BAD_ADDRESS_SPACE;
@@ -63,9 +57,7 @@ DEFINE_DEVICE_OP(partdrv_write) {
size_t sector_count = *(size_t*)a2;
uint8_t* buffer = a3;
spin_lock(&super->lock, &fs);
int ret = device_op(super, XDRV_WRITE, proc, rctx, &fs, &sector, &sector_count, buffer);
spin_unlock(&super->lock, fs);
int ret = device_op(super, XDRV_WRITE, proc, rctx, &sector, &sector_count, buffer);
return ret;
}
@@ -82,8 +74,6 @@ DEFINE_DEVICE_OP(partdrv_get_device_type) {
}
DEFINE_DEVICE_OP(partdrv_get_sector_size) {
uint64_t fs;
if (a1 == NULL)
return -ST_BAD_ADDRESS_SPACE;
@@ -91,9 +81,7 @@ DEFINE_DEVICE_OP(partdrv_get_sector_size) {
struct partdrv* partdrv = device->udata;
spin_lock(&partdrv->super->lock, &fs);
device_op(partdrv->super, XDRV_GET_SECTOR_SIZE, proc, rctx, &fs, secsize);
spin_unlock(&partdrv->super->lock, fs);
device_op(partdrv->super, XDRV_GET_SECTOR_SIZE, proc, rctx, secsize);
return ST_OK;
}