aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/nvidia_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/nvidia_info.c')
-rw-r--r--litmus/nvidia_info.c195
1 files changed, 0 insertions, 195 deletions
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c
index 6a101882e615..096480c53fad 100644
--- a/litmus/nvidia_info.c
+++ b/litmus/nvidia_info.c
@@ -1223,198 +1223,3 @@ int reg_nv_device(int reg_device_id, int reg_action, struct task_struct *t)
1223 1223
1224 return(ret); 1224 return(ret);
1225} 1225}
1226
1227
1228
1229#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
1230//void pai_check_priority_increase(struct task_struct *t, int reg_device_id)
1231//{
1232// unsigned long flags;
1233// nv_device_registry_t *reg = &NV_DEVICE_REG[reg_device_id];
1234//
1235//
1236//
1237// if(reg->max_prio_owner != t) {
1238//
1239// raw_spin_lock_irqsave(&reg->lock, flags);
1240//
1241// if(reg->max_prio_owner != t) {
1242// if(litmus->compare(t, reg->max_prio_owner)) {
1243// litmus->change_prio_pai_tasklet(reg->max_prio_owner, t);
1244// reg->max_prio_owner = t;
1245// }
1246// }
1247//
1248// raw_spin_unlock_irqrestore(&reg->lock, flags);
1249// }
1250//}
1251//
1252//
1253//void pai_check_priority_decrease(struct task_struct *t, int reg_device_id)
1254//{
1255// unsigned long flags;
1256// nv_device_registry_t *reg = &NV_DEVICE_REG[reg_device_id];
1257//
1258// if(reg->max_prio_owner == t) {
1259//
1260// raw_spin_lock_irqsave(&reg->lock, flags);
1261//
1262// if(reg->max_prio_owner == t) {
1263// reg->max_prio_owner = find_hp_owner(reg, NULL);
1264// if(reg->max_prio_owner != t) {
1265// litmus->change_prio_pai_tasklet(t, reg->max_prio_owner);
1266// }
1267// }
1268//
1269// raw_spin_unlock_irqrestore(&reg->lock, flags);
1270// }
1271//}
1272#endif
1273
1274
1275
1276
1277
1278//static int __reg_nv_device(int reg_device_id, struct task_struct *t)
1279//{
1280// int ret = 0;
1281// int i;
1282// struct task_struct *old_max = NULL;
1283//
1284//
1285// raw_spin_lock_irqsave(&reg->lock, flags);
1286//
1287// if(reg->nr_owners < NV_MAX_SIMULT_USERS) {
1288// TRACE_TASK(t, "registers GPU %d\n", reg_device_id);
1289// for(i = 0; i < NV_MAX_SIMULT_USERS; ++i) {
1290// if(reg->owners[i] == NULL) {
1291// reg->owners[i] = t;
1292//
1293// //if(edf_higher_prio(t, reg->max_prio_owner)) {
1294// if(litmus->compare(t, reg->max_prio_owner)) {
1295// old_max = reg->max_prio_owner;
1296// reg->max_prio_owner = t;
1297//
1298//#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
1299// litmus->change_prio_pai_tasklet(old_max, t);
1300//#endif
1301// }
1302//
1303//#ifdef CONFIG_LITMUS_SOFTIRQD
1304// down_and_set_stat(t, HELD, &tsk_rt(t)->klmirqd_sem);
1305//#endif
1306// ++(reg->nr_owners);
1307//
1308// break;
1309// }
1310// }
1311// }
1312// else
1313// {
1314// TRACE_CUR("%s: device %d is already in use!\n", __FUNCTION__, reg_device_id);
1315// //ret = -EBUSY;
1316// }
1317//
1318// raw_spin_unlock_irqrestore(&reg->lock, flags);
1319//
1320// __set_bit(reg_device_id, &tsk_rt(t)->held_gpus);
1321//
1322// return(ret);
1323//}
1324//
1325//static int __clear_reg_nv_device(int de_reg_device_id, struct task_struct *t)
1326//{
1327// int ret = 0;
1328// int i;
1329// unsigned long flags;
1330// nv_device_registry_t *reg = &NV_DEVICE_REG[de_reg_device_id];
1331//
1332//#ifdef CONFIG_LITMUS_SOFTIRQD
1333// struct task_struct* klmirqd_th = get_klmirqd(de_reg_device_id);
1334//#endif
1335//
1336// if(!test_bit(de_reg_device_id, &tsk_rt(t)->held_gpus)) {
1337// return ret;
1338// }
1339//
1340// raw_spin_lock_irqsave(&reg->lock, flags);
1341//
1342// TRACE_TASK(t, "unregisters GPU %d\n", de_reg_device_id);
1343//
1344// for(i = 0; i < NV_MAX_SIMULT_USERS; ++i) {
1345// if(reg->owners[i] == t) {
1346//#ifdef CONFIG_LITMUS_SOFTIRQD
1347// flush_pending(klmirqd_th, t);
1348//#endif
1349// if(reg->max_prio_owner == t) {
1350// reg->max_prio_owner = find_hp_owner(reg, t);
1351//#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
1352// litmus->change_prio_pai_tasklet(t, reg->max_prio_owner);
1353//#endif
1354// }
1355//
1356//#ifdef CONFIG_LITMUS_SOFTIRQD
1357// up_and_set_stat(t, NOT_HELD, &tsk_rt(t)->klmirqd_sem);
1358//#endif
1359//
1360// reg->owners[i] = NULL;
1361// --(reg->nr_owners);
1362//
1363// break;
1364// }
1365// }
1366//
1367// raw_spin_unlock_irqrestore(&reg->lock, flags);
1368//
1369// __clear_bit(de_reg_device_id, &tsk_rt(t)->held_gpus);
1370//
1371// return(ret);
1372//}
1373//
1374//
1375//int reg_nv_device(int reg_device_id, int reg_action, struct task_struct *t)
1376//{
1377// int ret;
1378//
1379// if((reg_device_id < NV_DEVICE_NUM) && (reg_device_id >= 0))
1380// {
1381// if(reg_action)
1382// ret = __reg_nv_device(reg_device_id, t);
1383// else
1384// ret = __clear_reg_nv_device(reg_device_id, t);
1385// }
1386// else
1387// {
1388// ret = -ENODEV;
1389// }
1390//
1391// return(ret);
1392//}
1393
1394
1395
1396//void lock_nv_registry(u32 target_device_id, unsigned long* flags)
1397//{
1398// BUG_ON(target_device_id >= NV_DEVICE_NUM);
1399//
1400// if(in_interrupt())
1401// TRACE("Locking registry for %d.\n", target_device_id);
1402// else
1403// TRACE_CUR("Locking registry for %d.\n", target_device_id);
1404//
1405// raw_spin_lock_irqsave(&NV_DEVICE_REG[target_device_id].lock, *flags);
1406//}
1407//
1408//void unlock_nv_registry(u32 target_device_id, unsigned long* flags)
1409//{
1410// BUG_ON(target_device_id >= NV_DEVICE_NUM);
1411//
1412// if(in_interrupt())
1413// TRACE("Unlocking registry for %d.\n", target_device_id);
1414// else
1415// TRACE_CUR("Unlocking registry for %d.\n", target_device_id);
1416//
1417// raw_spin_unlock_irqrestore(&NV_DEVICE_REG[target_device_id].lock, *flags);
1418//}
1419
1420