// Compute per-vertex normals
void TriMesh::need_normals()
{
	if (normals.size() == vertices.size())
		return;
	need_faces();

	dprintf(stderr, "Computing normals... "); dflush(stderr);

	normals.clear();
	normals.resize(vertices.size());

	int nf = faces.size(), nv = vertices.size(), i;
	for (i = 0; i < nf; i++) {
		const point &p0 = vertices[faces[i][0]];
		const point &p1 = vertices[faces[i][1]];
		const point &p2 = vertices[faces[i][2]];
		vec a = p0-p1, b = p1-p2, c = p2-p0;
		float l2a = len2(a), l2b = len2(b), l2c = len2(c);
		vec facenormal = a CROSS b;
		normals[faces[i][0]] += facenormal * (1.0f / (l2a * l2c));
		normals[faces[i][1]] += facenormal * (1.0f / (l2b * l2a));
		normals[faces[i][2]] += facenormal * (1.0f / (l2c * l2b));
	}

	for (i = 0; i < nv; i++)
		normalize(normals[i]);

	dprintf(stderr, "Done.\n");
}
示例#2
0
/*---------------------------------------------------------------------------+
 * program_ecc.
 *---------------------------------------------------------------------------*/
static void program_ecc(unsigned long start_address, unsigned long num_bytes)
{
	u32 val;
	char str[] = "ECC generation -";
#if defined(CONFIG_PRAM)
	u32 *magicPtr;
	u32 magic;

	if ((mfspr(dbcr0) & 0x80000000) == 0) {
		/* only if no external debugger is alive!
		 * Check whether vxWorks is using EDR logging, if yes zero
		 * also PostMortem and user reserved memory
		 */
		magicPtr = (u32 *)(start_address + num_bytes -
				(CONFIG_PRAM*1024) + sizeof(u32));
		magic = in_be32(magicPtr);
		debug("%s:  CONFIG_PRAM %d kB magic 0x%x 0x%p\n",
		      __FUNCTION__, CONFIG_PRAM,
		      magicPtr, magic);
		if (magic == 0xbeefbabe) {
			printf("%s: preserving at %p\n", __FUNCTION__, magicPtr);
			num_bytes -= (CONFIG_PRAM*1024) - PM_RESERVED_MEM;
		}
	}
#endif

	sync();
	eieio();

	puts(str);

	/* ECC bit set method for cached memory */
	/* Fast method, no noticeable delay */
	dcbz_area(start_address, num_bytes);
	dflush();
	blank_string(strlen(str));

	/* Clear error status */
	mfsdram(DDR0_00, val);
	mtsdram(DDR0_00, val | DDR0_00_INT_ACK_ALL);

	/*
	 * Clear possible ECC errors
	 * If not done, then we could get an interrupt later on when
	 * exceptions are enabled.
	 */
	mtspr(mcsr, mfspr(mcsr));

	/* Set 'int_mask' parameter to functionnal value */
	mfsdram(DDR0_01, val);
	mtsdram(DDR0_01, ((val &~ DDR0_01_INT_MASK_MASK) |
			  DDR0_01_INT_MASK_ALL_OFF));

	return;
}
示例#3
0
// Push a NxN tile from the L2 cache back to system memory
void Surface::flushTile(int left, int top)
{
    const int kStride = (fWidth - kTileSize) * kBytesPerPixel;
    unsigned int ptr = fBaseAddress + left * kBytesPerPixel + top * fWidth 
        * kBytesPerPixel;
    for (int y = 0; y < kTileSize; y++)
    {
        for (int x = 0; x < kTileSize; x += 16)
        {
            dflush(ptr);
            ptr += kCacheLineSize;
        }
        
        ptr += kStride;
    }
}
示例#4
0
/* ---------------- Statistics ---------------- */

