Пример #1
0
/* Initializes OTG Phy. */
void otg_phy_init(void) {

	writel(readl(S3C_OTHERS)|S3C_OTHERS_USB_SIG_MASK, S3C_OTHERS);
	writel(0x0, S3C_USBOTG_PHYPWR);		/* Power up */
        writel(OTGH_PHY_CLK_VALUE, S3C_USBOTG_PHYCLK);
	writel(0x1, S3C_USBOTG_RSTCON);

	udelay(50);
	writel(0x0, S3C_USBOTG_RSTCON);
	udelay(50);
}
EXPORT_SYMBOL(otg_phy_init);

/* USB Control request data struct must be located here for DMA transfer */
struct usb_ctrlrequest usb_ctrl __attribute__((aligned(8)));
EXPORT_SYMBOL(usb_ctrl);

/* OTG PHY Power Off */
void otg_phy_off(void) {
	writel(readl(S3C_USBOTG_PHYPWR)|(0x1F<<1), S3C_USBOTG_PHYPWR);
	writel(readl(S3C_OTHERS)&~S3C_OTHERS_USB_SIG_MASK, S3C_OTHERS);
}
EXPORT_SYMBOL(otg_phy_off);

void usb_host_clk_en(void) {
	struct clk *otg_clk;

        switch (S3C_USB_CLKSRC) {
	case 0: /* epll clk */
		writel((readl(S3C_CLK_SRC)& ~S3C6400_CLKSRC_UHOST_MASK)
Пример #2
0
/* { dg-final { scan-assembler-times "ldr\t" 1 } } */
/* { dg-final { scan-assembler-times "swl\t" 1 } } */
/* { dg-final { scan-assembler-times "swr\t" 1 } } */
/* { dg-final { scan-assembler-times "lwl\t" 1 } } */
/* { dg-final { scan-assembler-times "lwr\t" 1 } } */
/* { dg-final { scan-assembler-not "nop" } } */

/* Test to make sure we produce the unaligned load/store for
   both 64bit and 32bits sized accesses.  */

struct s
{
  char c;
  int i;
  long long l;
} __attribute__ ((packed)) s __attribute__((aligned(1) ));

void
sd (long long l)
{
  s.l = l;
}

long long
ld ()
{
  return s.l;
}

void
sw (int i)
Пример #3
0
	struct bio_set *bios;
};

/*
 * Aligning 'struct io' reduces the number of bits required to store
 * its address.  Refer to store_io_and_region_in_bio() below.
 */
struct io {
	unsigned long error_bits;
	unsigned long eopnotsupp_bits;
	atomic_t count;
	struct task_struct *sleeper;
	struct dm_io_client *client;
	io_notify_fn callback;
	void *context;
} __attribute__((aligned(DM_IO_MAX_REGIONS)));

static struct kmem_cache *_dm_io_cache;

/*
 * io contexts are only dynamically allocated for asynchronous
 * io.  Since async io is likely to be the majority of io we'll
 * have the same number of io contexts as bios! (FIXME: must reduce this).
 */

static unsigned int pages_to_ios(unsigned int pages)
{
	return 4 * pages;	/* too many ? */
}

/*
Пример #4
0
// Debugging
//#define DEBUG

#ifdef DEBUG
#define deprintf(fmt, args... ) \
	fprintf( stdout, fmt, ##args ); \
	fflush( stdout );
#else
#define deprintf( fmt, args... )
#endif

void cpy_to_fb(unsigned int);

/* fb_writer_spu parms */
static volatile struct fb_writer_parms_t parms __attribute__ ((aligned(128)));

/* Code running on SPU */
int main(unsigned long long spe_id __attribute__ ((unused)), unsigned long long argp __attribute__ ((unused)))
{
	deprintf("[SPU] fb_writer_spu is up... (on SPE #%llu)\n", spe_id);
	uint32_t ea_mfc, mbox;
	// send ready message
	spu_write_out_mbox(SPU_READY);

	while (1) {
		/* Check mailbox */
		mbox = spu_read_in_mbox();
		deprintf("[SPU] Message is %u\n", mbox);
		switch (mbox) {
			case SPU_EXIT:
Пример #5
0
#include "types.h"
#include "stat.h"
#include "user.h"

int stack[4096] __attribute__ ((aligned (4096)));
int x = 0;

int main(int argc, char *argv[]) {
  printf(1, "Stack is at %p\n", stack);
  // int tid = fork();
  int tid = clone(stack);

  printf(1, "tid = %d\n", tid);
  if (tid < 0) {
    printf(2, "error!\n");
  } else if (tid == 0) {
    printf(1, "CHILD!\n");
    // child
    for(;;) {
      x++;
      sleep(100);
    }
  } else {
    // parent
    printf(1, "PARENT!\n");
    for(;;) {
      printf(1, "x = %d\n", x);
      sleep(100);
    }
  }
Пример #6
0
//{{BLOCK(_0953)

//======================================================================
//
//	_0953, 40x40@8, 
//	+ palette 256 entries, not compressed
//	+ 25 tiles lz77 compressed
//	Total size: 512 + 1460 = 1972
//
//	Time-stamp: 2014-11-28, 05:19:42
//	Exported by Cearn's GBA Image Transmogrifier, v0.8.12
//	( http://www.coranac.com/projects/#grit )
//
//======================================================================

const unsigned int _0953Tiles[365] __attribute__((aligned(4))) __attribute__((visibility("hidden")))=
{
	0x00064010,0xBEBEBE00,0x795CBA6B,0x0710869E,0xB0795C6B,0x0F000E10,0xBABA20B0,0x795C0100,
	0x02BABA2B,0x5C878787,0x0730B657,0x6BB61002,0x841F006B,0x806B7902,0xB0BE2E00,0x8E377902,
	0x6363017D,0xBAF9CF63,0x8006000D,0x326B0700,0x75756363,0x13A800A8,0x7591637D,0x9D006E75,
	0x32327D13,0x000F9DD9,0x7D7D134F,0x6E90E8E8,0x8E704B00,0xD9D97DE8,0x00254069,0x1FE83207,
	0x00CF0931,0x72A2A63E,0xCF6D7272,0x07301440,0xACA86E14,0x7200CFCF,0x1418189B,0x0056CFAC,
	0x69B43D9B,0x6E1818AA,0x123E3E00,0x3112CECE,0x9B63001F,0x0A0ACECE,0xAA0047CE,0x0A12CB14,
	0x00CE680A,0x9B6D14EB,0x44956DE2,0x6D11AD00,0x4EE2E26D,0x11CC0095,0x6D4E9B9B,0x95004E4E,
	0x44C53D5B,0x00957474,0x3E3DCCE2,0x44743634,0x3D446D00,0xAD36443D,0x44440044,0xAC67A8A8,

	0xAD003434,0xCFCF1434,0x006744A4,0xC4CA8934,0xE5CACA33,0xC4BCBC00,0x06E5C4CA,0xC1C100FB,
	0xE5335B11,0xDF00DFBC,0x5BCCCC8B,0x00D18BE9,0x959582DF,0xDFDFCA95,0x00D1A720,0xC1C17F07,
	0x74008B8B,0xBC7F4495,0x00DF828B,0xCA118989,0xA78282FB,0x6B050182,0x5702C26B,0x80790740,
	0xC26B1F11,0xBE6B5757,0x17008170,0x70705757,0x0740BE70,0x020F10A2,0x79C26F21,0xBA3D0102,
	0x7913BA00,0xE843BE57,0x4B9D0475,0x00138F24,0x20D90707,0x0710458F,0xFDFD6ED9,0xE87D001C,
Пример #7
0
//Receive buffer
#pragma data_alignment = 4
static uint8_t rxBuffer[M2SXXX_ETH_RX_BUFFER_COUNT][M2SXXX_ETH_RX_BUFFER_SIZE];
//Transmit DMA descriptors
#pragma data_alignment = 4
static M2sxxxTxDmaDesc txDmaDesc[M2SXXX_ETH_TX_BUFFER_COUNT];
//Receive DMA descriptors
#pragma data_alignment = 4
static M2sxxxRxDmaDesc rxDmaDesc[M2SXXX_ETH_RX_BUFFER_COUNT];

//Keil MDK-ARM or GCC compiler?
#else

//Transmit buffer
static uint8_t txBuffer[M2SXXX_ETH_TX_BUFFER_COUNT][M2SXXX_ETH_TX_BUFFER_SIZE]
   __attribute__((aligned(4)));
//Receive buffer
static uint8_t rxBuffer[M2SXXX_ETH_RX_BUFFER_COUNT][M2SXXX_ETH_RX_BUFFER_SIZE]
   __attribute__((aligned(4)));
//Transmit DMA descriptors
static M2sxxxTxDmaDesc txDmaDesc[M2SXXX_ETH_TX_BUFFER_COUNT]
   __attribute__((aligned(4)));
//Receive DMA descriptors
static M2sxxxRxDmaDesc rxDmaDesc[M2SXXX_ETH_RX_BUFFER_COUNT]
   __attribute__((aligned(4)));

#endif

//Pointer to the current TX DMA descriptor
static M2sxxxTxDmaDesc *txCurDmaDesc;
//Pointer to the current RX DMA descriptor
Пример #8
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * This code is a complete clean re-write of the stress tool by
 * Colin Ian King <*****@*****.**> and attempts to be
 * backwardly compatible with the stress tool by Amos Waterland
 * <*****@*****.**> but has more stress tests and more
 * functionality.
 *
 */
#include <stddef.h>

int __attribute__ ((aligned(64))) test_align64(void);

int main(void)
{
	const ptrdiff_t addr = (ptrdiff_t)test_align64;

	(void)test_align64();

	return addr & 63;
}

int __attribute__ ((aligned(64))) test_align64(void)
{
	return 0;
}
/*=============================================================================*/
 

/*----------------------------dgemm_middle Code-------------------------------*/
static void dgemm_middle(const double*restrict A, const double*restrict B, double*restrict C){
/*----------------------------------------------------------------------------- 
PURPOSE: Takes fixed sized matrices A and B, size L2_BLK_SIZE, Outputs result matrix C.  
ARGUEMENTS:
-----------------------------------------------------------------------------*/

int n = L2_BLK_SIZE; // Size of Matrix 
int n_bloc = L2_BLK_SIZE/L1_BLK_SIZE; // Number of Blocks
int b = L1_BLK_SIZE; // Block Size

/* Make static matrices */
static __attribute__ ((aligned(16))) double a_block[L1_BLK_SIZE*L1_BLK_SIZE];
static __attribute__ ((aligned(16))) double b_block[L1_BLK_SIZE*L1_BLK_SIZE];
static __attribute__ ((aligned(16))) double c_block[L1_BLK_SIZE*L1_BLK_SIZE]; 

CleanMatrix(c_block, b, b);

for( int j = 0; j < n_bloc; j++){
	for( int i=0; i < n_bloc; i++){
		BlockMatrix(C, c_block, n, n, b, i, j);
		for( int k = 0; k < n_bloc ; k++){
		BlockMatrix(A, a_block, n, n, b, i, k);
		BlockMatrix(B, b_block, n, n, b, k, j);
		dgemm_lowest( a_block, b_block, c_block);
		CleanMatrix(a_block, b, b);
		CleanMatrix(b_block, b, b);	
		}
Пример #10
0
tContext g_sContext;

/******************************************************************************
*
*  page tables start must be aligned in 16K boundary
*
*******************************************************************************/

#ifdef __TMS470__
#pragma DATA_ALIGN(pageTable, 16384);
static volatile unsigned int pageTable[4*1024];
#elif defined(__IAR_SYSTEMS_ICC__)
#pragma data_alignment=16384
static volatile unsigned int pageTable[4*1024];
#else
static volatile unsigned int pageTable[4*1024] __attribute__((aligned(16*1024)));
#endif

/******************************************************************************
*
*  Memory that is used as the local frame buffer.
*
*******************************************************************************/

#if defined(__IAR_SYSTEMS_ICC__)
#pragma data_alignment=4
unsigned char g_pucBuffer[GrOffScreen24BPPSize(LCD_WIDTH, LCD_HEIGHT, PIXEL_24_BPP_UNPACKED)];
#elif defined __TMS470__ || defined _TMS320C6X
#pragma DATA_ALIGN(g_pucBuffer, 4);
unsigned char g_pucBuffer[GrOffScreen24BPPSize(LCD_WIDTH, LCD_HEIGHT, PIXEL_24_BPP_UNPACKED)];
#else
Пример #11
0
/**
 * @file salloc.c
 * @brief quick & dirty memory allocator
 * @author Duboisset Philippe <*****@*****.**>
 * @version 0.1b
 * @date (yyyy-mm-dd) 2013-04-07
 * Licence: MIT
 */

#include "salloc.h"


/**
 * local variables
 */
static uint8_t __attribute__ ((aligned(4)))allocArray[SALLOC_SIZE];
static uint32_t offset = 0;


/**
 * @function salloc
 * @brief allocate memory
 * @param uint32_t byteNeeded: contiguous memory to allocate, in bytes
 * @return void *: pointer to allocated memory if success, NULL if error
 */
void *salloc(uint32_t byteNeeded) {

  void *res = NULL;

  /*check remaining space (and offset + byteNeeded overflow) */
  if(byteNeeded < SALLOC_SIZE && offset + byteNeeded < SALLOC_SIZE) {
Пример #12
0
/*/////////////////////////////////////////////////////////////////////////
// Definitions for communication structures
/////////////////////////////////////////////////////////////////////////*/

#define CMD_START (-3)
#define CMD_STOP  (-2)
#define CMD_NULL  (-1)

struct packet_t {
  volatile int yval;
  volatile int xstart;
  volatile int xend;
  volatile int xstep;
  volatile int cmd;
} __attribute__ ((aligned (8)));

struct rowbuf_t {
  volatile char data[COLS];
  volatile int cmd;
} __attribute__ ((aligned (8)));

struct mpb_t {
  struct packet_t packet;
  struct rowbuf_t row;
} __attribute__ ((aligned (8)));

struct mpb_master_t {
  struct mpb_t slave[SLAVES];
} __attribute__ ((aligned (8)));
Пример #13
0
	      (THREE, = 3, "comment on enum value"),
	      (FOUR, /* value */, /* comment */, { "metadata as a void pointer" }),
	      (FIVE, /* value */, /* comment */, { "metadata as a void pointer" }, "char" /* type of metadata void pointer as string */),
	      (SIX, /* value */, /* comment */, { (mr_enum_t[]){ 2 } }, "mr_enum_t" /* even enum itself */),
	      SEVEN /* trailing comma is optional */
	      )

TYPEDEF_ENUM (mr_bitmask_t,
	      (NONE, = 0),
	      (FIRST, = 1 << 0),
	      (SECOND, = 1 << 1),
	      (THIRD, = 1 << 2),
	      (FORTH, = 1 << 3),
	      )

TYPEDEF_ENUM (mr_enum_uint8_t, ATTRIBUTES (__attribute__ ((packed, aligned (sizeof (uint8_t))))),
	      UINT8_ZERO, UINT8_ONE, (UINT8_TWO, = 2), (UINT8_THREE, = 3))
TYPEDEF_ENUM (mr_enum_uint16_t, ATTRIBUTES (__attribute__ ((packed, aligned (sizeof (uint16_t))))),
	      UINT16_ZERO, UINT16_ONE, (UINT16_TWO, = 2), (UINT16_THREE, = 3))
TYPEDEF_ENUM (mr_enum_uint32_t, ATTRIBUTES (__attribute__ ((packed, aligned (sizeof (uint32_t))))),
	      UINT32_ZERO, UINT32_ONE, (UINT32_TWO, = 2), (UINT32_THREE, = 3))
TYPEDEF_ENUM (mr_enum_uint64_t, ATTRIBUTES (__attribute__ ((packed, aligned (sizeof (uint64_t))))),
	      UINT64_ZERO, UINT64_ONE, (UINT64_TWO, = 2), (UINT64_THREE, = 3))

TYPEDEF_STRUCT (struct_mr_enum_t, (mr_enum_t, x))
TYPEDEF_STRUCT (struct_mr_enum_uint8_t, (mr_enum_uint8_t, x))
TYPEDEF_STRUCT (struct_mr_enum_uint16_t, (mr_enum_uint16_t, x))
TYPEDEF_STRUCT (struct_mr_enum_uint32_t, (mr_enum_uint32_t, x))
TYPEDEF_STRUCT (struct_mr_enum_uint64_t, (mr_enum_uint64_t, x))
TYPEDEF_STRUCT (struct_mr_bitmask_t, BITMASK (mr_bitmask_t, x))
Пример #14
0
/* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
/* { dg-options "-mcpu=power9 -O2" } */
/* { dg-require-effective-target powerpc_p9vector_ok } */

static unsigned short x[(16384/sizeof(unsigned short))] __attribute__ ((aligned (16)));
static unsigned short y[(16384/sizeof(unsigned short))] __attribute__ ((aligned (16)));
static unsigned short a;

void obfuscate(void *a, ...);

static void __attribute__((noinline)) do_one(void)
{
 unsigned long i;

 obfuscate(x, y, &a);

 for (i = 0; i < (16384/sizeof(unsigned short)); i++)
  y[i] = a * x[i];

 obfuscate(x, y, &a);
}

int main(void)
{
 unsigned long i;

 for (i = 0; i < 1000000; i++)
  do_one();

 return 0;
Пример #15
0
Файл: ui.c Проект: kradhub/pspdc
 */

#include <pspuser.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <psputility_netconf.h>
#include <pspgu.h>

#include "ui.h"
#include "menu.h"
#include "color.h"
#include "psplog.h"

extern int running;

unsigned int __attribute__((aligned(16))) list[4096];

#define EVENT_BUTTON_DOWN(latch, button) \
	(((latch)->uiPress & (button)) && ((latch)->uiMake & (button)))

enum
{
	FLIGHT_MAIN_MENU_QUIT = 0,
	FLIGHT_MAIN_MENU_FLAT_TRIM,
	FLIGHT_MAIN_MENU_PILOTING_SETTINGS,
	FLIGHT_MAIN_MENU_CONTROLS_SETTINGS,
	FLIGHT_MAIN_MENU_DRONE_INFO,
};

enum
{
Пример #16
0
//static const char g_pcTwirl[4] = { '\\', '|', '/', '-' };

//*****************************************************************************
//
// The control table used by the uDMA controller.  This table must be aligned
// to a 1024 byte boundary.
//
//*****************************************************************************
#if defined(ewarm)
#pragma data_alignment=1024
unsigned char ucControlTable[1024];
#elif defined(ccs)
#pragma DATA_ALIGN(ucControlTable, 1024)
unsigned char ucControlTable[1024];
#else
unsigned char ucControlTable[1024] __attribute__ ((aligned(1024)));
#endif

//*****************************************************************************
//
// The error routine that is called if the driver library encounters an error.
//
//*****************************************************************************
#ifdef DEBUG
void
__error__(char *pcFilename, unsigned long ulLine)
{
}
#endif

//*****************************************************************************
Пример #17
0
#define next(i)		(*((MEM_ULONG *) (i+4)))
#define status(i)	(*((MEM_U8 *) (i+8)))
#define setalign(i,y)  (*((MEM_U8 *)(i-1))) = y
#define getalign(i)  (*((MEM_U8 *)(i-1)))

#define size(i)		(next(i)-i-SIZE_HEADER)

/* if going to split free block, need at least 8 bytes in new free part */

#define MIN_FREE_BYTES   4
#if JZ4740_PMP16
static MEM_U8 *memory = (MEM_U8 *)DRVMEMADDR;
#define MEM_LENGHT DRVMEMLEN
#else
#define MEM_LENGHT (1024*1024*4)
static MEM_U8 memory[MEM_LENGHT] __attribute__ ((aligned (32)));
#endif

static MEM_ULONG first = 0; /*stores address of first byte of heap*/

#if JZ4740_PMP16
static MEM_ULONG last = DRVMEMLEN; /*store address of last byte of heap + 1*/
#else
static MEM_ULONG last = MEM_LENGHT; /*store address of last byte of heap + 1*/
#endif

#define DEBUG_DRV_MEM 1
#if DEBUG_DRV_MEM
static MEM_U8* cur_max_mem;
#endif
Пример #18
0
   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/

#include "blis.h"
#include "immintrin.h"


/* Union data structure to access AVX registers
   One 256-bit AVX register holds 8 SP elements. */
typedef union
{
	__m256  v;
	float   f[8] __attribute__((aligned(64)));
} v8sf_t;

typedef union
{
	__m128  v;
	float   f[4];
} v4sf_t;

/* Union data structure to access AVX registers
   One 256-bit AVX register holds 4 DP elements. */
typedef union
{
	__m256d v;
	double  d[4] __attribute__((aligned(64)));
}v4df_t;
Пример #19
0
int ebiosread(int dev, unsigned long long sec, int count)
{
	int i;
    
	static struct
	{
		unsigned char  size;
		unsigned char  reserved;
		unsigned char  numblocks;
		unsigned char  reserved2;
		unsigned short bufferOffset;
		unsigned short bufferSegment;
		unsigned long  long startblock;
	} addrpacket __attribute__((aligned(16))) = {0};
	addrpacket.size = sizeof(addrpacket);

	for (i = 0; ;)
	{
		bb.intno   = 0x13;
		bb.eax.r.h = 0x42;
		bb.edx.r.l = dev;
		bb.esi.rr  = NORMALIZED_OFFSET((unsigned)&addrpacket);
		bb.ds      = NORMALIZED_SEGMENT((unsigned)&addrpacket);
		addrpacket.reserved = addrpacket.reserved2 = 0;
		addrpacket.numblocks     = count;
		addrpacket.bufferOffset  = OFFSET(ptov(BIOS_ADDR));
		addrpacket.bufferSegment = SEGMENT(ptov(BIOS_ADDR));
		addrpacket.startblock    = sec;
		bios(&bb);

		// In case of a successful call, make sure we set AH (return code) to zero.
		if (bb.flags.cf == 0)
		{
			bb.eax.r.h = 0;
		}
		
		// Now we can really check for the return code (AH) value.
		if ((bb.eax.r.h == 0x00) || (i++ >= 5))
		{
			break;
		}

        // Reset disk subsystem and try again.
		bb.eax.r.h = 0x00;
		bios(&bb);
	}

	return bb.eax.r.h;
}


//==============================================================================

void putc(int ch)
{
	bb.intno	= 0x10;
	bb.ebx.r.h	= 0x00;  /* background black */
	bb.ebx.r.l	= 0x0F;  /* foreground white */
	bb.eax.r.h	= 0x0e;
	bb.eax.r.l	= ch;
	bios(&bb);
}
Пример #20
0
//{{BLOCK(_4107)

//======================================================================
//
//	_4107, 40x40@8,
//	+ palette 256 entries, not compressed
//	+ 25 tiles lz77 compressed
//	Total size: 512 + 1540 = 2052
//
//	Time-stamp: 2014-11-28, 05:20:06
//	Exported by Cearn's GBA Image Transmogrifier, v0.8.12
//	( http://www.coranac.com/projects/#grit )
//
//======================================================================

const unsigned int _4107Tiles[385] __attribute__((aligned(4))) __attribute__((visibility("hidden")))=
{
    0x00064010,0x07F7F70A,0x9A010007,0xF89A0730,0x07F007F0,0x18001610,0xF29A0630,0xE0A8049C,
    0x10DF7255,0x20033107,0x0F000E1D,0x0AF1E0E0,0x999A211E,0xC9250710,0x0F10279A,0x9A1EA702,
    0x00BCF127,0x2700690F,0xF1BCA899,0x80CBB6F1,0x5AC60700,0x24C8F3F1,0x18C9006E,0x696C69C9,
    0x6E00B4C9,0x69331833,0x003323CA,0x2D2F2D18,0x33C9D921,0x7CC17C00,0xC96C212D,0x2D1800C1,
    0xE67C7A86,0x2F00C17C,0x867A86A6,0x800E3CC1,0x3CC80100,0x5B193796,0xB8370024,0xB8333323,
    0xCA00964E,0x29467FBB,0x00FAD671,0xA56FA504,0x96CA2329,0xEAB04300,0x6CB861AA,0xA5B000CA,
    0x8A7CCA6C,0x3A00EBE8,0xE8BBA585,0x000C43DA,0xEA466DEB,0x212DDA2F,0xBE7A8608,0xE607307A,
    0x36004E7A,0x044A04D8,0x00CAAF39,0x044D4D73,0x4D8B39AF,0x7F4A6200,0x8B39934D,0x977108FA,

    0x07007F9D,0x00AA0643,0xFC6F8BFC,0x4E73438B,0x04A53900,0x77A64A93,0xB08500F8,0xFB62C397,
    0x6D00F877,0x621F08B0,0x03073F9A,0x9A9AD29A,0x07106699,0x10D20800,0x661E010F,0x278D1B21,
    0x00F20630,0x279A9999,0xF2F29A27,0x2799F200,0x27662727,0x9C030027,0x9C828282,0x03009999,
    0x319C2703,0x30315A9F,0x2E018945,0x3C8C0700,0xBC009C99,0xC716BCC6,0x00A89C89,0x1616C6BC,
    0x8299B1C7,0x07001642,0xBC9C92BF,0x00570F10,0x9FC616C7,0x9F5A5AC6,0xC6A8C710,0x31310600,
Пример #21
0
/* Index permutation routines in C for IA-32 processors
 * (interface compatible with IP routines in nwchem/tce)
 * Author: Qingda Lu ([email protected])
 * Time: 12/2006
 */


#include <stdio.h>
#include <xmmintrin.h>
#include <emmintrin.h>

#if defined(__GNUC__)
static double buf[256] __attribute__ ((aligned(128)));
static double buf1[256] __attribute__ ((aligned(128)));
#elif defined(__INTEL_COMPILER) || defined(__ICC) 
__declspec(align(128)) static double buf[256],buf1[256];
#endif

#define linesize 64
#define tilesize 8

void copy(double* a,double* b,long size,double factor) {
  int i;
  for (i = 0; i < size; i++)
    b[i] = a[i]*factor;
}

void tce_sort_0_(double* unsorted,double* sorted,double* factor) {
  *sorted = (*unsorted) * (*factor);
}
    
Пример #22
0
    Blocked( const Blocked &other ) : all( other.all ){}

    Blocked& operator += ( const Blocked &rhs )
    {
       if( ! rhs.bec.blocked )
       {
          (this)->bec.count += rhs.bec.count;
       }
       return( *this );
    }
    struct blocked_and_counter
    {
       value_type   blocked;
       value_type    count;
    };
    
    union
    {
        blocked_and_counter bec;
        whole_type          all = 0;
    };

    char pad[ L1D_CACHE_LINE_SIZE - sizeof( whole_type ) ]; 
}
#if __APPLE__ || __linux
__attribute__ (( aligned( 64 )))
#endif
;

#endif /* END _BLOCKED_HPP_ */
Пример #23
0
void cpy_to_fb(unsigned int tag_id_base)
{
	unsigned int i;
	unsigned char current_buf;
	uint8_t *in = parms.data;

	/* Align fb pointer which was centered before */
	uint8_t *fb =
	    (unsigned char *)((unsigned int)parms.center & 0xFFFFFFF0);

	uint32_t bounded_input_height = parms.bounded_input_height;
	uint32_t bounded_input_width = parms.bounded_input_width;
	uint32_t fb_pixel_size = parms.fb_pixel_size;

	uint32_t out_line_stride = parms.out_line_stride;
	uint32_t in_line_stride = parms.in_line_stride;
	uint32_t in_line_size = bounded_input_width * fb_pixel_size;

	current_buf = 0;

	/* Local store buffer */
	static volatile uint8_t buf[4][BUFFER_SIZE]
	    __attribute__ ((aligned(128)));
	/* do 4-times multibuffering using DMA list, process in two steps */
	for (i = 0; i < bounded_input_height >> 2; i++) {
		/* first buffer */
		DMA_WAIT_TAG(tag_id_base + 1);
		// retrieve buffer
		spu_mfcdma32(buf[0], (unsigned int)in, in_line_size,
			     tag_id_base + 1, MFC_GETB_CMD);
		DMA_WAIT_TAG(tag_id_base + 1);
		// store buffer
		spu_mfcdma32(buf[0], (unsigned int)fb, in_line_size,
			     tag_id_base + 1, MFC_PUTB_CMD);
		in += in_line_stride;
		fb += out_line_stride;
		deprintf("[SPU] 1st buffer copied in=0x%x, fb=0x%x\n", in,
		       fb);

		/* second buffer */
		DMA_WAIT_TAG(tag_id_base + 2);
		// retrieve buffer
		spu_mfcdma32(buf[1], (unsigned int)in, in_line_size,
			     tag_id_base + 2, MFC_GETB_CMD);
		DMA_WAIT_TAG(tag_id_base + 2);
		// store buffer
		spu_mfcdma32(buf[1], (unsigned int)fb, in_line_size,
			     tag_id_base + 2, MFC_PUTB_CMD);
		in += in_line_stride;
		fb += out_line_stride;
		deprintf("[SPU] 2nd buffer copied in=0x%x, fb=0x%x\n", in,
		       fb);

		/* third buffer */
		DMA_WAIT_TAG(tag_id_base + 3);
		// retrieve buffer
		spu_mfcdma32(buf[2], (unsigned int)in, in_line_size,
			     tag_id_base + 3, MFC_GETB_CMD);
		DMA_WAIT_TAG(tag_id_base + 3);
		// store buffer
		spu_mfcdma32(buf[2], (unsigned int)fb, in_line_size,
			     tag_id_base + 3, MFC_PUTB_CMD);
		in += in_line_stride;
		fb += out_line_stride;
		deprintf("[SPU] 3rd buffer copied in=0x%x, fb=0x%x\n", in,
		       fb);

		/* fourth buffer */
		DMA_WAIT_TAG(tag_id_base + 4);
		// retrieve buffer
		spu_mfcdma32(buf[3], (unsigned int)in, in_line_size,
			     tag_id_base + 4, MFC_GETB_CMD);
		DMA_WAIT_TAG(tag_id_base + 4);
		// store buffer
		spu_mfcdma32(buf[3], (unsigned int)fb, in_line_size,
			     tag_id_base + 4, MFC_PUTB_CMD);
		in += in_line_stride;
		fb += out_line_stride;
		deprintf("[SPU] 4th buffer copied in=0x%x, fb=0x%x\n", in,
		       fb);
		deprintf("[SPU] Loop #%i, bounded_input_height=%i\n", i,
		       bounded_input_height >> 2);
	}
	DMA_WAIT_TAG(tag_id_base + 2);
	DMA_WAIT_TAG(tag_id_base + 3);
	DMA_WAIT_TAG(tag_id_base + 4);
}
Пример #24
0
#include "usb.h"
#include "usblib.h"
#include "usb-ids.h"
#include "usbdevice.h"
#include "usbdmsc.h"
#include "usb_msc_structs.h"
#include "cache.h"            
#include "cppi41dma.h"
#include "delay.h"
#include "mmu.h"

#if defined(__IAR_SYSTEMS_ICC__)
#pragma data_alignment=(16*1024)
static volatile unsigned int pageTable[4*1024];
#else
static volatile unsigned int pageTable[4*1024]__attribute__((aligned(16*1024)));
#endif
unsigned char *dataBuffer;
#define START_ADDR_DDR                     (0x80000000)
#define START_ADDR_DEV                     (0x44000000)
#define START_ADDR_OCMC                    (0x40300000)
#define NUM_SECTIONS_DDR                   (512)
#define NUM_SECTIONS_DEV                   (960)
#define NUM_SECTIONS_OCMC                  (1)

static void MMUConfigAndEnable(void);

//*****************************************************************************
//
//! \addtogroup example_list
//! <h1>USB MSC Device (usb_dev_msc)</h1>
Пример #25
0
//{{BLOCK(_0886)

//======================================================================
//
//	_0886, 40x40@8, 
//	+ palette 256 entries, not compressed
//	+ 25 tiles lz77 compressed
//	Total size: 512 + 1496 = 2008
//
//	Time-stamp: 2014-11-28, 05:19:41
//	Exported by Cearn's GBA Image Transmogrifier, v0.8.12
//	( http://www.coranac.com/projects/#grit )
//
//======================================================================

const unsigned int _0886Tiles[374] __attribute__((aligned(4))) __attribute__((visibility("hidden")))=
{
	0x00064010,0x1CFFEE00,0x1AC36454,0xEE86009E,0x54649494,0x8D00941A,0x224F1A44,0x00772D92,
	0x9E928D44,0xD81A9222,0xBF22BF00,0x771FC492,0x92F100C5,0x22921F8D,0xD800C5E9,0xF1FEBFD8,
	0x007B6C81,0x535CC58A,0x967BF18A,0xB18D7700,0x70707050,0x19FB00AF,0x70B6C0C1,0x7700AFFC,
	0xC0C16790,0x00AFC0C0,0x670CE72D,0x33CAA3A3,0x6715ED00,0xCA67A3A1,0xF9ED0041,0xA3A12767,
	0xED00AF41,0xC1C102F9,0x00B66DC1,0xB427F9AA,0xB6AFC1C1,0x0B6DFC00,0x7CAE1B0B,0xFCFC007C,
	0xFD2FD63C,0x2C00F2A2,0x0F6B4206,0x0089E583,0xB3D92F3C,0x83838324,0xE0FDC800,0xE52480B3,
	0x262F20E5,0x52890700,0x006B9CE5,0x24890F75,0xD9F22424,0xE0759800,0xAE9875E0,0xD6C8009A,
	0x464655DD,0xFD00F2CC,0x5555DDC8,0x00892855,0x16DD42E3,0xE5E54646,0x6EFD5100,0xE55D4616,

	0xE8510252,0xB8B8166E,0x006B0700,0x47B8556E,0xA8662424,0x4E506E00,0xA8759846,0x87B100D0,
	0x46464646,0xCF00CFEA,0x4647CF46,0x005DEAB8,0x5D4ECFCF,0x327B5D5D,0x4E4E4E08,0x7A070046,
	0xCF404E4E,0xEAEA0700,0xCFCF4ECF,0xAA475D18,0x17002010,0x4882EA82,0x5D370047,0x11072047,
	0x81008ADF,0x5B43C58A,0x008A5C5C,0x9FDF5C5C,0x8A45DC8A,0xF6451102,0x10C4F143,0x8A00DC07,
	0x5C45C76C,0x005CBFF1,0x45A0FEBF,0x1FC45CC4,0x1F45BF00,0xD8B01FF1,0xBF19001F,0xBFC7B0B0,
Пример #26
0
#include <stdint.h>
#include "dma_api_HAL.h"
#include "em_dma.h"
#include "em_cmu.h"

/** DMA control block array, requires proper alignment. */
#if defined (__ICCARM__)
#pragma data_alignment=DMACTRL_ALIGNMENT
DMA_DESCRIPTOR_TypeDef dmaControlBlock[DMACTRL_CH_CNT * 2];

#elif defined (__CC_ARM)
DMA_DESCRIPTOR_TypeDef dmaControlBlock[DMACTRL_CH_CNT * 2] __attribute__ ((aligned(DMACTRL_ALIGNMENT)));

#elif defined (__GNUC__)
DMA_DESCRIPTOR_TypeDef dmaControlBlock[DMACTRL_CH_CNT * 2] __attribute__ ((aligned(DMACTRL_ALIGNMENT), section("dma")));

#else
#error Undefined toolkit, need to define alignment
#endif

uint32_t channels = 0; // Bit vector of taken channels
bool enabled = false;

void dma_init(void)
{
  if (enabled) return;
  DMA_Init_TypeDef   dmaInit;

  CMU_ClockEnable(cmuClock_DMA, true);
  CMU_ClockEnable(cmuClock_HFPER, true);
Пример #27
0
//Palette created using Mollusk's PAGfxConverter

const unsigned short brick1yellow_Pal[4] __attribute__ ((aligned (4))) = {
    64543, 39903, 32768, 36501
};
Пример #28
0
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
 */

#include <framebuffer.h>
#include <mailbox.h>
#include <memory.h>
#include <string.h>
#include <util.h>

#include "font.h"

/*
 * Framebuffer initialization data
 */
volatile struct __attribute__ ((aligned (16))) {
	uint32_t width;
	uint32_t height;
	uint32_t virt_width;
	uint32_t virt_height;
	uint32_t pitch;			/* filled by GPU */
	uint32_t bits_per_pixel;
	uint32_t x_offset;
	uint32_t y_offset;
	uint32_t fb_base_addr;		/* filled by GPU */
	uint32_t screen_size;		/* filled by GPU */
} fb_info;

/*
 * Query the VideoCore for the framebuffer
 */
Пример #29
0
//{{BLOCK(_0770)

//======================================================================
//
//	_0770, 40x40@8, 
//	+ palette 256 entries, not compressed
//	+ 25 tiles lz77 compressed
//	Total size: 512 + 1584 = 2096
//
//	Time-stamp: 2014-11-28, 05:19:40
//	Exported by Cearn's GBA Image Transmogrifier, v0.8.12
//	( http://www.coranac.com/projects/#grit )
//
//======================================================================

const unsigned int _0770Tiles[396] __attribute__((aligned(4))) __attribute__((visibility("hidden")))=
{
	0x00064010,0x17F1F500,0x260BB317,0xF1F100DB,0xBDCD7917,0x6900C9DB,0xBCD817F1,0x00C9C960,
	0x69A63A3F,0x71DB5825,0x173A3F00,0x6060689D,0x3F3A0071,0x605F2D79,0x3A40C960,0x5FAF0F00,
	0xF13A98EF,0xBC176500,0x289A775F,0x8A4F008D,0x462B9312,0x8A004F8A,0x46319391,0x00717146,
	0x6346D531,0x77776363,0x002BD520,0xC5C59307,0x12009363,0xE4EA9292,0x00780428,0x19B10453,
	0x6CA8894D,0xD31A9F00,0x6C41BE9F,0xA8A8006C,0x93639FA8,0x4B023191,0x637C078D,0x96071012,
	0x93932200,0xD24BD531,0x12070022,0x4B2B2B63,0x8120220A,0x4B0800FE,0x0945B7D2,0x124F5300,
	0x76224C31,0x78470041,0x5C31DBF9,0x73004782,0xDB8A1109,0x00A4DE7C,0x97434383,0x62D43994,
	0x97978100,0xD4AB9743,0x76E90097,0xB0B4B4E9,0x008081AB,0xEDE26207,0x51F281E9,0x8497EC00,

	0x5E2F97A4,0x97620083,0x7643D143,0xA4005696,0xA4AD8443,0x0083512F,0xADA4A4A4,0xBFB6D4D1,
	0xB0EDBF00,0xB6ABB62A,0x8E8E028E,0xABABABB6,0x08B00800,0xD4AB2AB0,0xDC951800,0xD4AB00B0,
	0x8E9BB0AB,0x2A009B36,0xED958EB6,0x00DCBF9B,0x95BF36B0,0xBFBF3695,0x36E29500,0x84DCB6B0,
	0xF1B00036,0x8217D43A,0x9A007758,0x9EA6F148,0x000CAFCD,0x39F1089A,0x0CAF659E,0x3A3AFA00,
	0x6BB9D439,0x743E00EF,0xB969D4EE,0x680060C6,0x6579EEEE,0x003E8265,0xD88C8C68,0x6DCD173F,
Пример #30
0
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec" } */

#include <altivec.h>
#include "altivec_check.h"

extern void abort (void);

typedef int v4si __attribute__ ((vector_size (16)));

#define MAGIC_NUMBER 12345

v4si my_vect;
int my_array[4] __attribute__ ((aligned (16)));

void initialize (int a)
{
  my_vect = (v4si) {0, a, 2, 3};
  vec_st (my_vect, 0, my_array);
}

int verify (void)
{
  if (my_array[1] != MAGIC_NUMBER)
    abort ();
}

int main (void)
{
  altivec_check ();   /* Exit if hardware doesn't support AltiVec.  */