45
45
DEFINE_PER_CPU (int , x2apic_extra_bits );
46
46
47
47
static enum uv_system_type uv_system_type ;
48
+ static int uv_hubbed_system ;
48
49
static int uv_hubless_system ;
49
50
static u64 gru_start_paddr , gru_end_paddr ;
50
51
static u64 gru_dist_base , gru_first_node_paddr = -1LL , gru_last_node_paddr ;
@@ -328,6 +329,24 @@ static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id)
328
329
if (uv_hub_info -> hub_revision == 0 )
329
330
goto badbios ;
330
331
332
+ switch (uv_hub_info -> hub_revision ) {
333
+ case UV4_HUB_REVISION_BASE :
334
+ uv_hubbed_system = 0x11 ;
335
+ break ;
336
+
337
+ case UV3_HUB_REVISION_BASE :
338
+ uv_hubbed_system = 0x9 ;
339
+ break ;
340
+
341
+ case UV2_HUB_REVISION_BASE :
342
+ uv_hubbed_system = 0x5 ;
343
+ break ;
344
+
345
+ case UV1_HUB_REVISION_BASE :
346
+ uv_hubbed_system = 0x3 ;
347
+ break ;
348
+ }
349
+
331
350
pnodeid = early_get_pnodeid ();
332
351
early_get_apic_socketid_shift ();
333
352
@@ -377,6 +396,12 @@ int is_uv_system(void)
377
396
}
378
397
EXPORT_SYMBOL_GPL (is_uv_system );
379
398
399
+ int is_uv_hubbed (int uvtype )
400
+ {
401
+ return (uv_hubbed_system & uvtype );
402
+ }
403
+ EXPORT_SYMBOL_GPL (is_uv_hubbed );
404
+
380
405
int is_uv_hubless (int uvtype )
381
406
{
382
407
return (uv_hubless_system & uvtype );
@@ -1484,6 +1509,68 @@ static void __init build_socket_tables(void)
1484
1509
}
1485
1510
}
1486
1511
1512
+ /* Setup user proc fs files */
1513
+ static int proc_hubbed_show (struct seq_file * file , void * data )
1514
+ {
1515
+ seq_printf (file , "0x%x\n" , uv_hubbed_system );
1516
+ return 0 ;
1517
+ }
1518
+
1519
+ static int proc_hubless_show (struct seq_file * file , void * data )
1520
+ {
1521
+ seq_printf (file , "0x%x\n" , uv_hubless_system );
1522
+ return 0 ;
1523
+ }
1524
+
1525
+ static int proc_oemid_show (struct seq_file * file , void * data )
1526
+ {
1527
+ seq_printf (file , "%s/%s\n" , oem_id , oem_table_id );
1528
+ return 0 ;
1529
+ }
1530
+
1531
+ static int proc_hubbed_open (struct inode * inode , struct file * file )
1532
+ {
1533
+ return single_open (file , proc_hubbed_show , (void * )NULL );
1534
+ }
1535
+
1536
+ static int proc_hubless_open (struct inode * inode , struct file * file )
1537
+ {
1538
+ return single_open (file , proc_hubless_show , (void * )NULL );
1539
+ }
1540
+
1541
+ static int proc_oemid_open (struct inode * inode , struct file * file )
1542
+ {
1543
+ return single_open (file , proc_oemid_show , (void * )NULL );
1544
+ }
1545
+
1546
+ /* (struct is "non-const" as open function is set at runtime) */
1547
+ static struct file_operations proc_version_fops = {
1548
+ .read = seq_read ,
1549
+ .llseek = seq_lseek ,
1550
+ .release = single_release ,
1551
+ };
1552
+
1553
+ static const struct file_operations proc_oemid_fops = {
1554
+ .open = proc_oemid_open ,
1555
+ .read = seq_read ,
1556
+ .llseek = seq_lseek ,
1557
+ .release = single_release ,
1558
+ };
1559
+
1560
+ static __init void uv_setup_proc_files (int hubless )
1561
+ {
1562
+ struct proc_dir_entry * pde ;
1563
+ char * name = hubless ? "hubless" : "hubbed" ;
1564
+
1565
+ pde = proc_mkdir (UV_PROC_NODE , NULL );
1566
+ proc_create ("oemid" , 0 , pde , & proc_oemid_fops );
1567
+ proc_create (name , 0 , pde , & proc_version_fops );
1568
+ if (hubless )
1569
+ proc_version_fops .open = proc_hubless_open ;
1570
+ else
1571
+ proc_version_fops .open = proc_hubbed_open ;
1572
+ }
1573
+
1487
1574
/* Initialize UV hubless systems */
1488
1575
static __init int uv_system_init_hubless (void )
1489
1576
{
@@ -1495,6 +1582,10 @@ static __init int uv_system_init_hubless(void)
1495
1582
/* Init kernel/BIOS interface */
1496
1583
rc = uv_bios_init ();
1497
1584
1585
+ /* Create user access node if UVsystab available */
1586
+ if (rc >= 0 )
1587
+ uv_setup_proc_files (1 );
1588
+
1498
1589
return rc ;
1499
1590
}
1500
1591
@@ -1623,7 +1714,7 @@ static void __init uv_system_init_hub(void)
1623
1714
uv_nmi_setup ();
1624
1715
uv_cpu_init ();
1625
1716
uv_scir_register_cpu_notifier ();
1626
- proc_mkdir ( "sgi_uv" , NULL );
1717
+ uv_setup_proc_files ( 0 );
1627
1718
1628
1719
/* Register Legacy VGA I/O redirection handler: */
1629
1720
pci_register_set_vga_state (uv_set_vga_state );
0 commit comments