.. | .. |
---|
16 | 16 | #define DBFS_D0C_HDR_VERSION 0 |
---|
17 | 17 | |
---|
18 | 18 | /* |
---|
19 | | - * Execute diagnose 0c in 31 bit mode |
---|
20 | | - */ |
---|
21 | | -static void diag0c(struct hypfs_diag0c_entry *entry) |
---|
22 | | -{ |
---|
23 | | - diag_stat_inc(DIAG_STAT_X00C); |
---|
24 | | - asm volatile ( |
---|
25 | | - " sam31\n" |
---|
26 | | - " diag %0,%0,0x0c\n" |
---|
27 | | - " sam64\n" |
---|
28 | | - : /* no output register */ |
---|
29 | | - : "a" (entry) |
---|
30 | | - : "memory"); |
---|
31 | | -} |
---|
32 | | - |
---|
33 | | -/* |
---|
34 | 19 | * Get hypfs_diag0c_entry from CPU vector and store diag0c data |
---|
35 | 20 | */ |
---|
36 | 21 | static void diag0c_fn(void *data) |
---|
37 | 22 | { |
---|
38 | | - diag0c(((void **) data)[smp_processor_id()]); |
---|
| 23 | + diag_stat_inc(DIAG_STAT_X00C); |
---|
| 24 | + diag_dma_ops.diag0c(((void **) data)[smp_processor_id()]); |
---|
39 | 25 | } |
---|
40 | 26 | |
---|
41 | 27 | /* |
---|
.. | .. |
---|
54 | 40 | if (!cpu_vec) |
---|
55 | 41 | goto fail_put_online_cpus; |
---|
56 | 42 | /* Note: Diag 0c needs 8 byte alignment and real storage */ |
---|
57 | | - diag0c_data = kzalloc(sizeof(struct hypfs_diag0c_hdr) + |
---|
58 | | - cpu_count * sizeof(struct hypfs_diag0c_entry), |
---|
| 43 | + diag0c_data = kzalloc(struct_size(diag0c_data, entry, cpu_count), |
---|
59 | 44 | GFP_KERNEL | GFP_DMA); |
---|
60 | 45 | if (!diag0c_data) |
---|
61 | 46 | goto fail_kfree_cpu_vec; |
---|
.. | .. |
---|
125 | 110 | { |
---|
126 | 111 | if (!MACHINE_IS_VM) |
---|
127 | 112 | return 0; |
---|
128 | | - return hypfs_dbfs_create_file(&dbfs_file_0c); |
---|
| 113 | + hypfs_dbfs_create_file(&dbfs_file_0c); |
---|
| 114 | + return 0; |
---|
129 | 115 | } |
---|
130 | 116 | |
---|
131 | 117 | /* |
---|