OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [runtime/] [go-construct-map.c] - Blame information for rev 861

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
/* go-construct-map.c -- construct a map from an initializer.
2
 
3
   Copyright 2009 The Go Authors. All rights reserved.
4
   Use of this source code is governed by a BSD-style
5
   license that can be found in the LICENSE file.  */
6
 
7
#include <stddef.h>
8
#include <stdint.h>
9
#include <stdlib.h>
10
 
11
#include "map.h"
12
 
13
struct __go_map *
14
__go_construct_map (const struct __go_map_descriptor *descriptor,
15
                    uintptr_t count, uintptr_t entry_size,
16
                    uintptr_t val_offset, uintptr_t val_size,
17
                    const void *ventries)
18
{
19
  struct __go_map *ret;
20
  const unsigned char *entries;
21
  uintptr_t i;
22
 
23
  ret = __go_new_map (descriptor, count);
24
 
25
  entries = (const unsigned char *) ventries;
26
  for (i = 0; i < count; ++i)
27
    {
28
      void *val = __go_map_index (ret, entries, 1);
29
      __builtin_memcpy (val, entries + val_offset, val_size);
30
      entries += entry_size;
31
    }
32
 
33
  return ret;
34
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.