blob: d97f20069d3e7d1c322c4823fab7144bc8155d90 [file] [log] [blame]
Ben Skeggs6ee73862009-12-11 19:24:15 +10001#include <linux/pci.h>
2#include <linux/acpi.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +09003#include <linux/slab.h>
Ben Skeggs6ee73862009-12-11 19:24:15 +10004#include <acpi/acpi_drivers.h>
5#include <acpi/acpi_bus.h>
Ben Skeggsa6ed76d2010-07-12 15:33:07 +10006#include <acpi/video.h>
Dave Airlie81161882010-12-06 12:57:45 +10007#include <acpi/acpi.h>
8#include <linux/mxm-wmi.h>
Ben Skeggs6ee73862009-12-11 19:24:15 +10009
Dave Airlie6a9ee8a2010-02-01 15:38:10 +100010#include <linux/vga_switcheroo.h>
11
Linus Torvalds612a9aa2012-10-03 23:29:23 -070012#include <drm/drm_edid.h>
Ben Skeggsc0077062012-07-26 08:51:21 +100013
14#include "nouveau_drm.h"
15#include "nouveau_acpi.h"
16
Ben Skeggs6ee73862009-12-11 19:24:15 +100017#define NOUVEAU_DSM_LED 0x02
18#define NOUVEAU_DSM_LED_STATE 0x00
19#define NOUVEAU_DSM_LED_OFF 0x10
20#define NOUVEAU_DSM_LED_STAMINA 0x11
21#define NOUVEAU_DSM_LED_SPEED 0x12
22
23#define NOUVEAU_DSM_POWER 0x03
24#define NOUVEAU_DSM_POWER_STATE 0x00
25#define NOUVEAU_DSM_POWER_SPEED 0x01
26#define NOUVEAU_DSM_POWER_STAMINA 0x02
27
Peter Lekensteyn9075e852011-12-17 12:53:43 +010028#define NOUVEAU_DSM_OPTIMUS_FN 0x1A
Peter Lekensteynd0992302011-12-17 12:54:04 +010029#define NOUVEAU_DSM_OPTIMUS_ARGS 0x03000001
30
Dave Airlie6a9ee8a2010-02-01 15:38:10 +100031static struct nouveau_dsm_priv {
32 bool dsm_detected;
Dave Airlief19467c2011-03-22 14:10:27 +100033 bool optimus_detected;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +100034 acpi_handle dhandle;
Dave Airlieafeb3e12010-04-07 13:55:09 +100035 acpi_handle rom_handle;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +100036} nouveau_dsm_priv;
Ben Skeggs6ee73862009-12-11 19:24:15 +100037
Dave Airliec839d742012-11-02 11:04:27 +100038bool nouveau_is_optimus(void) {
39 return nouveau_dsm_priv.optimus_detected;
40}
41
42bool nouveau_is_v1_dsm(void) {
43 return nouveau_dsm_priv.dsm_detected;
44}
45
Dave Airlief19467c2011-03-22 14:10:27 +100046#define NOUVEAU_DSM_HAS_MUX 0x1
47#define NOUVEAU_DSM_HAS_OPT 0x2
48
Dave Airlie6a9ee8a2010-02-01 15:38:10 +100049static const char nouveau_dsm_muid[] = {
50 0xA0, 0xA0, 0x95, 0x9D, 0x60, 0x00, 0x48, 0x4D,
51 0xB3, 0x4D, 0x7E, 0x5F, 0xEA, 0x12, 0x9F, 0xD4,
52};
53
Dave Airlief19467c2011-03-22 14:10:27 +100054static const char nouveau_op_dsm_muid[] = {
55 0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,
56 0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0,
57};
58
59static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
60{
61 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
62 struct acpi_object_list input;
63 union acpi_object params[4];
64 union acpi_object *obj;
Peter Lekensteynd0992302011-12-17 12:54:04 +010065 int i, err;
66 char args_buff[4];
Dave Airlief19467c2011-03-22 14:10:27 +100067
68 input.count = 4;
69 input.pointer = params;
70 params[0].type = ACPI_TYPE_BUFFER;
71 params[0].buffer.length = sizeof(nouveau_op_dsm_muid);
72 params[0].buffer.pointer = (char *)nouveau_op_dsm_muid;
73 params[1].type = ACPI_TYPE_INTEGER;
74 params[1].integer.value = 0x00000100;
75 params[2].type = ACPI_TYPE_INTEGER;
76 params[2].integer.value = func;
77 params[3].type = ACPI_TYPE_BUFFER;
Peter Lekensteynd0992302011-12-17 12:54:04 +010078 params[3].buffer.length = 4;
79 /* ACPI is little endian, AABBCCDD becomes {DD,CC,BB,AA} */
80 for (i = 0; i < 4; i++)
81 args_buff[i] = (arg >> i * 8) & 0xFF;
82 params[3].buffer.pointer = args_buff;
Dave Airlief19467c2011-03-22 14:10:27 +100083
84 err = acpi_evaluate_object(handle, "_DSM", &input, &output);
85 if (err) {
86 printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
87 return err;
88 }
89
90 obj = (union acpi_object *)output.pointer;
91
92 if (obj->type == ACPI_TYPE_INTEGER)
93 if (obj->integer.value == 0x80000002) {
94 return -ENODEV;
95 }
96
97 if (obj->type == ACPI_TYPE_BUFFER) {
98 if (obj->buffer.length == 4 && result) {
99 *result = 0;
100 *result |= obj->buffer.pointer[0];
101 *result |= (obj->buffer.pointer[1] << 8);
102 *result |= (obj->buffer.pointer[2] << 16);
103 *result |= (obj->buffer.pointer[3] << 24);
104 }
105 }
106
107 kfree(output.pointer);
108 return 0;
109}
110
Francisco Jerez6e86e042010-07-03 18:36:39 +0200111static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000112{
Ben Skeggs6ee73862009-12-11 19:24:15 +1000113 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
114 struct acpi_object_list input;
115 union acpi_object params[4];
116 union acpi_object *obj;
117 int err;
118
Ben Skeggs6ee73862009-12-11 19:24:15 +1000119 input.count = 4;
120 input.pointer = params;
121 params[0].type = ACPI_TYPE_BUFFER;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000122 params[0].buffer.length = sizeof(nouveau_dsm_muid);
123 params[0].buffer.pointer = (char *)nouveau_dsm_muid;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000124 params[1].type = ACPI_TYPE_INTEGER;
125 params[1].integer.value = 0x00000102;
126 params[2].type = ACPI_TYPE_INTEGER;
127 params[2].integer.value = func;
128 params[3].type = ACPI_TYPE_INTEGER;
129 params[3].integer.value = arg;
130
131 err = acpi_evaluate_object(handle, "_DSM", &input, &output);
132 if (err) {
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000133 printk(KERN_INFO "failed to evaluate _DSM: %d\n", err);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000134 return err;
135 }
136
137 obj = (union acpi_object *)output.pointer;
138
139 if (obj->type == ACPI_TYPE_INTEGER)
140 if (obj->integer.value == 0x80000002)
141 return -ENODEV;
142
143 if (obj->type == ACPI_TYPE_BUFFER) {
144 if (obj->buffer.length == 4 && result) {
145 *result = 0;
146 *result |= obj->buffer.pointer[0];
147 *result |= (obj->buffer.pointer[1] << 8);
148 *result |= (obj->buffer.pointer[2] << 16);
149 *result |= (obj->buffer.pointer[3] << 24);
150 }
151 }
152
153 kfree(output.pointer);
154 return 0;
155}
156
Peter Lekensteyn9075e852011-12-17 12:53:43 +0100157/* Returns 1 if a DSM function is usable and 0 otherwise */
158static int nouveau_test_dsm(acpi_handle test_handle,
159 int (*dsm_func)(acpi_handle, int, int, uint32_t *),
160 int sfnc)
161{
162 u32 result = 0;
163
164 /* Function 0 returns a Buffer containing available functions. The args
165 * parameter is ignored for function 0, so just put 0 in it */
166 if (dsm_func(test_handle, 0, 0, &result))
167 return 0;
168
169 /* ACPI Spec v4 9.14.1: if bit 0 is zero, no function is supported. If
170 * the n-th bit is enabled, function n is supported */
171 return result & 1 && result & (1 << sfnc);
172}
173
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000174static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id)
Ben Skeggs6ee73862009-12-11 19:24:15 +1000175{
Dave Airlie000703f2011-05-09 11:40:25 +1000176 mxm_wmi_call_mxmx(mux_id == NOUVEAU_DSM_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
Dave Airlie81161882010-12-06 12:57:45 +1000177 mxm_wmi_call_mxds(mux_id == NOUVEAU_DSM_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000178 return nouveau_dsm(handle, NOUVEAU_DSM_LED, mux_id, NULL);
179}
Ben Skeggs6ee73862009-12-11 19:24:15 +1000180
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000181static int nouveau_dsm_set_discrete_state(acpi_handle handle, enum vga_switcheroo_state state)
182{
183 int arg;
184 if (state == VGA_SWITCHEROO_ON)
185 arg = NOUVEAU_DSM_POWER_SPEED;
186 else
187 arg = NOUVEAU_DSM_POWER_STAMINA;
188 nouveau_dsm(handle, NOUVEAU_DSM_POWER, arg, NULL);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000189 return 0;
190}
191
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000192static int nouveau_dsm_switchto(enum vga_switcheroo_client_id id)
Ben Skeggs6ee73862009-12-11 19:24:15 +1000193{
Dave Airliec839d742012-11-02 11:04:27 +1000194 if (!nouveau_dsm_priv.dsm_detected)
Peter Lekensteynd0992302011-12-17 12:54:04 +0100195 return 0;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000196 if (id == VGA_SWITCHEROO_IGD)
Dave Airliefc5ea292010-05-31 17:10:52 +1000197 return nouveau_dsm_switch_mux(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_LED_STAMINA);
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000198 else
Dave Airliefc5ea292010-05-31 17:10:52 +1000199 return nouveau_dsm_switch_mux(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_LED_SPEED);
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000200}
Ben Skeggs6ee73862009-12-11 19:24:15 +1000201
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000202static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id,
203 enum vga_switcheroo_state state)
204{
205 if (id == VGA_SWITCHEROO_IGD)
206 return 0;
207
Peter Lekensteynd0992302011-12-17 12:54:04 +0100208 /* Optimus laptops have the card already disabled in
209 * nouveau_switcheroo_set_state */
Dave Airliec839d742012-11-02 11:04:27 +1000210 if (!nouveau_dsm_priv.dsm_detected)
Peter Lekensteynd0992302011-12-17 12:54:04 +0100211 return 0;
212
Dave Airliefc5ea292010-05-31 17:10:52 +1000213 return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dhandle, state);
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000214}
215
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000216static int nouveau_dsm_get_client_id(struct pci_dev *pdev)
217{
Dave Airlied1fbd9232010-12-06 12:56:44 +1000218 /* easy option one - intel vendor ID means Integrated */
219 if (pdev->vendor == PCI_VENDOR_ID_INTEL)
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000220 return VGA_SWITCHEROO_IGD;
Dave Airlied1fbd9232010-12-06 12:56:44 +1000221
222 /* is this device on Bus 0? - this may need improving */
223 if (pdev->bus->number == 0)
224 return VGA_SWITCHEROO_IGD;
225
226 return VGA_SWITCHEROO_DIS;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000227}
228
229static struct vga_switcheroo_handler nouveau_dsm_handler = {
230 .switchto = nouveau_dsm_switchto,
231 .power_state = nouveau_dsm_power_state,
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000232 .get_client_id = nouveau_dsm_get_client_id,
233};
234
Dave Airlief19467c2011-03-22 14:10:27 +1000235static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000236{
237 acpi_handle dhandle, nvidia_handle;
238 acpi_status status;
Peter Lekensteyn9075e852011-12-17 12:53:43 +0100239 int retval = 0;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000240
241 dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
242 if (!dhandle)
243 return false;
Dave Airlieafeb3e12010-04-07 13:55:09 +1000244
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000245 status = acpi_get_handle(dhandle, "_DSM", &nvidia_handle);
246 if (ACPI_FAILURE(status)) {
247 return false;
248 }
249
Peter Lekensteyn9075e852011-12-17 12:53:43 +0100250 if (nouveau_test_dsm(dhandle, nouveau_dsm, NOUVEAU_DSM_POWER))
Dave Airlief19467c2011-03-22 14:10:27 +1000251 retval |= NOUVEAU_DSM_HAS_MUX;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000252
Peter Lekensteyn9075e852011-12-17 12:53:43 +0100253 if (nouveau_test_dsm(dhandle, nouveau_optimus_dsm,
254 NOUVEAU_DSM_OPTIMUS_FN))
Dave Airlief19467c2011-03-22 14:10:27 +1000255 retval |= NOUVEAU_DSM_HAS_OPT;
256
257 if (retval)
258 nouveau_dsm_priv.dhandle = dhandle;
259
260 return retval;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000261}
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000262
263static bool nouveau_dsm_detect(void)
264{
265 char acpi_method_name[255] = { 0 };
266 struct acpi_buffer buffer = {sizeof(acpi_method_name), acpi_method_name};
267 struct pci_dev *pdev = NULL;
268 int has_dsm = 0;
Dave Airlieaddde4e2012-05-02 20:26:24 +0100269 int has_optimus = 0;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000270 int vga_count = 0;
Dave Airlie81161882010-12-06 12:57:45 +1000271 bool guid_valid;
Dave Airlief19467c2011-03-22 14:10:27 +1000272 int retval;
273 bool ret = false;
Dave Airlie81161882010-12-06 12:57:45 +1000274
Dave Airlief19467c2011-03-22 14:10:27 +1000275 /* lookup the MXM GUID */
Dave Airlie81161882010-12-06 12:57:45 +1000276 guid_valid = mxm_wmi_supported();
Dave Airlie81161882010-12-06 12:57:45 +1000277
Dave Airlief19467c2011-03-22 14:10:27 +1000278 if (guid_valid)
279 printk("MXM: GUID detected in BIOS\n");
Dave Airlieafeb3e12010-04-07 13:55:09 +1000280
Dave Airlief19467c2011-03-22 14:10:27 +1000281 /* now do DSM detection */
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000282 while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
283 vga_count++;
284
Dave Airlief19467c2011-03-22 14:10:27 +1000285 retval = nouveau_dsm_pci_probe(pdev);
Dave Airlief19467c2011-03-22 14:10:27 +1000286 if (retval & NOUVEAU_DSM_HAS_MUX)
287 has_dsm |= 1;
288 if (retval & NOUVEAU_DSM_HAS_OPT)
289 has_optimus = 1;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000290 }
291
Dave Airliec839d742012-11-02 11:04:27 +1000292 /* find the optimus DSM or the old v1 DSM */
293 if (has_optimus == 1) {
294 acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME,
295 &buffer);
296 printk(KERN_INFO "VGA switcheroo: detected Optimus DSM method %s handle\n",
297 acpi_method_name);
298 nouveau_dsm_priv.optimus_detected = true;
299 ret = true;
300 } else if (vga_count == 2 && has_dsm && guid_valid) {
Peter Lekensteynd0992302011-12-17 12:54:04 +0100301 acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME,
302 &buffer);
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000303 printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n",
Peter Lekensteynd0992302011-12-17 12:54:04 +0100304 acpi_method_name);
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000305 nouveau_dsm_priv.dsm_detected = true;
Dave Airlief19467c2011-03-22 14:10:27 +1000306 ret = true;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000307 }
Dave Airlief19467c2011-03-22 14:10:27 +1000308
Dave Airlief19467c2011-03-22 14:10:27 +1000309
310 return ret;
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000311}
312
313void nouveau_register_dsm_handler(void)
314{
315 bool r;
316
317 r = nouveau_dsm_detect();
318 if (!r)
319 return;
320
321 vga_switcheroo_register_handler(&nouveau_dsm_handler);
322}
323
Peter Lekensteynd0992302011-12-17 12:54:04 +0100324/* Must be called for Optimus models before the card can be turned off */
325void nouveau_switcheroo_optimus_dsm(void)
326{
327 u32 result = 0;
328 if (!nouveau_dsm_priv.optimus_detected)
329 return;
330
331 nouveau_optimus_dsm(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_OPTIMUS_FN,
332 NOUVEAU_DSM_OPTIMUS_ARGS, &result);
333}
334
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000335void nouveau_unregister_dsm_handler(void)
336{
Andreas Heider2f3787a2012-05-21 00:14:50 +0100337 if (nouveau_dsm_priv.optimus_detected || nouveau_dsm_priv.dsm_detected)
338 vga_switcheroo_unregister_handler();
Dave Airlie6a9ee8a2010-02-01 15:38:10 +1000339}
Dave Airlieafeb3e12010-04-07 13:55:09 +1000340
341/* retrieve the ROM in 4k blocks */
342static int nouveau_rom_call(acpi_handle rom_handle, uint8_t *bios,
343 int offset, int len)
344{
345 acpi_status status;
346 union acpi_object rom_arg_elements[2], *obj;
347 struct acpi_object_list rom_arg;
348 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL};
349
350 rom_arg.count = 2;
351 rom_arg.pointer = &rom_arg_elements[0];
352
353 rom_arg_elements[0].type = ACPI_TYPE_INTEGER;
354 rom_arg_elements[0].integer.value = offset;
355
356 rom_arg_elements[1].type = ACPI_TYPE_INTEGER;
357 rom_arg_elements[1].integer.value = len;
358
359 status = acpi_evaluate_object(rom_handle, NULL, &rom_arg, &buffer);
360 if (ACPI_FAILURE(status)) {
361 printk(KERN_INFO "failed to evaluate ROM got %s\n", acpi_format_exception(status));
362 return -ENODEV;
363 }
364 obj = (union acpi_object *)buffer.pointer;
365 memcpy(bios+offset, obj->buffer.pointer, len);
366 kfree(buffer.pointer);
367 return len;
368}
369
370bool nouveau_acpi_rom_supported(struct pci_dev *pdev)
371{
372 acpi_status status;
373 acpi_handle dhandle, rom_handle;
374
Dave Airlief19467c2011-03-22 14:10:27 +1000375 if (!nouveau_dsm_priv.dsm_detected && !nouveau_dsm_priv.optimus_detected)
Dave Airlieafeb3e12010-04-07 13:55:09 +1000376 return false;
377
378 dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
379 if (!dhandle)
380 return false;
381
382 status = acpi_get_handle(dhandle, "_ROM", &rom_handle);
383 if (ACPI_FAILURE(status))
384 return false;
385
386 nouveau_dsm_priv.rom_handle = rom_handle;
387 return true;
388}
389
390int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len)
391{
392 return nouveau_rom_call(nouveau_dsm_priv.rom_handle, bios, offset, len);
393}
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000394
Ben Skeggsc0077062012-07-26 08:51:21 +1000395void *
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000396nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector)
397{
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000398 struct acpi_device *acpidev;
399 acpi_handle handle;
400 int type, ret;
401 void *edid;
402
403 switch (connector->connector_type) {
404 case DRM_MODE_CONNECTOR_LVDS:
405 case DRM_MODE_CONNECTOR_eDP:
406 type = ACPI_VIDEO_DISPLAY_LCD;
407 break;
408 default:
Ben Skeggsc0077062012-07-26 08:51:21 +1000409 return NULL;
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000410 }
411
412 handle = DEVICE_ACPI_HANDLE(&dev->pdev->dev);
413 if (!handle)
Ben Skeggsc0077062012-07-26 08:51:21 +1000414 return NULL;
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000415
416 ret = acpi_bus_get_device(handle, &acpidev);
417 if (ret)
Ben Skeggsc0077062012-07-26 08:51:21 +1000418 return NULL;
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000419
420 ret = acpi_video_get_edid(acpidev, type, -1, &edid);
421 if (ret < 0)
Ben Skeggsc0077062012-07-26 08:51:21 +1000422 return NULL;
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000423
Ben Skeggsc0077062012-07-26 08:51:21 +1000424 return kmemdup(edid, EDID_LENGTH, GFP_KERNEL);
Ben Skeggsa6ed76d2010-07-12 15:33:07 +1000425}