26
26
static DEFINE_PER_CPU (int , x2apic_extra_bits ) ;
27
27
28
28
static enum uv_system_type uv_system_type ;
29
+ static int uv_hubbed_system ;
29
30
static int uv_hubless_system ;
30
31
static u64 gru_start_paddr , gru_end_paddr ;
31
32
static u64 gru_dist_base , gru_first_node_paddr = -1LL , gru_last_node_paddr ;
@@ -309,6 +310,24 @@ static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id)
309
310
if (uv_hub_info -> hub_revision == 0 )
310
311
goto badbios ;
311
312
313
+ switch (uv_hub_info -> hub_revision ) {
314
+ case UV4_HUB_REVISION_BASE :
315
+ uv_hubbed_system = 0x11 ;
316
+ break ;
317
+
318
+ case UV3_HUB_REVISION_BASE :
319
+ uv_hubbed_system = 0x9 ;
320
+ break ;
321
+
322
+ case UV2_HUB_REVISION_BASE :
323
+ uv_hubbed_system = 0x5 ;
324
+ break ;
325
+
326
+ case UV1_HUB_REVISION_BASE :
327
+ uv_hubbed_system = 0x3 ;
328
+ break ;
329
+ }
330
+
312
331
pnodeid = early_get_pnodeid ();
313
332
early_get_apic_socketid_shift ();
314
333
@@ -359,6 +378,12 @@ int is_uv_system(void)
359
378
}
360
379
EXPORT_SYMBOL_GPL (is_uv_system );
361
380
381
+ int is_uv_hubbed (int uvtype )
382
+ {
383
+ return (uv_hubbed_system & uvtype );
384
+ }
385
+ EXPORT_SYMBOL_GPL (is_uv_hubbed );
386
+
362
387
int is_uv_hubless (int uvtype )
363
388
{
364
389
return (uv_hubless_system & uvtype );
@@ -1457,6 +1482,68 @@ static void __init build_socket_tables(void)
1457
1482
}
1458
1483
}
1459
1484
1485
+ /* Setup user proc fs files */
1486
+ static int proc_hubbed_show (struct seq_file * file , void * data )
1487
+ {
1488
+ seq_printf (file , "0x%x\n" , uv_hubbed_system );
1489
+ return 0 ;
1490
+ }
1491
+
1492
+ static int proc_hubless_show (struct seq_file * file , void * data )
1493
+ {
1494
+ seq_printf (file , "0x%x\n" , uv_hubless_system );
1495
+ return 0 ;
1496
+ }
1497
+
1498
+ static int proc_oemid_show (struct seq_file * file , void * data )
1499
+ {
1500
+ seq_printf (file , "%s/%s\n" , oem_id , oem_table_id );
1501
+ return 0 ;
1502
+ }
1503
+
1504
+ static int proc_hubbed_open (struct inode * inode , struct file * file )
1505
+ {
1506
+ return single_open (file , proc_hubbed_show , (void * )NULL );
1507
+ }
1508
+
1509
+ static int proc_hubless_open (struct inode * inode , struct file * file )
1510
+ {
1511
+ return single_open (file , proc_hubless_show , (void * )NULL );
1512
+ }
1513
+
1514
+ static int proc_oemid_open (struct inode * inode , struct file * file )
1515
+ {
1516
+ return single_open (file , proc_oemid_show , (void * )NULL );
1517
+ }
1518
+
1519
+ /* (struct is "non-const" as open function is set at runtime) */
1520
+ static struct file_operations proc_version_fops = {
1521
+ .read = seq_read ,
1522
+ .llseek = seq_lseek ,
1523
+ .release = single_release ,
1524
+ };
1525
+
1526
+ static const struct file_operations proc_oemid_fops = {
1527
+ .open = proc_oemid_open ,
1528
+ .read = seq_read ,
1529
+ .llseek = seq_lseek ,
1530
+ .release = single_release ,
1531
+ };
1532
+
1533
+ static __init void uv_setup_proc_files (int hubless )
1534
+ {
1535
+ struct proc_dir_entry * pde ;
1536
+ char * name = hubless ? "hubless" : "hubbed" ;
1537
+
1538
+ pde = proc_mkdir (UV_PROC_NODE , NULL );
1539
+ proc_create ("oemid" , 0 , pde , & proc_oemid_fops );
1540
+ proc_create (name , 0 , pde , & proc_version_fops );
1541
+ if (hubless )
1542
+ proc_version_fops .open = proc_hubless_open ;
1543
+ else
1544
+ proc_version_fops .open = proc_hubbed_open ;
1545
+ }
1546
+
1460
1547
/* Initialize UV hubless systems */
1461
1548
static __init int uv_system_init_hubless (void )
1462
1549
{
@@ -1468,6 +1555,10 @@ static __init int uv_system_init_hubless(void)
1468
1555
/* Init kernel/BIOS interface */
1469
1556
rc = uv_bios_init ();
1470
1557
1558
+ /* Create user access node if UVsystab available */
1559
+ if (rc >= 0 )
1560
+ uv_setup_proc_files (1 );
1561
+
1471
1562
return rc ;
1472
1563
}
1473
1564
@@ -1596,7 +1687,7 @@ static void __init uv_system_init_hub(void)
1596
1687
uv_nmi_setup ();
1597
1688
uv_cpu_init ();
1598
1689
uv_scir_register_cpu_notifier ();
1599
- proc_mkdir ( "sgi_uv" , NULL );
1690
+ uv_setup_proc_files ( 0 );
1600
1691
1601
1692
/* Register Legacy VGA I/O redirection handler: */
1602
1693
pci_register_set_vga_state (uv_set_vga_state );
0 commit comments