blob: 7a51608b55ba4effceb2ff6214a14993613e244e [file] [log] [blame]
Ben Skeggs6ee73862009-12-11 19:24:15 +10001/*
2 * Copyright (C) 2007 Ben Skeggs.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial
15 * portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 */
26
Ben Skeggs6ee73862009-12-11 19:24:15 +100027#include "drmP.h"
28#include "drm.h"
29#include "nouveau_drv.h"
Ben Skeggs054b93e2009-12-15 22:02:47 +100030#include "nouveau_grctx.h"
Ben Skeggs6ee73862009-12-11 19:24:15 +100031
Ben Skeggsb8c157d2010-10-20 10:39:35 +100032static int nv40_graph_register(struct drm_device *);
33
Ben Skeggs6ee73862009-12-11 19:24:15 +100034struct nouveau_channel *
35nv40_graph_channel(struct drm_device *dev)
36{
37 struct drm_nouveau_private *dev_priv = dev->dev_private;
38 uint32_t inst;
39 int i;
40
41 inst = nv_rd32(dev, NV40_PGRAPH_CTXCTL_CUR);
42 if (!(inst & NV40_PGRAPH_CTXCTL_CUR_LOADED))
43 return NULL;
44 inst = (inst & NV40_PGRAPH_CTXCTL_CUR_INSTANCE) << 4;
45
46 for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
Ben Skeggscff5c132010-10-06 16:16:59 +100047 struct nouveau_channel *chan = dev_priv->channels.ptr[i];
Ben Skeggs6ee73862009-12-11 19:24:15 +100048
49 if (chan && chan->ramin_grctx &&
Ben Skeggsa8eaebc2010-09-01 15:24:31 +100050 chan->ramin_grctx->pinst == inst)
Ben Skeggs6ee73862009-12-11 19:24:15 +100051 return chan;
52 }
53
54 return NULL;
55}
56
57int
58nv40_graph_create_context(struct nouveau_channel *chan)
59{
60 struct drm_device *dev = chan->dev;
61 struct drm_nouveau_private *dev_priv = dev->dev_private;
Ben Skeggs054b93e2009-12-15 22:02:47 +100062 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
Ben Skeggsec91db22010-07-08 11:53:19 +100063 struct nouveau_grctx ctx = {};
Ben Skeggs6ee73862009-12-11 19:24:15 +100064 int ret;
65
Ben Skeggsa8eaebc2010-09-01 15:24:31 +100066 ret = nouveau_gpuobj_new(dev, chan, pgraph->grctx_size, 16,
67 NVOBJ_FLAG_ZERO_ALLOC, &chan->ramin_grctx);
Ben Skeggs6ee73862009-12-11 19:24:15 +100068 if (ret)
69 return ret;
Ben Skeggs6ee73862009-12-11 19:24:15 +100070
71 /* Initialise default context values */
Ben Skeggsec91db22010-07-08 11:53:19 +100072 ctx.dev = chan->dev;
73 ctx.mode = NOUVEAU_GRCTX_VALS;
Ben Skeggsa8eaebc2010-09-01 15:24:31 +100074 ctx.data = chan->ramin_grctx;
Ben Skeggsec91db22010-07-08 11:53:19 +100075 nv40_grctx_init(&ctx);
Ben Skeggs6ee73862009-12-11 19:24:15 +100076
Ben Skeggs5125bfd2010-09-01 15:24:33 +100077 nv_wo32(chan->ramin_grctx, 0, chan->ramin_grctx->pinst);
Ben Skeggs6ee73862009-12-11 19:24:15 +100078 return 0;
79}
80
81void
82nv40_graph_destroy_context(struct nouveau_channel *chan)
83{
Francisco Jerez3945e472010-10-18 03:53:39 +020084 struct drm_device *dev = chan->dev;
85 struct drm_nouveau_private *dev_priv = dev->dev_private;
86 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
87 unsigned long flags;
88
89 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
90 pgraph->fifo_access(dev, false);
91
92 /* Unload the context if it's the currently active one */
93 if (pgraph->channel(dev) == chan)
94 pgraph->unload_context(dev);
95
96 pgraph->fifo_access(dev, true);
97 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
98
99 /* Free the context resources */
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000100 nouveau_gpuobj_ref(NULL, &chan->ramin_grctx);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000101}
102
103static int
104nv40_graph_transfer_context(struct drm_device *dev, uint32_t inst, int save)
105{
106 uint32_t old_cp, tv = 1000, tmp;
107 int i;
108
109 old_cp = nv_rd32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER);
110 nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
111
112 tmp = nv_rd32(dev, NV40_PGRAPH_CTXCTL_0310);
113 tmp |= save ? NV40_PGRAPH_CTXCTL_0310_XFER_SAVE :
114 NV40_PGRAPH_CTXCTL_0310_XFER_LOAD;
115 nv_wr32(dev, NV40_PGRAPH_CTXCTL_0310, tmp);
116
117 tmp = nv_rd32(dev, NV40_PGRAPH_CTXCTL_0304);
118 tmp |= NV40_PGRAPH_CTXCTL_0304_XFER_CTX;
119 nv_wr32(dev, NV40_PGRAPH_CTXCTL_0304, tmp);
120
121 nouveau_wait_for_idle(dev);
122
123 for (i = 0; i < tv; i++) {
124 if (nv_rd32(dev, NV40_PGRAPH_CTXCTL_030C) == 0)
125 break;
126 }
127
128 nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, old_cp);
129
130 if (i == tv) {
131 uint32_t ucstat = nv_rd32(dev, NV40_PGRAPH_CTXCTL_UCODE_STAT);
132 NV_ERROR(dev, "Failed: Instance=0x%08x Save=%d\n", inst, save);
133 NV_ERROR(dev, "IP: 0x%02x, Opcode: 0x%08x\n",
134 ucstat >> NV40_PGRAPH_CTXCTL_UCODE_STAT_IP_SHIFT,
135 ucstat & NV40_PGRAPH_CTXCTL_UCODE_STAT_OP_MASK);
136 NV_ERROR(dev, "0x40030C = 0x%08x\n",
137 nv_rd32(dev, NV40_PGRAPH_CTXCTL_030C));
138 return -EBUSY;
139 }
140
141 return 0;
142}
143
144/* Restore the context for a specific channel into PGRAPH */
145int
146nv40_graph_load_context(struct nouveau_channel *chan)
147{
148 struct drm_device *dev = chan->dev;
149 uint32_t inst;
150 int ret;
151
152 if (!chan->ramin_grctx)
153 return -EINVAL;
Ben Skeggsa8eaebc2010-09-01 15:24:31 +1000154 inst = chan->ramin_grctx->pinst >> 4;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000155
156 ret = nv40_graph_transfer_context(dev, inst, 0);
157 if (ret)
158 return ret;
159
160 /* 0x40032C, no idea of it's exact function. Could simply be a
161 * record of the currently active PGRAPH context. It's currently
162 * unknown as to what bit 24 does. The nv ddx has it set, so we will
163 * set it here too.
164 */
165 nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
166 nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR,
167 (inst & NV40_PGRAPH_CTXCTL_CUR_INSTANCE) |
168 NV40_PGRAPH_CTXCTL_CUR_LOADED);
169 /* 0x32E0 records the instance address of the active FIFO's PGRAPH
170 * context. If at any time this doesn't match 0x40032C, you will
171 * recieve PGRAPH_INTR_CONTEXT_SWITCH
172 */
173 nv_wr32(dev, NV40_PFIFO_GRCTX_INSTANCE, inst);
174 return 0;
175}
176
177int
178nv40_graph_unload_context(struct drm_device *dev)
179{
180 uint32_t inst;
181 int ret;
182
183 inst = nv_rd32(dev, NV40_PGRAPH_CTXCTL_CUR);
184 if (!(inst & NV40_PGRAPH_CTXCTL_CUR_LOADED))
185 return 0;
186 inst &= NV40_PGRAPH_CTXCTL_CUR_INSTANCE;
187
188 ret = nv40_graph_transfer_context(dev, inst, 1);
189
190 nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, inst);
191 return ret;
192}
193
Francisco Jerez0d87c102009-12-16 12:12:27 +0100194void
Francisco Jereza5cf68b2010-10-24 16:14:41 +0200195nv40_graph_set_tile_region(struct drm_device *dev, int i)
Francisco Jerez0d87c102009-12-16 12:12:27 +0100196{
197 struct drm_nouveau_private *dev_priv = dev->dev_private;
Francisco Jereza5cf68b2010-10-24 16:14:41 +0200198 struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
Francisco Jerez0d87c102009-12-16 12:12:27 +0100199
200 switch (dev_priv->chipset) {
201 case 0x44:
202 case 0x4a:
203 case 0x4e:
Francisco Jereza5cf68b2010-10-24 16:14:41 +0200204 nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch);
205 nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit);
206 nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr);
Francisco Jerez0d87c102009-12-16 12:12:27 +0100207 break;
208
209 case 0x46:
210 case 0x47:
211 case 0x49:
212 case 0x4b:
Francisco Jereza5cf68b2010-10-24 16:14:41 +0200213 nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch);
214 nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit);
215 nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr);
216 nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch);
217 nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit);
218 nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr);
Francisco Jerez0d87c102009-12-16 12:12:27 +0100219 break;
220
221 default:
Francisco Jereza5cf68b2010-10-24 16:14:41 +0200222 nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch);
223 nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit);
224 nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr);
225 nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch);
226 nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit);
227 nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr);
Francisco Jerez0d87c102009-12-16 12:12:27 +0100228 break;
229 }
230}
231
Ben Skeggs6ee73862009-12-11 19:24:15 +1000232/*
233 * G70 0x47
234 * G71 0x49
235 * NV45 0x48
236 * G72[M] 0x46
237 * G73 0x4b
238 * C51_G7X 0x4c
239 * C51 0x4e
240 */
241int
242nv40_graph_init(struct drm_device *dev)
243{
244 struct drm_nouveau_private *dev_priv =
245 (struct drm_nouveau_private *)dev->dev_private;
Francisco Jerez0d87c102009-12-16 12:12:27 +0100246 struct nouveau_fb_engine *pfb = &dev_priv->engine.fb;
Ben Skeggsec91db22010-07-08 11:53:19 +1000247 struct nouveau_grctx ctx = {};
248 uint32_t vramsz, *cp;
Ben Skeggsb8c157d2010-10-20 10:39:35 +1000249 int ret, i, j;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000250
251 nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) &
252 ~NV_PMC_ENABLE_PGRAPH);
253 nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) |
254 NV_PMC_ENABLE_PGRAPH);
255
Ben Skeggsec91db22010-07-08 11:53:19 +1000256 cp = kmalloc(sizeof(*cp) * 256, GFP_KERNEL);
257 if (!cp)
258 return -ENOMEM;
Ben Skeggs054b93e2009-12-15 22:02:47 +1000259
Ben Skeggsec91db22010-07-08 11:53:19 +1000260 ctx.dev = dev;
261 ctx.mode = NOUVEAU_GRCTX_PROG;
262 ctx.data = cp;
263 ctx.ctxprog_max = 256;
264 nv40_grctx_init(&ctx);
265 dev_priv->engine.graph.grctx_size = ctx.ctxvals_pos * 4;
Prarit Bhargavaf49d2732010-05-24 10:24:07 +1000266
Ben Skeggsec91db22010-07-08 11:53:19 +1000267 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
268 for (i = 0; i < ctx.ctxprog_len; i++)
269 nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);
Ben Skeggs054b93e2009-12-15 22:02:47 +1000270
Ben Skeggsec91db22010-07-08 11:53:19 +1000271 kfree(cp);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000272
Ben Skeggsb8c157d2010-10-20 10:39:35 +1000273 ret = nv40_graph_register(dev);
274 if (ret)
275 return ret;
276
Ben Skeggs6ee73862009-12-11 19:24:15 +1000277 /* No context present currently */
278 nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0x00000000);
279
280 nv_wr32(dev, NV03_PGRAPH_INTR , 0xFFFFFFFF);
281 nv_wr32(dev, NV40_PGRAPH_INTR_EN, 0xFFFFFFFF);
282
283 nv_wr32(dev, NV04_PGRAPH_DEBUG_0, 0xFFFFFFFF);
284 nv_wr32(dev, NV04_PGRAPH_DEBUG_0, 0x00000000);
285 nv_wr32(dev, NV04_PGRAPH_DEBUG_1, 0x401287c0);
286 nv_wr32(dev, NV04_PGRAPH_DEBUG_3, 0xe0de8055);
287 nv_wr32(dev, NV10_PGRAPH_DEBUG_4, 0x00008000);
288 nv_wr32(dev, NV04_PGRAPH_LIMIT_VIOL_PIX, 0x00be3c5f);
289
290 nv_wr32(dev, NV10_PGRAPH_CTX_CONTROL, 0x10010100);
291 nv_wr32(dev, NV10_PGRAPH_STATE , 0xFFFFFFFF);
292
293 j = nv_rd32(dev, 0x1540) & 0xff;
294 if (j) {
295 for (i = 0; !(j & 1); j >>= 1, i++)
296 ;
297 nv_wr32(dev, 0x405000, i);
298 }
299
300 if (dev_priv->chipset == 0x40) {
301 nv_wr32(dev, 0x4009b0, 0x83280fff);
302 nv_wr32(dev, 0x4009b4, 0x000000a0);
303 } else {
304 nv_wr32(dev, 0x400820, 0x83280eff);
305 nv_wr32(dev, 0x400824, 0x000000a0);
306 }
307
308 switch (dev_priv->chipset) {
309 case 0x40:
310 case 0x45:
311 nv_wr32(dev, 0x4009b8, 0x0078e366);
312 nv_wr32(dev, 0x4009bc, 0x0000014c);
313 break;
314 case 0x41:
315 case 0x42: /* pciid also 0x00Cx */
316 /* case 0x0120: XXX (pciid) */
317 nv_wr32(dev, 0x400828, 0x007596ff);
318 nv_wr32(dev, 0x40082c, 0x00000108);
319 break;
320 case 0x43:
321 nv_wr32(dev, 0x400828, 0x0072cb77);
322 nv_wr32(dev, 0x40082c, 0x00000108);
323 break;
324 case 0x44:
325 case 0x46: /* G72 */
326 case 0x4a:
327 case 0x4c: /* G7x-based C51 */
328 case 0x4e:
329 nv_wr32(dev, 0x400860, 0);
330 nv_wr32(dev, 0x400864, 0);
331 break;
332 case 0x47: /* G70 */
333 case 0x49: /* G71 */
334 case 0x4b: /* G73 */
335 nv_wr32(dev, 0x400828, 0x07830610);
336 nv_wr32(dev, 0x40082c, 0x0000016A);
337 break;
338 default:
339 break;
340 }
341
342 nv_wr32(dev, 0x400b38, 0x2ffff800);
343 nv_wr32(dev, 0x400b3c, 0x00006000);
344
Francisco Jerez2295e172010-04-06 21:11:58 +0200345 /* Tiling related stuff. */
346 switch (dev_priv->chipset) {
347 case 0x44:
348 case 0x4a:
349 nv_wr32(dev, 0x400bc4, 0x1003d888);
350 nv_wr32(dev, 0x400bbc, 0xb7a7b500);
351 break;
352 case 0x46:
353 nv_wr32(dev, 0x400bc4, 0x0000e024);
354 nv_wr32(dev, 0x400bbc, 0xb7a7b520);
355 break;
356 case 0x4c:
357 case 0x4e:
358 case 0x67:
359 nv_wr32(dev, 0x400bc4, 0x1003d888);
360 nv_wr32(dev, 0x400bbc, 0xb7a7b540);
361 break;
362 default:
363 break;
364 }
365
Francisco Jerez0d87c102009-12-16 12:12:27 +0100366 /* Turn all the tiling regions off. */
367 for (i = 0; i < pfb->num_tiles; i++)
Francisco Jereza5cf68b2010-10-24 16:14:41 +0200368 nv40_graph_set_tile_region(dev, i);
Ben Skeggs6ee73862009-12-11 19:24:15 +1000369
370 /* begin RAM config */
Jordan Crouse01d73a62010-05-27 13:40:24 -0600371 vramsz = pci_resource_len(dev->pdev, 0) - 1;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000372 switch (dev_priv->chipset) {
373 case 0x40:
374 nv_wr32(dev, 0x4009A4, nv_rd32(dev, NV04_PFB_CFG0));
375 nv_wr32(dev, 0x4009A8, nv_rd32(dev, NV04_PFB_CFG1));
376 nv_wr32(dev, 0x4069A4, nv_rd32(dev, NV04_PFB_CFG0));
377 nv_wr32(dev, 0x4069A8, nv_rd32(dev, NV04_PFB_CFG1));
378 nv_wr32(dev, 0x400820, 0);
379 nv_wr32(dev, 0x400824, 0);
380 nv_wr32(dev, 0x400864, vramsz);
381 nv_wr32(dev, 0x400868, vramsz);
382 break;
383 default:
384 switch (dev_priv->chipset) {
385 case 0x46:
386 case 0x47:
387 case 0x49:
388 case 0x4b:
389 nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0));
390 nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1));
391 break;
392 default:
393 nv_wr32(dev, 0x4009F0, nv_rd32(dev, NV04_PFB_CFG0));
394 nv_wr32(dev, 0x4009F4, nv_rd32(dev, NV04_PFB_CFG1));
395 break;
396 }
397 nv_wr32(dev, 0x4069F0, nv_rd32(dev, NV04_PFB_CFG0));
398 nv_wr32(dev, 0x4069F4, nv_rd32(dev, NV04_PFB_CFG1));
399 nv_wr32(dev, 0x400840, 0);
400 nv_wr32(dev, 0x400844, 0);
401 nv_wr32(dev, 0x4008A0, vramsz);
402 nv_wr32(dev, 0x4008A4, vramsz);
403 break;
404 }
405
406 return 0;
407}
408
409void nv40_graph_takedown(struct drm_device *dev)
410{
Ben Skeggs6ee73862009-12-11 19:24:15 +1000411}
412
Ben Skeggsb8c157d2010-10-20 10:39:35 +1000413static int
414nv40_graph_register(struct drm_device *dev)
415{
416 struct drm_nouveau_private *dev_priv = dev->dev_private;
Ben Skeggs6ee73862009-12-11 19:24:15 +1000417
Ben Skeggsb8c157d2010-10-20 10:39:35 +1000418 if (dev_priv->engine.graph.registered)
419 return 0;
420
421 NVOBJ_CLASS(dev, 0x506e, SW); /* nvsw */
422 NVOBJ_CLASS(dev, 0x0030, GR); /* null */
423 NVOBJ_CLASS(dev, 0x0039, GR); /* m2mf */
424 NVOBJ_CLASS(dev, 0x004a, GR); /* gdirect */
425 NVOBJ_CLASS(dev, 0x009f, GR); /* imageblit (nv12) */
426 NVOBJ_CLASS(dev, 0x008a, GR); /* ifc */
427 NVOBJ_CLASS(dev, 0x0089, GR); /* sifm */
428 NVOBJ_CLASS(dev, 0x3089, GR); /* sifm (nv40) */
429 NVOBJ_CLASS(dev, 0x0062, GR); /* surf2d */
430 NVOBJ_CLASS(dev, 0x3062, GR); /* surf2d (nv40) */
431 NVOBJ_CLASS(dev, 0x0043, GR); /* rop */
432 NVOBJ_CLASS(dev, 0x0012, GR); /* beta1 */
433 NVOBJ_CLASS(dev, 0x0072, GR); /* beta4 */
434 NVOBJ_CLASS(dev, 0x0019, GR); /* cliprect */
435 NVOBJ_CLASS(dev, 0x0044, GR); /* pattern */
436 NVOBJ_CLASS(dev, 0x309e, GR); /* swzsurf */
437
438 /* curie */
439 if (dev_priv->chipset >= 0x60 ||
440 0x00005450 & (1 << (dev_priv->chipset & 0x0f)))
441 NVOBJ_CLASS(dev, 0x4497, GR);
442 else
443 NVOBJ_CLASS(dev, 0x4097, GR);
444
Francisco Jerez332b2422010-10-20 23:35:40 +0200445 /* nvsw */
446 NVOBJ_CLASS(dev, 0x506e, SW);
447 NVOBJ_MTHD (dev, 0x506e, 0x0500, nv04_graph_mthd_page_flip);
448
Ben Skeggsb8c157d2010-10-20 10:39:35 +1000449 dev_priv->engine.graph.registered = true;
450 return 0;
451}