#ifdef DEBUG
const char *const cmd_op_names[16] =
{cmd_op_name_strings};
static const char *const cmd_misc_op_names[16] =
{cmd_misc_op_name_strings};
static const char *const cmd_misc2_op_names[16] =
{cmd_misc2_op_name_strings};
static const char *const cmd_segment_op_names[16] =
{cmd_segment_op_name_strings};
static const char *const cmd_path_op_names[16] =
{cmd_path_op_name_strings};
const char *const *const cmd_sub_op_names[16] =
{cmd_misc_op_names, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0,
 0, cmd_misc2_op_names, cmd_segment_op_names, cmd_path_op_names
};
struct stats_cmd_s {
    ulong op_counts[256];
    ulong op_sizes[256];
    ulong tile_reset, tile_found, tile_added;
    ulong same_band, other_band;
} stats_cmd;
extern ulong stats_cmd_diffs[5];	/* in gxclpath.c */
int
cmd_count_op(int op, uint size)
{
    stats_cmd.op_counts[op]++;
    stats_cmd.op_sizes[op] += size;
    if (gs_debug_c('L')) {
	const char *const *sub = cmd_sub_op_names[op >> 4];

	if (sub)
	    dlprintf2(", %s(%u)\n", sub[op & 0xf], size);
	else
	    dlprintf3(", %s %d(%u)\n", cmd_op_names[op >> 4], op & 0xf,
		      size);
	dflush();
    }
    return op;
}
示例#5
0
static int
sparc_print_page(gx_device_printer *pdev, FILE *prn)
  {
  struct lpvi_page lpvipage;
  struct lpvi_err lpvierr;
  char *out_buf;
  int out_size;
  if (ioctl(fileno(prn),LPVIIOC_GETPAGE,&lpvipage)!=0)
    {
    errprintf(pdev->memory, "sparc_print_page: LPVIIOC_GETPAGE failed\n");
    return -1;
    }
  lpvipage.bitmap_width=gdev_mem_bytes_per_scan_line((gx_device *)pdev);
  lpvipage.page_width=lpvipage.bitmap_width*8;
  lpvipage.page_length=pdev->height;
  lpvipage.resolution = (pdev->x_pixels_per_inch == 300 ? DPI300 : DPI400);
  if (ioctl(fileno(prn),LPVIIOC_SETPAGE,&lpvipage)!=0)
    {
    errprintf(pdev->memory, "sparc_print_page: LPVIIOC_SETPAGE failed\n");
    return -1;
    }
  out_size=lpvipage.bitmap_width*lpvipage.page_length;
  out_buf=gs_malloc(pdev->memory, out_size,1,"sparc_print_page: out_buf");
  gdev_prn_copy_scan_lines(pdev,0,out_buf,out_size);
  while (write(fileno(prn),out_buf,out_size)!=out_size)
    {
    if (ioctl(fileno(prn),LPVIIOC_GETERR,&lpvierr)!=0)
      {
      errprintf(pdev->memory, "sparc_print_page: LPVIIOC_GETERR failed\n");
      return -1;
      }
    switch (lpvierr.err_type)
      {
      case 0:
        if (warning==0)
          {
          errprintf(pdev->memory,
                    "sparc_print_page: Printer Problem with unknown reason...");
          dflush();
          warning=1;
          }
        sleep(5);
        break;
      case ENGWARN:
        errprintf(pdev->memory,
                  "sparc_print_page: Printer-Warning: %s...",
                  err_code_string(lpvierr.err_code));
        dflush();
        warning=1;
        sleep(5);
        break;
      case ENGFATL:
        errprintf(pdev->memory,
                  "sparc_print_page: Printer-Fatal: %s\n",
                  err_code_string(lpvierr.err_code));
        return -1;
      case EDRVR:
        errprintf(pdev->memory,
                  "sparc_print_page: Interface/driver error: %s\n",
                  err_code_string(lpvierr.err_code));
        return -1;
      default:
        errprintf(pdev->memory,
                  "sparc_print_page: Unknown err_type=%d(err_code=%d)\n",
                  lpvierr.err_type,lpvierr.err_code);
        return -1;
      }
    }
  if (warning==1)
    {
    errprintf(pdev->memory, "OK.\n");
    warning=0;
    }
  gs_free(pdev->memory, out_buf,out_size,1,"sparc_print_page: out_buf");
  return 0;
  }
