14
14
#include <linux/memory.h>
15
15
#include <linux/export.h>
16
16
#include <linux/pci.h>
17
+ #include <linux/acpi.h>
17
18
18
19
#include <asm/e820/api.h>
19
20
#include <asm/uv/uv_mmrs.h>
@@ -31,6 +32,10 @@ static u64 gru_dist_base, gru_first_node_paddr = -1LL, gru_last_node_paddr;
31
32
static u64 gru_dist_lmask , gru_dist_umask ;
32
33
static union uvh_apicid uvh_apicid ;
33
34
35
+ /* Unpack OEM/TABLE ID's to be NULL terminated strings */
36
+ static u8 oem_id [ACPI_OEM_ID_SIZE + 1 ];
37
+ static u8 oem_table_id [ACPI_OEM_TABLE_ID_SIZE + 1 ];
38
+
34
39
/* Information derived from CPUID: */
35
40
static struct {
36
41
unsigned int apicid_shift ;
@@ -248,11 +253,20 @@ static void __init uv_set_apicid_hibit(void)
248
253
}
249
254
}
250
255
251
- static int __init uv_acpi_madt_oem_check (char * oem_id , char * oem_table_id )
256
+ static void __init uv_stringify (int len , char * to , char * from )
257
+ {
258
+ /* Relies on 'to' being NULL chars so result will be NULL terminated */
259
+ strncpy (to , from , len - 1 );
260
+ }
261
+
262
+ static int __init uv_acpi_madt_oem_check (char * _oem_id , char * _oem_table_id )
252
263
{
253
264
int pnodeid ;
254
265
int uv_apic ;
255
266
267
+ uv_stringify (sizeof (oem_id ), oem_id , _oem_id );
268
+ uv_stringify (sizeof (oem_table_id ), oem_table_id , _oem_table_id );
269
+
256
270
if (strncmp (oem_id , "SGI" , 3 ) != 0 ) {
257
271
if (strncmp (oem_id , "NSGI" , 4 ) == 0 ) {
258
272
uv_hubless_system = true;
0 commit comments