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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [runtime/] [go-unsafe-pointer.c] - Blame information for rev 820

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

Line No. Rev Author Line
1 747 jeremybenn
/* go-unsafe-pointer.c -- unsafe.Pointer type descriptor for Go.
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
 
9
#include "go-string.h"
10
#include "go-type.h"
11
 
12
/* This file provides the type descriptor for the unsafe.Pointer type.
13
   The unsafe package is defined by the compiler itself, which means
14
   that there is no package to compile to define the type
15
   descriptor.  */
16
 
17
extern const struct __go_type_descriptor unsafe_Pointer
18
  asm ("__go_tdn_libgo_unsafe.unsafe.Pointer");
19
 
20
/* Used to determine the field alignment.  */
21
struct field_align
22
{
23
  char c;
24
  void *p;
25
};
26
 
27
/* The reflection string.  */
28
#define REFLECTION "unsafe.Pointer"
29
static const struct __go_string reflection_string =
30
{
31
  (const unsigned char *) REFLECTION,
32
  sizeof REFLECTION - 1
33
};
34
 
35
const struct __go_type_descriptor unsafe_Pointer =
36
{
37
  /* __code */
38
  GO_UNSAFE_POINTER,
39
  /* __align */
40
  __alignof (void *),
41
  /* __field_align */
42
  offsetof (struct field_align, p) - 1,
43
  /* __size */
44
  sizeof (void *),
45
  /* __hash */
46
  78501163U,
47
  /* __hashfn */
48
  __go_type_hash_identity,
49
  /* __equalfn */
50
  __go_type_equal_identity,
51
  /* __reflection */
52
  &reflection_string,
53
  /* __uncommon */
54
  NULL,
55
  /* __pointer_to_this */
56
  NULL
57
};
58
 
59
/* We also need the type descriptor for the pointer to unsafe.Pointer,
60
   since any package which refers to that type descriptor will expect
61
   it to be defined elsewhere.  */
62
 
63
extern const struct __go_ptr_type pointer_unsafe_Pointer
64
  asm ("__go_td_pN27_libgo_unsafe.unsafe.Pointer");
65
 
66
/* The reflection string.  */
67
#define PREFLECTION "*unsafe.Pointer"
68
static const struct __go_string preflection_string =
69
{
70
  (const unsigned char *) PREFLECTION,
71
  sizeof PREFLECTION - 1,
72
};
73
 
74
const struct __go_ptr_type pointer_unsafe_Pointer =
75
{
76
  /* __common */
77
  {
78
    /* __code */
79
    GO_PTR,
80
    /* __align */
81
    __alignof (void *),
82
    /* __field_align */
83
    offsetof (struct field_align, p) - 1,
84
    /* __size */
85
    sizeof (void *),
86
    /* __hash */
87
    1256018616U,
88
    /* __hashfn */
89
    __go_type_hash_identity,
90
    /* __equalfn */
91
    __go_type_equal_identity,
92
    /* __reflection */
93
    &preflection_string,
94
    /* __uncommon */
95
    NULL,
96
    /* __pointer_to_this */
97
    NULL
98
  },
99
  /* __element_type */
100
  &unsafe_Pointer
101
};

powered by: WebSVN 2.1.0

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