示例#6
0
/* Look up a font. */
static gx_xfont *
x_lookup_font(gx_device * dev, const byte * fname, uint len,
	    int encoding_index, const gs_uid * puid, const gs_matrix * pmat,
	      gs_memory_t * mem)
{
    gx_device_X *xdev = (gx_device_X *) dev;
    x_xfont *xxf;
    char x11template[256];
    char *x11fontname = NULL;
    XFontStruct *x11font;
    x11fontmap *fmp;
    double height;
    int xwidth, xheight, angle;
    Boolean My;
    bool scalable_font;

    if (!xdev->useXFonts)
	return NULL;

    if (pmat->xy == 0 && pmat->yx == 0) {
	xwidth = fabs(pmat->xx * 1000) + 0.5;
	xheight = fabs(pmat->yy * 1000) + 0.5;
	height = fabs(pmat->yy * 1000);
	angle = (pmat->xx > 0 ? 0 : 180);
	My = (pmat->xx > 0 && pmat->yy > 0) || (pmat->xx < 0 && pmat->yy < 0);
    } else if (pmat->xx == 0 && pmat->yy == 0) {
	xwidth = fabs(pmat->xy * 1000) + 0.5;
	xheight = fabs(pmat->yx * 1000) + 0.5;
	height = fabs(pmat->yx * 1000);
	angle = (pmat->yx < 0 ? 90 : 270);
	My = (pmat->yx > 0 && pmat->xy < 0) || (pmat->yx < 0 && pmat->xy > 0);
    } else {
	return NULL;
    }

    /* Don't do very small fonts, where font metrics are way off */
    /* due to rounding and the server does a very bad job of scaling, */
    /* or very large fonts, where we can do just as good a job and */
    /* the server may lock up the entire window system while rasterizing */
    /* the whole font. */
    if (xwidth < min_X_font_size || xwidth > max_X_font_size ||
	xheight < min_X_font_size || xheight > max_X_font_size
	)
	return NULL;

    if (!xdev->useFontExtensions && (My || angle != 0))
	return NULL;

    switch (encoding_index) {
    case 0:
	fmp = find_fontmap(xdev->regular_fonts, fname, len);
	if (fmp == NULL)
	    return NULL;
	x11fontname =
	    find_x_font(xdev, x11template, fmp, "Adobe-fontspecific",
			&fmp->std, xheight, &scalable_font);
	if (!x11fontname) {
	    x11fontname =
		find_x_font(xdev, x11template, fmp, "ISO8859-1",
			    &fmp->iso, xheight, &scalable_font);
	    encoding_index = 1;
	}
	break;
    case 1:
	fmp = find_fontmap(xdev->regular_fonts, fname, len);
	if (fmp == NULL)
	    return NULL;
	x11fontname =
	    find_x_font(xdev, x11template, fmp, "ISO8859-1",
			&fmp->iso, xheight, &scalable_font);
	if (!x11fontname) {
	    x11fontname =
		find_x_font(xdev, x11template, fmp, "Adobe-fontspecific",
			    &fmp->std, xheight, &scalable_font);
	    encoding_index = 0;
	}
	break;
    case 2:
	fmp = xdev->symbol_fonts;
	goto sym;
    case 3:
	fmp = xdev->dingbat_fonts;
sym:	fmp = find_fontmap(fmp, fname, len);
	if (fmp == NULL)
	    return NULL;
	x11fontname =
	    find_x_font(xdev, x11template, fmp, "Adobe-fontspecific",
			&fmp->std, xheight, &scalable_font);
    default:
	return NULL;
    }
    if (!x11fontname)
	return NULL;

    if (xwidth != xheight || angle != 0 || My) {
	if (!xdev->useScalableFonts || !scalable_font)
	    return NULL;
	sprintf(x11template, "%s%s+%d-%d+%d-0-0-0-*-0-%s",
		fmp->x11_name, (My ? "+My" : ""),
		angle * 64, xheight, xwidth,
		(encoding_index == 1 ? "ISO8859-1" : "Adobe-fontspecific"));
	x11fontname = x11template;
    }
    x11font = XLoadQueryFont(xdev->dpy, x11fontname);
    if (x11font == NULL)
	return NULL;
    /* Don't bother with 16-bit or 2 byte fonts yet */
    if (x11font->min_byte1 || x11font->max_byte1) {
	XFreeFont(xdev->dpy, x11font);
	return NULL;
    }
    xxf = gs_alloc_struct(mem, x_xfont, &st_x_xfont, "x_lookup_font");
    if (xxf == NULL)
	return NULL;
    xxf->common.procs = &x_xfont_procs;
    xxf->xdev = xdev;
    xxf->font = x11font;
    xxf->encoding_index = encoding_index;
    xxf->My = (My ? -1 : 1);
    xxf->angle = angle;
    if (xdev->logXFonts) {
	dprintf3("Using %s\n  for %s at %g pixels.\n", x11fontname,
		 fmp->ps_name, height);
	dflush();
    }
    return (gx_xfont *) xxf;
}
示例#7
0
void srun() {                              /*  simulation RUN routine */

    int  lj, dcounter ; double  tmm ;   /* dcounter for MM displays <***/

    runf=1 ;              /* to keep display label in command mode */

    if (relval[mmm+15]<1) relval[mmm+15]=1 ;  /* MM must be >=1    */
       
    if (relval[mmm+1]<=1) relval[mmm+1]=251 ; /* AN=NN output pts. */
    if (relval[mmm+4]<=0) {                                /* TMAX */
	if (size) derror(87) ;
	else relval[mmm+4]=relval[mmm+1]-1 ;             /* irule 0 */
    }
    zCOMINT=relval[mmm+4]/(relval[mmm+1]-1) ; /* COMINT =TMAX/(NN-1)   <*****/

    if (INITE1>0) ICOM=1 ;   /* initially, ICOM>0 only if INITE1>0 */
    else ICOM= -1 ;             /* for "continued-run" store, etc. */

    if (size) {                              /* "true" integration */
	if (relval[mmm+5]==1.1E-275) relval[mmm+5]=0 ; /**!!**//* t */
	if (relval[mmm+3]<=0) relval[mmm+3]=zCOMINT/2 ;    /*default DT <****/
	if (relval[mmm+3]>zCOMINT) derror(110) ;    
/*   <**** DT is too large *******/
	/***         since          
		     DT <=TMAX/(NN-1)=COMINT ,   
		     NN <= (TMAX/DT) + 1            ***/         
	relval[mmm-3]=relval[mmm+3] ;          /* save DT for reset */
	for (lj=1 ; lj<= nn1 ; lj++)
	    storesv[lj]=dpsv[lj]=relval[lj] ;       
/* save state vars. for reset, make duplicates for integration */
	hdt=relval[mmm+3]/2 ;                         /* DT/2 */

	if ((size>3)&&(size!=5)) { /* prepare for variable-step integration */
	    if (relval[mmm+9]<=0) relval[mmm+9]=0.001 ;     /* ERMAX */
	    if (size<9) {
                if (relval[mmm+7]<=0 || relval[mmm+7]>zCOMINT)  
		    relval[mmm+7]=zCOMINT ;        /* DTMAX      <****/
                          
                if (relval[mmm+8]<=0 || relval[mmm+8]>relval[mmm+7])
		    relval[mmm+8]=relval[mmm+3]/16 ;   /* DTMIN */
                if (relval[mmm+10]<=0 || relval[mmm+10]>relval[mmm+9])
		    relval[mmm+10]=0.01*relval[mmm+9] ;   /* ERMIN */
                if (relval[mmm+2]>nn1) derror(93) ; /*CHECKN too large*/
	    }                          /* 3 < irule < 9 and not 5 */
	    else if (jcstart==0 && (size==10 || size==14))
		derror(229) ;     /* missing JACOBIAN */
	}                                 /* irule > 3 and not 5 */
    }                                             /* irule != 0 */
          
    else if (relval[mmm+5]==1.1E-275) relval[mmm+5]=1 ; 
    /***!!!***/ /* irule 0 */
                                               
    t0=relval[mmm-2]=relval[mmm+5] ;        /* save t0=t for reset */
    tmm=t0+relval[mmm+4] ;                        /* tmm = t0+TMAX */
    ztnext=t0+zCOMINT ;                /* tnext = t0 + COMINT <*****/

    dflag=dispp && dbegin ; sflag=disk && sbegin ;

/* ------------------------------------------------------------------ */

    if (dflag) {                          /* start display, if any */

	lj=dbegin ;               /* start of display label, if any */

	if (dmode<0) {                   /* "type"; do header label */
	    if (!typeflg) {                  /* ## suppresses header */
                WRITELN ; 
                fprintf(outptr,"\n\nt,   ") ;
                if (ferror(outptr)) derror(106) ;
                while (warea[lj]!=lf && warea[lj]!='|') 
		    putc(warea[lj++],outptr) ;      
	    }
	    fprintf(outptr,"\n\n") ;     /* could be printer or file */
	}                                           /* if "type" */

	else if (dispp>0) drstart() ;  /* dmode>=0, start CRT graph */
    }                               /* unless we have display 2 */             
/* ------------------------------------------------------------------ */

    if (rbegin) {
	if (fd[maxchan-1]==NULL) { chanlno=maxchan-1 ; derror(64) ; }
    }                                               /* not open */
    if (sflag) {                           /* connect .TIM file(s) */
	strcpy(fname,pname) ;
	lj=0 ;
	if (fname[lj]=='.') lj++ ; if (fname[lj]=='.') lj++ ;
	do lj++ ; while (fname[lj]!='.') ;         /* get extension */
	fname[lj+1]='T' ; fname[lj+2]='I' ; fname[lj+3]='M' ;
	fname[lj+4]=0 ;

	if (fd[maxchan]!=NULL)
	{ chanlno=maxchan ; derror(63) ; }               /* busy */

	if ((fd[maxchan]=fopen(fname,"w"))==NULL) derror(11) ; 
    }
/* ------------------------------------------------------------------ */
    /* communication loop */

    /*  NOTE: on "continued" runs, displays and stash files
	DUPLICATE the last point of a run as the first point
	of the "continued" run. "Continued" runs reproduced
	from .RCV files necessarily have THE SAME t0, TMAX,
	and NN as the original runs, so that the duplicated
	points are reproduced correctly.

	Time histories reproduced from STORE or DELAY arrays,
	however, do NOT contain duplicated points and can be
	used anywhere in a subsequent run.                  */

/*  ------------------------------------------------------------------ */
    IDERIV=1 ;           /* IDERIV>0, state variables valid */
    dcounter=0 ;                                /* initialize dcounter  <*****/

    /* initially, ICOM>0 only if INITE1>0;  otherwise, for continued-run
       STORE etc., ICOM<0, so the duplicate endpoints are not stored.
       Now make the initial derivative call; this scheme ensures that
       defined variables can be computed for output */

/*  ------------------------------------ */

    if (size>8) {        /* use GEAR module, initialize if INITE1>0 */

	if (nn1>EQUMAX) derror(100) ;    /* too many state variables */
	TOUT=ztnext ;                  /* tnext for GEARER.C */
	if (INITE1>0) aINDEX=1 ;   /* ** was in gearstart ** */

	do {   /* because of duplicate derve1, ICOM, INITE1 are OFF! */

	    if (rbegin) { recovr() ; if (errnum) goto L5 ; }
	    drun00(2) ; if (errnum) goto L5 ;
             
	    if (dcounter == 0) {  
/*  display only once in MM communication points <***/
		if (dflag) { if (dmode>=0) disply() ; else typex() ; }
		if (sflag) dstor() ;
	    }                                     
	    if (++dcounter==relval[mmm+15]) dcounter=0 ;    /*   <*****/
	    
	    ICOM=INITE1= -1 ;     /* ICOM<0, INITE1<0 for store, etc. */

	    DRIVE(); if (errnum) goto L5 ;    
/* driver routine in GEAR also increments TOUT by COMINT */
	    ICOM=1 ;                /* ICOM>0, mark next output point */
	    if (spare1) {                       /* look at ctl-c flag */
                spare1=0 ;
                if (lj=getchar()!=lf) {errnum=306 ; goto L55 ; }
	    }

	} while (relval[mmm+5]-tmm<0) ;    /* t - (t0 + TMAX) < 0 */
    }                                           /* if Gear module */

    else do {             /* NOT Gear module; ICOM, INITE1 are OFF! */
	if (rbegin) { recovr() ; if (errnum) goto L5 ; }
	drun00(2) ; if (errnum) goto L5 ; 
/* initial values of defined variables */
	if (dcounter == 0) {  
/*  display only once in MM communication points <***/
	    if (dflag) { if (dmode>=0) disply() ; else typex() ; }
	    if (sflag) dstor() ;
	}                                     
	if (++dcounter==relval[mmm+15]) dcounter=0 ;          /*   <*****/   
         
	ICOM=INITE1= -1 ;    /* ICOM<0, INITE1<0
				for store, etc. */
	switch(size) {
	    case 0 : relval[mmm+5]=ztnext ; break ;  
/* dummy integrator: t=tnext */
	    case 1 : ru1() ; break ;       /* integration loops */
	    case 2 : ru2() ; break ;
	    case 3 : ru3() ; break ;
	    case 4 : ru4() ; break ;
	    case 5 : ru5() ; break ;
	    case 6 : ru6() ; break ;
	    case 7 : ru7() ; break ;
	    case 8 : ru8() ; break ;

	} if (errnum) goto L5 ;

	ztnext+=zCOMINT ;          /* tnext=tnext+COMINT <*****/
	ICOM=1 ;                   /* ICOM>0, mark next output point */
  
	if (spare1) {                          /* look at ctl-c flag */
	    spare1=0 ;
	    if (lj=getchar()!=lf) {errnum=306 ; goto L55 ; }
	}

    } while (relval[mmm+5]-tmm<0) ;       /* t - (t0 + TMAX) < 0 */

/* ------------------------------------------------------------------- */
    /* last point */
    if (rbegin) { recovr() ; if (errnum) goto L5 ; }
    drun00(2) ; if (!errnum) goto L6 ;

    /* clean up; some of those errors are not errors! */

    L5 :   if (errnum==303) { errnum=0 ; goto L6 ; } /* derve1 terminated */
    if (errnum==305) {
	printf("\n Warning: END OF FILE or error on recover -    ") ;
	errnum=0 ;                        /* EOF or error on recover */
    }
    if (errnum>=304) errnum=0 ;                              /* eof */
    goto L55 ;         /* close stash and/or recovr file(s), if any */

    L6 :   if (dflag) { if (dmode>=0) disply() ; else typex() ; } /* last */
    if (sflag) dstor() ;                                   /* point */

    L55 :  if (sflag) {                        /* close stash file, if any */
	if (fclose(fd[maxchan])==EOF)  derror(95) ;
	fd[maxchan]=NULL ;
    }
    if (rbegin) {                     /* close recover file, if any */
	if (fclose(fd[maxchan-1])==EOF) derror(95) ;
	fd[maxchan-1]=NULL ;
    }
    if (!dflag || dmode<0) WRITELN ; else dflush() ;
    if (errnum) derror(errnum) ;
}                                                       /* srun */
static void program_ecc(u32 start_address,
			u32 num_bytes,
			u32 tlb_word2_i_value)
{
	u32 current_address;
	u32 end_address;
	u32 address_increment;
	u32 val;
	char str[] = "ECC generation -";
	char slash[] = "\\|/-\\|/-";
	int loop = 0;
	int loopi = 0;

	current_address = start_address;

	sync();
	eieio();
	wait_ddr_idle();

	if (tlb_word2_i_value == TLB_WORD2_I_ENABLE) {
		/* ECC bit set method for non-cached memory */
		address_increment = 4;
		end_address = current_address + num_bytes;

		puts(str);

		while (current_address < end_address) {
			*((u32 *)current_address) = 0x00000000;
			current_address += address_increment;

			if ((loop++ % (2 << 20)) == 0) {
				putc('\b');
				putc(slash[loopi++ % 8]);
			}
		}

		blank_string(strlen(str));
	} else {
		/* ECC bit set method for cached memory */
#if 0 /* test-only: will remove this define later, when ECC problems are solved! */
		/*
		 * Some boards (like lwmon5) need to preserve the memory
		 * content upon ECC generation (for the log-buffer).
		 * Therefore we don't fill the memory with a pattern or
		 * just zero it, but write the same values back that are
		 * already in the memory cells.
		 */
		address_increment = CFG_CACHELINE_SIZE;
		end_address = current_address + num_bytes;

		current_address = start_address;
		while (current_address < end_address) {
			/*
			 * TODO: Th following sequence doesn't work correctly.
			 * Just invalidating and flushing the cache doesn't
			 * seem to trigger the re-write of the memory.
			 */
			ppcDcbi(current_address);
			ppcDcbf(current_address);
			current_address += CFG_CACHELINE_SIZE;
		}
#else
		dcbz_area(start_address, num_bytes);
		dflush();
#endif
	}

	sync();
	eieio();
	wait_ddr_idle();

	/* Clear error status */
	mfsdram(DDR0_00, val);
	mtsdram(DDR0_00, val | DDR0_00_INT_ACK_ALL);

	/* Set 'int_mask' parameter to functionnal value */
	mfsdram(DDR0_01, val);
	mtsdram(DDR0_01, ((val &~ DDR0_01_INT_MASK_MASK) | DDR0_01_INT_MASK_ALL_OFF));

	sync();
	eieio();
	wait_ddr_idle();
}