blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
357
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
58
| license_type
stringclasses 2
values | repo_name
stringlengths 4
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
58
| visit_date
timestamp[ns]date 2015-07-14 21:31:45
2023-09-06 10:45:08
| revision_date
timestamp[ns]date 1970-01-01 00:00:00
2023-09-05 23:26:37
| committer_date
timestamp[ns]date 1970-01-01 00:00:00
2023-09-05 23:26:37
| github_id
int64 966
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 24
values | gha_event_created_at
timestamp[ns]date 2012-06-07 00:51:45
2023-09-14 21:58:52
⌀ | gha_created_at
timestamp[ns]date 2008-02-03 21:17:16
2023-08-24 19:49:39
⌀ | gha_language
stringclasses 180
values | src_encoding
stringclasses 35
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 6
10.4M
| extension
stringclasses 121
values | filename
stringlengths 1
148
| content
stringlengths 6
10.4M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
77b9be5e0521c241065f0438236e9bcda5bf25bf
|
afb7006e47e70c1deb2ddb205f06eaf67de3df72
|
/third_party/aom/av1/encoder/x86/pickrst_sse4.c
|
1d8e205386ff73ae54abd345d092a408fd3081e2
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] |
permissive
|
marco-c/gecko-dev-wordified
|
a66383f85db33911b6312dd094c36f88c55d2e2c
|
3509ec45ecc9e536d04a3f6a43a82ec09c08dff6
|
refs/heads/master
| 2023-08-10T16:37:56.660204 | 2023-08-01T00:39:54 | 2023-08-01T00:39:54 | 211,297,590 | 1 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 15,807 |
c
|
pickrst_sse4.c
|
/
*
*
Copyright
(
c
)
2018
Alliance
for
Open
Media
.
All
rights
reserved
*
*
This
source
code
is
subject
to
the
terms
of
the
BSD
2
Clause
License
and
*
the
Alliance
for
Open
Media
Patent
License
1
.
0
.
If
the
BSD
2
Clause
License
*
was
not
distributed
with
this
source
code
in
the
LICENSE
file
you
can
*
obtain
it
at
www
.
aomedia
.
org
/
license
/
software
.
If
the
Alliance
for
Open
*
Media
Patent
License
1
.
0
was
not
distributed
with
this
source
code
in
the
*
PATENTS
file
you
can
obtain
it
at
www
.
aomedia
.
org
/
license
/
patent
.
*
/
#
include
<
assert
.
h
>
#
include
<
emmintrin
.
h
>
#
include
"
aom_dsp
/
x86
/
synonyms
.
h
"
#
include
"
config
/
av1_rtcd
.
h
"
#
include
"
av1
/
common
/
restoration
.
h
"
#
include
"
av1
/
encoder
/
pickrst
.
h
"
static
INLINE
void
acc_stat_sse41
(
int32_t
*
dst
const
uint8_t
*
src
const
__m128i
*
shuffle
const
__m128i
*
kl
)
{
const
__m128i
s
=
_mm_shuffle_epi8
(
xx_loadu_128
(
src
)
*
shuffle
)
;
const
__m128i
d0
=
_mm_madd_epi16
(
*
kl
_mm_cvtepu8_epi16
(
s
)
)
;
const
__m128i
d1
=
_mm_madd_epi16
(
*
kl
_mm_cvtepu8_epi16
(
_mm_srli_si128
(
s
8
)
)
)
;
const
__m128i
dst0
=
xx_loadu_128
(
dst
)
;
const
__m128i
dst1
=
xx_loadu_128
(
dst
+
4
)
;
const
__m128i
r0
=
_mm_add_epi32
(
dst0
d0
)
;
const
__m128i
r1
=
_mm_add_epi32
(
dst1
d1
)
;
xx_storeu_128
(
dst
r0
)
;
xx_storeu_128
(
dst
+
4
r1
)
;
}
static
INLINE
void
acc_stat_win7_one_line_sse4_1
(
const
uint8_t
*
dgd
const
uint8_t
*
src
int
h_start
int
h_end
int
dgd_stride
const
__m128i
*
shuffle
int32_t
*
sumX
int32_t
sumY
[
WIENER_WIN
]
[
WIENER_WIN
]
int32_t
M_int
[
WIENER_WIN
]
[
WIENER_WIN
]
int32_t
H_int
[
WIENER_WIN2
]
[
WIENER_WIN
*
8
]
)
{
const
int
wiener_win
=
7
;
int
j
k
l
;
for
(
j
=
h_start
;
j
<
h_end
;
j
+
=
2
)
{
const
uint8_t
*
dgd_ij
=
dgd
+
j
;
const
uint8_t
X1
=
src
[
j
]
;
const
uint8_t
X2
=
src
[
j
+
1
]
;
*
sumX
+
=
X1
+
X2
;
for
(
k
=
0
;
k
<
wiener_win
;
k
+
+
)
{
const
uint8_t
*
dgd_ijk
=
dgd_ij
+
k
*
dgd_stride
;
for
(
l
=
0
;
l
<
wiener_win
;
l
+
+
)
{
int32_t
*
H_
=
&
H_int
[
(
l
*
wiener_win
+
k
)
]
[
0
]
;
const
uint8_t
D1
=
dgd_ijk
[
l
]
;
const
uint8_t
D2
=
dgd_ijk
[
l
+
1
]
;
sumY
[
k
]
[
l
]
+
=
D1
+
D2
;
M_int
[
k
]
[
l
]
+
=
D1
*
X1
+
D2
*
X2
;
const
__m128i
kl
=
_mm_cvtepu8_epi16
(
_mm_set1_epi16
(
*
(
(
uint16_t
*
)
(
dgd_ijk
+
l
)
)
)
)
;
acc_stat_sse41
(
H_
+
0
*
8
dgd_ij
+
0
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
1
*
8
dgd_ij
+
1
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
2
*
8
dgd_ij
+
2
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
3
*
8
dgd_ij
+
3
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
4
*
8
dgd_ij
+
4
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
5
*
8
dgd_ij
+
5
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
6
*
8
dgd_ij
+
6
*
dgd_stride
shuffle
&
kl
)
;
}
}
}
}
static
INLINE
void
compute_stats_win7_opt_sse4_1
(
const
uint8_t
*
dgd
const
uint8_t
*
src
int
h_start
int
h_end
int
v_start
int
v_end
int
dgd_stride
int
src_stride
double
*
M
double
*
H
)
{
int
i
j
k
l
m
n
;
const
int
wiener_win
=
WIENER_WIN
;
const
int
pixel_count
=
(
h_end
-
h_start
)
*
(
v_end
-
v_start
)
;
const
int
wiener_win2
=
wiener_win
*
wiener_win
;
const
int
wiener_halfwin
=
(
wiener_win
>
>
1
)
;
const
double
avg
=
find_average
(
dgd
h_start
h_end
v_start
v_end
dgd_stride
)
;
int32_t
M_int32
[
WIENER_WIN
]
[
WIENER_WIN
]
=
{
{
0
}
}
;
int64_t
M_int64
[
WIENER_WIN
]
[
WIENER_WIN
]
=
{
{
0
}
}
;
int32_t
H_int32
[
WIENER_WIN2
]
[
WIENER_WIN
*
8
]
=
{
{
0
}
}
;
int64_t
H_int64
[
WIENER_WIN2
]
[
WIENER_WIN
*
8
]
=
{
{
0
}
}
;
int32_t
sumY
[
WIENER_WIN
]
[
WIENER_WIN
]
=
{
{
0
}
}
;
int32_t
sumX
=
0
;
const
uint8_t
*
dgd_win
=
dgd
-
wiener_halfwin
*
dgd_stride
-
wiener_halfwin
;
const
__m128i
shuffle
=
xx_loadu_128
(
g_shuffle_stats_data
)
;
for
(
j
=
v_start
;
j
<
v_end
;
j
+
=
64
)
{
const
int
vert_end
=
AOMMIN
(
64
v_end
-
j
)
+
j
;
for
(
i
=
j
;
i
<
vert_end
;
i
+
+
)
{
acc_stat_win7_one_line_sse4_1
(
dgd_win
+
i
*
dgd_stride
src
+
i
*
src_stride
h_start
h_end
dgd_stride
&
shuffle
&
sumX
sumY
M_int32
H_int32
)
;
}
for
(
k
=
0
;
k
<
wiener_win
;
+
+
k
)
{
for
(
l
=
0
;
l
<
wiener_win
;
+
+
l
)
{
M_int64
[
k
]
[
l
]
+
=
M_int32
[
k
]
[
l
]
;
M_int32
[
k
]
[
l
]
=
0
;
}
}
for
(
k
=
0
;
k
<
WIENER_WIN2
;
+
+
k
)
{
for
(
l
=
0
;
l
<
WIENER_WIN
*
8
;
+
+
l
)
{
H_int64
[
k
]
[
l
]
+
=
H_int32
[
k
]
[
l
]
;
H_int32
[
k
]
[
l
]
=
0
;
}
}
}
const
double
avg_square_sum
=
avg
*
avg
*
pixel_count
;
for
(
k
=
0
;
k
<
wiener_win
;
k
+
+
)
{
for
(
l
=
0
;
l
<
wiener_win
;
l
+
+
)
{
const
int32_t
idx0
=
l
*
wiener_win
+
k
;
M
[
idx0
]
=
M_int64
[
k
]
[
l
]
+
avg_square_sum
-
avg
*
(
sumX
+
sumY
[
k
]
[
l
]
)
;
double
*
H_
=
H
+
idx0
*
wiener_win2
;
int64_t
*
H_int_
=
&
H_int64
[
idx0
]
[
0
]
;
for
(
m
=
0
;
m
<
wiener_win
;
m
+
+
)
{
for
(
n
=
0
;
n
<
wiener_win
;
n
+
+
)
{
H_
[
m
*
wiener_win
+
n
]
=
H_int_
[
n
*
8
+
m
]
+
avg_square_sum
-
avg
*
(
sumY
[
k
]
[
l
]
+
sumY
[
n
]
[
m
]
)
;
}
}
}
}
}
static
INLINE
void
acc_stat_win5_one_line_sse4_1
(
const
uint8_t
*
dgd
const
uint8_t
*
src
int
h_start
int
h_end
int
dgd_stride
const
__m128i
*
shuffle
int32_t
*
sumX
int32_t
sumY
[
WIENER_WIN_CHROMA
]
[
WIENER_WIN_CHROMA
]
int32_t
M_int
[
WIENER_WIN_CHROMA
]
[
WIENER_WIN_CHROMA
]
int32_t
H_int
[
WIENER_WIN2_CHROMA
]
[
WIENER_WIN_CHROMA
*
8
]
)
{
const
int
wiener_win
=
WIENER_WIN_CHROMA
;
int
j
k
l
;
for
(
j
=
h_start
;
j
<
h_end
;
j
+
=
2
)
{
const
uint8_t
*
dgd_ij
=
dgd
+
j
;
const
uint8_t
X1
=
src
[
j
]
;
const
uint8_t
X2
=
src
[
j
+
1
]
;
*
sumX
+
=
X1
+
X2
;
for
(
k
=
0
;
k
<
wiener_win
;
k
+
+
)
{
const
uint8_t
*
dgd_ijk
=
dgd_ij
+
k
*
dgd_stride
;
for
(
l
=
0
;
l
<
wiener_win
;
l
+
+
)
{
int32_t
*
H_
=
&
H_int
[
(
l
*
wiener_win
+
k
)
]
[
0
]
;
const
uint8_t
D1
=
dgd_ijk
[
l
]
;
const
uint8_t
D2
=
dgd_ijk
[
l
+
1
]
;
sumY
[
k
]
[
l
]
+
=
D1
+
D2
;
M_int
[
k
]
[
l
]
+
=
D1
*
X1
+
D2
*
X2
;
const
__m128i
kl
=
_mm_cvtepu8_epi16
(
_mm_set1_epi16
(
*
(
(
uint16_t
*
)
(
dgd_ijk
+
l
)
)
)
)
;
acc_stat_sse41
(
H_
+
0
*
8
dgd_ij
+
0
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
1
*
8
dgd_ij
+
1
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
2
*
8
dgd_ij
+
2
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
3
*
8
dgd_ij
+
3
*
dgd_stride
shuffle
&
kl
)
;
acc_stat_sse41
(
H_
+
4
*
8
dgd_ij
+
4
*
dgd_stride
shuffle
&
kl
)
;
}
}
}
}
static
INLINE
void
compute_stats_win5_opt_sse4_1
(
const
uint8_t
*
dgd
const
uint8_t
*
src
int
h_start
int
h_end
int
v_start
int
v_end
int
dgd_stride
int
src_stride
double
*
M
double
*
H
)
{
int
i
j
k
l
m
n
;
const
int
wiener_win
=
WIENER_WIN_CHROMA
;
const
int
pixel_count
=
(
h_end
-
h_start
)
*
(
v_end
-
v_start
)
;
const
int
wiener_win2
=
wiener_win
*
wiener_win
;
const
int
wiener_halfwin
=
(
wiener_win
>
>
1
)
;
const
double
avg
=
find_average
(
dgd
h_start
h_end
v_start
v_end
dgd_stride
)
;
int32_t
M_int32
[
WIENER_WIN_CHROMA
]
[
WIENER_WIN_CHROMA
]
=
{
{
0
}
}
;
int64_t
M_int64
[
WIENER_WIN_CHROMA
]
[
WIENER_WIN_CHROMA
]
=
{
{
0
}
}
;
int32_t
H_int32
[
WIENER_WIN2_CHROMA
]
[
WIENER_WIN_CHROMA
*
8
]
=
{
{
0
}
}
;
int64_t
H_int64
[
WIENER_WIN2_CHROMA
]
[
WIENER_WIN_CHROMA
*
8
]
=
{
{
0
}
}
;
int32_t
sumY
[
WIENER_WIN_CHROMA
]
[
WIENER_WIN_CHROMA
]
=
{
{
0
}
}
;
int32_t
sumX
=
0
;
const
uint8_t
*
dgd_win
=
dgd
-
wiener_halfwin
*
dgd_stride
-
wiener_halfwin
;
const
__m128i
shuffle
=
xx_loadu_128
(
g_shuffle_stats_data
)
;
for
(
j
=
v_start
;
j
<
v_end
;
j
+
=
64
)
{
const
int
vert_end
=
AOMMIN
(
64
v_end
-
j
)
+
j
;
for
(
i
=
j
;
i
<
vert_end
;
i
+
+
)
{
acc_stat_win5_one_line_sse4_1
(
dgd_win
+
i
*
dgd_stride
src
+
i
*
src_stride
h_start
h_end
dgd_stride
&
shuffle
&
sumX
sumY
M_int32
H_int32
)
;
}
for
(
k
=
0
;
k
<
wiener_win
;
+
+
k
)
{
for
(
l
=
0
;
l
<
wiener_win
;
+
+
l
)
{
M_int64
[
k
]
[
l
]
+
=
M_int32
[
k
]
[
l
]
;
M_int32
[
k
]
[
l
]
=
0
;
}
}
for
(
k
=
0
;
k
<
WIENER_WIN_CHROMA
*
WIENER_WIN_CHROMA
;
+
+
k
)
{
for
(
l
=
0
;
l
<
WIENER_WIN_CHROMA
*
8
;
+
+
l
)
{
H_int64
[
k
]
[
l
]
+
=
H_int32
[
k
]
[
l
]
;
H_int32
[
k
]
[
l
]
=
0
;
}
}
}
const
double
avg_square_sum
=
avg
*
avg
*
pixel_count
;
for
(
k
=
0
;
k
<
wiener_win
;
k
+
+
)
{
for
(
l
=
0
;
l
<
wiener_win
;
l
+
+
)
{
const
int32_t
idx0
=
l
*
wiener_win
+
k
;
M
[
idx0
]
=
M_int64
[
k
]
[
l
]
+
avg_square_sum
-
avg
*
(
sumX
+
sumY
[
k
]
[
l
]
)
;
double
*
H_
=
H
+
idx0
*
wiener_win2
;
int64_t
*
H_int_
=
&
H_int64
[
idx0
]
[
0
]
;
for
(
m
=
0
;
m
<
wiener_win
;
m
+
+
)
{
for
(
n
=
0
;
n
<
wiener_win
;
n
+
+
)
{
H_
[
m
*
wiener_win
+
n
]
=
H_int_
[
n
*
8
+
m
]
+
avg_square_sum
-
avg
*
(
sumY
[
k
]
[
l
]
+
sumY
[
n
]
[
m
]
)
;
}
}
}
}
}
void
av1_compute_stats_sse4_1
(
int
wiener_win
const
uint8_t
*
dgd
const
uint8_t
*
src
int
h_start
int
h_end
int
v_start
int
v_end
int
dgd_stride
int
src_stride
double
*
M
double
*
H
)
{
if
(
wiener_win
=
=
WIENER_WIN
)
{
compute_stats_win7_opt_sse4_1
(
dgd
src
h_start
h_end
v_start
v_end
dgd_stride
src_stride
M
H
)
;
}
else
if
(
wiener_win
=
=
WIENER_WIN_CHROMA
)
{
compute_stats_win5_opt_sse4_1
(
dgd
src
h_start
h_end
v_start
v_end
dgd_stride
src_stride
M
H
)
;
}
else
{
av1_compute_stats_c
(
wiener_win
dgd
src
h_start
h_end
v_start
v_end
dgd_stride
src_stride
M
H
)
;
}
}
static
INLINE
__m128i
pair_set_epi16
(
uint16_t
a
uint16_t
b
)
{
return
_mm_set1_epi32
(
(
int32_t
)
(
(
(
uint16_t
)
(
a
)
)
|
(
(
(
uint32_t
)
(
b
)
)
<
<
16
)
)
)
;
}
int64_t
av1_lowbd_pixel_proj_error_sse4_1
(
const
uint8_t
*
src8
int
width
int
height
int
src_stride
const
uint8_t
*
dat8
int
dat_stride
int32_t
*
flt0
int
flt0_stride
int32_t
*
flt1
int
flt1_stride
int
xq
[
2
]
const
sgr_params_type
*
params
)
{
int
i
j
k
;
const
int32_t
shift
=
SGRPROJ_RST_BITS
+
SGRPROJ_PRJ_BITS
;
const
__m128i
rounding
=
_mm_set1_epi32
(
1
<
<
(
shift
-
1
)
)
;
__m128i
sum64
=
_mm_setzero_si128
(
)
;
const
uint8_t
*
src
=
src8
;
const
uint8_t
*
dat
=
dat8
;
int64_t
err
=
0
;
if
(
params
-
>
r
[
0
]
>
0
&
&
params
-
>
r
[
1
]
>
0
)
{
__m128i
xq_coeff
=
pair_set_epi16
(
xq
[
0
]
xq
[
1
]
)
;
for
(
i
=
0
;
i
<
height
;
+
+
i
)
{
__m128i
sum32
=
_mm_setzero_si128
(
)
;
for
(
j
=
0
;
j
<
width
-
8
;
j
+
=
8
)
{
const
__m128i
d0
=
_mm_cvtepu8_epi16
(
xx_loadl_64
(
dat
+
j
)
)
;
const
__m128i
s0
=
_mm_cvtepu8_epi16
(
xx_loadl_64
(
src
+
j
)
)
;
const
__m128i
flt0_16b
=
_mm_packs_epi32
(
xx_loadu_128
(
flt0
+
j
)
xx_loadu_128
(
flt0
+
j
+
4
)
)
;
const
__m128i
flt1_16b
=
_mm_packs_epi32
(
xx_loadu_128
(
flt1
+
j
)
xx_loadu_128
(
flt1
+
j
+
4
)
)
;
const
__m128i
u0
=
_mm_slli_epi16
(
d0
SGRPROJ_RST_BITS
)
;
const
__m128i
flt0_0_sub_u
=
_mm_sub_epi16
(
flt0_16b
u0
)
;
const
__m128i
flt1_0_sub_u
=
_mm_sub_epi16
(
flt1_16b
u0
)
;
const
__m128i
v0
=
_mm_madd_epi16
(
xq_coeff
_mm_unpacklo_epi16
(
flt0_0_sub_u
flt1_0_sub_u
)
)
;
const
__m128i
v1
=
_mm_madd_epi16
(
xq_coeff
_mm_unpackhi_epi16
(
flt0_0_sub_u
flt1_0_sub_u
)
)
;
const
__m128i
vr0
=
_mm_srai_epi32
(
_mm_add_epi32
(
v0
rounding
)
shift
)
;
const
__m128i
vr1
=
_mm_srai_epi32
(
_mm_add_epi32
(
v1
rounding
)
shift
)
;
const
__m128i
e0
=
_mm_sub_epi16
(
_mm_add_epi16
(
_mm_packs_epi32
(
vr0
vr1
)
d0
)
s0
)
;
const
__m128i
err0
=
_mm_madd_epi16
(
e0
e0
)
;
sum32
=
_mm_add_epi32
(
sum32
err0
)
;
}
for
(
k
=
j
;
k
<
width
;
+
+
k
)
{
const
int32_t
u
=
(
int32_t
)
(
dat
[
k
]
<
<
SGRPROJ_RST_BITS
)
;
int32_t
v
=
xq
[
0
]
*
(
flt0
[
k
]
-
u
)
+
xq
[
1
]
*
(
flt1
[
k
]
-
u
)
;
const
int32_t
e
=
ROUND_POWER_OF_TWO
(
v
shift
)
+
dat
[
k
]
-
src
[
k
]
;
err
+
=
e
*
e
;
}
dat
+
=
dat_stride
;
src
+
=
src_stride
;
flt0
+
=
flt0_stride
;
flt1
+
=
flt1_stride
;
const
__m128i
sum64_0
=
_mm_cvtepi32_epi64
(
sum32
)
;
const
__m128i
sum64_1
=
_mm_cvtepi32_epi64
(
_mm_srli_si128
(
sum32
8
)
)
;
sum64
=
_mm_add_epi64
(
sum64
sum64_0
)
;
sum64
=
_mm_add_epi64
(
sum64
sum64_1
)
;
}
}
else
if
(
params
-
>
r
[
0
]
>
0
)
{
__m128i
xq_coeff
=
pair_set_epi16
(
xq
[
0
]
-
(
xq
[
0
]
<
<
SGRPROJ_RST_BITS
)
)
;
for
(
i
=
0
;
i
<
height
;
+
+
i
)
{
__m128i
sum32
=
_mm_setzero_si128
(
)
;
for
(
j
=
0
;
j
<
width
-
8
;
j
+
=
8
)
{
const
__m128i
d0
=
_mm_cvtepu8_epi16
(
xx_loadl_64
(
dat
+
j
)
)
;
const
__m128i
s0
=
_mm_cvtepu8_epi16
(
xx_loadl_64
(
src
+
j
)
)
;
const
__m128i
flt0_16b
=
_mm_packs_epi32
(
xx_loadu_128
(
flt0
+
j
)
xx_loadu_128
(
flt0
+
j
+
4
)
)
;
const
__m128i
v0
=
_mm_madd_epi16
(
xq_coeff
_mm_unpacklo_epi16
(
flt0_16b
d0
)
)
;
const
__m128i
v1
=
_mm_madd_epi16
(
xq_coeff
_mm_unpackhi_epi16
(
flt0_16b
d0
)
)
;
const
__m128i
vr0
=
_mm_srai_epi32
(
_mm_add_epi32
(
v0
rounding
)
shift
)
;
const
__m128i
vr1
=
_mm_srai_epi32
(
_mm_add_epi32
(
v1
rounding
)
shift
)
;
const
__m128i
e0
=
_mm_sub_epi16
(
_mm_add_epi16
(
_mm_packs_epi32
(
vr0
vr1
)
d0
)
s0
)
;
const
__m128i
err0
=
_mm_madd_epi16
(
e0
e0
)
;
sum32
=
_mm_add_epi32
(
sum32
err0
)
;
}
for
(
k
=
j
;
k
<
width
;
+
+
k
)
{
const
int32_t
u
=
(
int32_t
)
(
dat
[
k
]
<
<
SGRPROJ_RST_BITS
)
;
int32_t
v
=
xq
[
0
]
*
(
flt0
[
k
]
-
u
)
;
const
int32_t
e
=
ROUND_POWER_OF_TWO
(
v
shift
)
+
dat
[
k
]
-
src
[
k
]
;
err
+
=
e
*
e
;
}
dat
+
=
dat_stride
;
src
+
=
src_stride
;
flt0
+
=
flt0_stride
;
const
__m128i
sum64_0
=
_mm_cvtepi32_epi64
(
sum32
)
;
const
__m128i
sum64_1
=
_mm_cvtepi32_epi64
(
_mm_srli_si128
(
sum32
8
)
)
;
sum64
=
_mm_add_epi64
(
sum64
sum64_0
)
;
sum64
=
_mm_add_epi64
(
sum64
sum64_1
)
;
}
}
else
if
(
params
-
>
r
[
1
]
>
0
)
{
__m128i
xq_coeff
=
pair_set_epi16
(
xq
[
1
]
-
(
xq
[
1
]
<
<
SGRPROJ_RST_BITS
)
)
;
for
(
i
=
0
;
i
<
height
;
+
+
i
)
{
__m128i
sum32
=
_mm_setzero_si128
(
)
;
for
(
j
=
0
;
j
<
width
-
8
;
j
+
=
8
)
{
const
__m128i
d0
=
_mm_cvtepu8_epi16
(
xx_loadl_64
(
dat
+
j
)
)
;
const
__m128i
s0
=
_mm_cvtepu8_epi16
(
xx_loadl_64
(
src
+
j
)
)
;
const
__m128i
flt1_16b
=
_mm_packs_epi32
(
xx_loadu_128
(
flt1
+
j
)
xx_loadu_128
(
flt1
+
j
+
4
)
)
;
const
__m128i
v0
=
_mm_madd_epi16
(
xq_coeff
_mm_unpacklo_epi16
(
flt1_16b
d0
)
)
;
const
__m128i
v1
=
_mm_madd_epi16
(
xq_coeff
_mm_unpackhi_epi16
(
flt1_16b
d0
)
)
;
const
__m128i
vr0
=
_mm_srai_epi32
(
_mm_add_epi32
(
v0
rounding
)
shift
)
;
const
__m128i
vr1
=
_mm_srai_epi32
(
_mm_add_epi32
(
v1
rounding
)
shift
)
;
const
__m128i
e0
=
_mm_sub_epi16
(
_mm_add_epi16
(
_mm_packs_epi32
(
vr0
vr1
)
d0
)
s0
)
;
const
__m128i
err0
=
_mm_madd_epi16
(
e0
e0
)
;
sum32
=
_mm_add_epi32
(
sum32
err0
)
;
}
for
(
k
=
j
;
k
<
width
;
+
+
k
)
{
const
int32_t
u
=
(
int32_t
)
(
dat
[
k
]
<
<
SGRPROJ_RST_BITS
)
;
int32_t
v
=
xq
[
1
]
*
(
flt1
[
k
]
-
u
)
;
const
int32_t
e
=
ROUND_POWER_OF_TWO
(
v
shift
)
+
dat
[
k
]
-
src
[
k
]
;
err
+
=
e
*
e
;
}
dat
+
=
dat_stride
;
src
+
=
src_stride
;
flt1
+
=
flt1_stride
;
const
__m128i
sum64_0
=
_mm_cvtepi32_epi64
(
sum32
)
;
const
__m128i
sum64_1
=
_mm_cvtepi32_epi64
(
_mm_srli_si128
(
sum32
8
)
)
;
sum64
=
_mm_add_epi64
(
sum64
sum64_0
)
;
sum64
=
_mm_add_epi64
(
sum64
sum64_1
)
;
}
}
else
{
__m128i
sum32
=
_mm_setzero_si128
(
)
;
for
(
i
=
0
;
i
<
height
;
+
+
i
)
{
for
(
j
=
0
;
j
<
width
-
16
;
j
+
=
16
)
{
const
__m128i
d
=
xx_loadu_128
(
dat
+
j
)
;
const
__m128i
s
=
xx_loadu_128
(
src
+
j
)
;
const
__m128i
d0
=
_mm_cvtepu8_epi16
(
d
)
;
const
__m128i
d1
=
_mm_cvtepu8_epi16
(
_mm_srli_si128
(
d
8
)
)
;
const
__m128i
s0
=
_mm_cvtepu8_epi16
(
s
)
;
const
__m128i
s1
=
_mm_cvtepu8_epi16
(
_mm_srli_si128
(
s
8
)
)
;
const
__m128i
diff0
=
_mm_sub_epi16
(
d0
s0
)
;
const
__m128i
diff1
=
_mm_sub_epi16
(
d1
s1
)
;
const
__m128i
err0
=
_mm_madd_epi16
(
diff0
diff0
)
;
const
__m128i
err1
=
_mm_madd_epi16
(
diff1
diff1
)
;
sum32
=
_mm_add_epi32
(
sum32
err0
)
;
sum32
=
_mm_add_epi32
(
sum32
err1
)
;
}
for
(
k
=
j
;
k
<
width
;
+
+
k
)
{
const
int32_t
e
=
(
int32_t
)
(
dat
[
k
]
)
-
src
[
k
]
;
err
+
=
e
*
e
;
}
dat
+
=
dat_stride
;
src
+
=
src_stride
;
}
const
__m128i
sum64_0
=
_mm_cvtepi32_epi64
(
sum32
)
;
const
__m128i
sum64_1
=
_mm_cvtepi32_epi64
(
_mm_srli_si128
(
sum32
8
)
)
;
sum64
=
_mm_add_epi64
(
sum64_0
sum64_1
)
;
}
int64_t
sum
[
2
]
;
xx_storeu_128
(
sum
sum64
)
;
err
+
=
sum
[
0
]
+
sum
[
1
]
;
return
err
;
}
|
0e303192b861097c10839202b20e58105a12e44d
|
5ecd4143cf4b4724271fd4b9d71e3cc15b066671
|
/main.c
|
54bc75d5ee00128d83ec93ca36df8e848388e900
|
[] |
no_license
|
KiRist-code/PascalTriangle
|
43063b51150ee1185bda518437d6486abb969492
|
9708ad72e4dc25b25ffa71fb5e5db01525ecb7c0
|
refs/heads/main
| 2023-05-12T01:06:06.271195 | 2021-05-29T15:13:05 | 2021-05-29T15:13:05 | 372,004,046 | 2 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 902 |
c
|
main.c
|
#include <stdio.h>
#include <stdlib.h>
void printPaskal(int level);
int main(int argc, const char * argv[]) {
int inputLevel = 0;
printf("how many of level? : ");
scanf("%d", &inputLevel);
printPaskal(inputLevel);
return 0;
}
void printPaskal(int level){
int **index;
index = malloc(level*sizeof(int));
for(int i=0;i<level;i++){
index[i] = malloc((i+1)*sizeof(int));
for(int j=0;j<i+1;j++){
if(j==0 || j==i) {
index[i][j] = 1;
printf(" %d",index[i][j]);
}
else {
index[i][j] = index[i-1][j-1] + index[i-1][j];
printf(" %d",index[i][j]);
}
}
printf("\n");
}
printf("The last col is... ");
for(int i=0;i<level;i++){
printf("%d ",index[level-1][i]);
}
printf("\n");
}
|
ce9f55ae30b4cd146e9d0d9f24e3ab6ba25365da
|
8e1691fa76f47c62bbf6b8d83f5d5f13647aacaf
|
/SPIFrame/synergy/ssp/src/framework/sf_el_ux/ux_hcd_synergy_buffer_read.c
|
fa2d5659f22ea94d140d5a422f7454dd743b5f9b
|
[] |
no_license
|
dongdong-2009/Renesas_S7G2
|
4c9933a2ef29d1057c4f1493aaed0906b6612501
|
86379eb843825975a3c2f8b01efe91b93f6167ec
|
refs/heads/master
| 2021-07-04T19:02:16.126614 | 2017-09-25T01:15:45 | 2017-09-25T01:15:45 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 10,263 |
c
|
ux_hcd_synergy_buffer_read.c
|
#ifdef AMS_ENCRYPT_PACKAGE
-----BEGIN ENCRYPTED FILE v0.6-----
9S04Fc0roaJnwZGP6OG7EDBImvEWKQdoMQNOXjk4Zvzx9KJz15dhDWXbFxwtj3cm
3oCHwqJRRhBS/vYIEa2vzbP579lfNCrR1am1nuP5kimTTQgX7V2K5o/sjiCv2ctV
xqdsHnnEZJxhl+82H0gzWGcsu2gyOFTg6V/jLbo3BPKAYQjX6z7q1qIFezQHV85L
XwJq6/m5EGFYVFSYFEvVVcmt12jPJtaJ/Diwx8Ef/zKHYpmcbD0fLjS+5RvicvE6
nSnj4vj9Rs3FAQ98hrP2jTgreqvvVFaorPsiiL1wIuwjEg+bEXkKNgrcwbhNYl0L
jzdYp6ftDZcc+Spj+xEYyfi0qbXLx1T8iAikSXASEHbUa5BTZ6SvQdzCEUs9HeVr
nh9toE/m6MBbDJLEjQChfr3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IsqH0k8pRS6bQR85V5UBBh6MMp8fNMn4bN57Za2Zw5GILn5MqzfpxNtbXmCCT9
BJLxq/eeuR3ZOMkeyHz5+uh8ZBw6zcrpl6oGoQbc54wyagYfk+rhi6ycClQrc5bQ
gevvsj0P+mawNq38zUyTlU1lG7m3kjDgwd1376hkPx2WNXAlyetaYQFC+lTnkECx
Uubr1GU8gILtL8Z8pwBrcQicxmkCOTQ7/YDSPPDlSg1JLKcZV0FCXqi9IVo3+oQ5
uz/G6WSPpX0R9chtHfqPz59LGC6fV1t6aZ+IahoVGDkMDpHEoX8tmL3u2R4K2hXl
nQN16BnC/4d74SJK0F98ps2qWEmYLMuAQcNH28PUx+eeEwMVJ+GRgtvskWDi6oHH
57QRq/F0+YycOqabZDydHvK31XK7NZxD4uXkgwDvVoFvFyw57xiwU7OJP7wE4GcB
1tRM/9hdinWx+R1ZnoCUP+NrbTNPvOSs0F+HOVuEmXzE5kSnMdppthJrLIzeJhYS
hhBh7emyeeJ7IBlc4xMHNjQXmmzpvyomdfdajDzvdulNosvPzXXH1X2V7xNjlocJ
y6ZVpyAvbNfz0BUeqIjzBaqh3d6GsqbxyJm5GTTM1yw187rDtQZ3tpe0zU4lFyRV
UFw99pZSOp7r1cdsx4EcmNlCDfVHboaNRVQ20tCtooMpy/8nCpPu9/nIwm+mcTJu
fs+oBRK5ts/Eo37uEWNCYCkF88GmL/H1OGq70HeS9JtDhsOQtXrXe3otCk6HFy1o
HtAVEFlrL950aBADLlGLe6G9dsr/9r80Xxj27vSbf4NCNm7E7TORoAp/IxDYbzie
a7Q0GIJOmmWArHHZ/sx/u+SAVkVZC7GYQcdIUIyATUjlirCGD14MI5abnw0NWixw
-----END ENCRYPTED FILE-----
#else
#error "Secure builder required to compile this file"
#endif
|
d7e590f8c830e457cfe39da969b6a6cb53d44e42
|
b78a65577c98bd67bf12353057e92bd437dcac0d
|
/src/test.c
|
1715584c4a4608dc7e6a5f8b1722389eed25ad4a
|
[] |
no_license
|
Zhandos614/Testing-Java
|
ef51d1da3a26f2d8b85666ebfc45e37b059a9629
|
abcf9b0794ffd0f70c73ff0f9cc1c885713cbc65
|
refs/heads/master
| 2022-11-04T20:47:17.337425 | 2020-06-15T13:58:23 | 2020-06-15T13:58:23 | 272,452,910 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 4,141 |
c
|
test.c
|
/*
* test.c
*
* Created on: Apr 23, 2020
* Author: zamek
*/
#include <stdlib.h>
#include <stdio.h>
#include <CUnit/Basic.h>
#include <pthread.h>
#include <syslog.h>
#include <macros.h>
#include <repository.h>
#define FILE_NAME "repository.ser"
#define NO_THREAD
#define TEST_COUNTS 10
#define TOYOTA "Toyota Yaris Hybrid"
#define VW "Volkswagen Golf"
#define FP "Fountaine Pajot"
pthread_t enqueuer;
pthread_t dequeuer;
int before_test() {
remove(FILE_NAME);
return 0;
}
int after_test() {
return 0;
}
void open_test() {
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_close(FILE_NAME));
CU_ASSERT_EQUAL(0, rep_count_type(CAR));
CU_ASSERT_PTR_NULL(rep_dequeue(CAR, TOYOTA, 1));
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_enqueue(SHIP, FP, 1, 450000));
CU_ASSERT_PTR_NULL(rep_find_unit(SHIP, FP));
CU_ASSERT_EQUAL(0, rep_sum_price());
CU_ASSERT_TRUE(rep_is_empty());
CU_ASSERT_EQUAL(EXIT_SUCCESS, rep_open(FILE_NAME));
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_open(NULL));
}
void close_test() {
CU_ASSERT_EQUAL(EXIT_SUCCESS, rep_close(FILE_NAME));
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_close(FILE_NAME));
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_close(NULL));
CU_ASSERT_EQUAL(0, rep_count_type(CAR));
CU_ASSERT_PTR_NULL(rep_dequeue(CAR, TOYOTA, 1));
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_enqueue(SHIP, FP, 1, 450000));
CU_ASSERT_PTR_NULL(rep_find_unit(SHIP, FP));
CU_ASSERT_EQUAL(0, rep_sum_price());
CU_ASSERT_TRUE(rep_is_empty());
}
void *enqueue(void *p) {
char buffer[25];
CU_ASSERT_TRUE(rep_is_empty());
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_enqueue(CAR, NULL, 1, 1000));
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_enqueue(-1, NULL, 1, 1000));
CU_ASSERT_EQUAL(EXIT_FAILURE, rep_enqueue(UNKNOWN, NULL, 1, 1000));
int sum=0;
for (int i=0;i<TEST_COUNTS;++i) {
sprintf(buffer, "%s%d", TOYOTA, i);
CU_ASSERT_EQUAL(EXIT_SUCCESS, rep_enqueue(CAR, buffer, i+1, 1000));
sum += i+1;
}
CU_ASSERT_EQUAL(sum, rep_count_type(CAR));
CU_ASSERT_FALSE(rep_is_empty());
for (int i=ENGINE;i<UNKNOWN;++i)
CU_ASSERT_EQUAL(0, rep_count_type(i));
sprintf(buffer, "%s%d", TOYOTA, 1);
CU_ASSERT_PTR_NOT_NULL(rep_find_unit(CAR, buffer));
CU_ASSERT_PTR_NULL(rep_find_unit(UNKNOWN, buffer));
CU_ASSERT_PTR_NULL(rep_find_unit(CAR, NULL));
CU_ASSERT_PTR_NULL(rep_find_unit(CAR, ""));
CU_ASSERT_PTR_NULL(rep_dequeue(UNKNOWN, buffer, 0));
CU_ASSERT_PTR_NULL(rep_dequeue(UNKNOWN, NULL, 0));
return NULL;
}
void *dequeue(void *p) {
char buffer[25];
CU_ASSERT_FALSE(rep_is_empty());
for (int i=0;i<TEST_COUNTS;++i) {
sprintf(buffer, "%s%d", TOYOTA, i);
struct unit_t *u=rep_dequeue(CAR, buffer, i+1);
CU_ASSERT_PTR_NOT_NULL(u);
CU_ASSERT_EQUAL(u->unit_price, 1000);
CU_ASSERT_STRING_EQUAL(buffer, u->name);
}
return NULL;
}
void test() {
#ifdef NO_THREAD
syslog(LOG_WARNING, "NO THREAD TEST");
enqueue(NULL);
dequeue(NULL);
#else
syslog(LOG_WARNING, "THREAD TEST");
pthread_create(&enqueuer, NULL, enqueue, NULL);
pthread_create(&dequeuer, NULL, dequeue, NULL);
pthread_join(enqueuer, NULL);
pthread_join(dequeuer, NULL);
#endif
}
void reopen_test() {
remove(FILE_NAME);
CU_ASSERT_EQUAL(EXIT_SUCCESS, rep_open(FILE_NAME));
CU_ASSERT_TRUE(rep_is_empty());
enqueue(NULL);
CU_ASSERT_EQUAL(EXIT_SUCCESS, rep_close(FILE_NAME));
CU_ASSERT_EQUAL(EXIT_SUCCESS, rep_open(FILE_NAME));
CU_ASSERT_FALSE(rep_is_empty());
dequeue(NULL);
CU_ASSERT_EQUAL(EXIT_SUCCESS, rep_close(FILE_NAME));
}
int main() {
openlog("REPOSITRY TEST", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
setlogmask (LOG_UPTO (LOG_DEBUG));
CU_pSuite suite =NULL;
if (CUE_SUCCESS!=CU_initialize_registry())
goto exit;
suite = CU_add_suite("Suite 1", before_test, after_test);
if (NULL==suite) {
CU_cleanup_registry();
goto exit;
}
if ( (NULL==CU_add_test(suite, "Open test", open_test)) ||
(NULL==CU_add_test(suite, "test", test)) ||
(NULL==CU_add_test(suite, "Close test", close_test)) ||
(NULL==CU_add_test(suite, "Reopen test", reopen_test)) ) {
CU_cleanup_registry();
goto exit;
}
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
CU_cleanup_registry();
exit:
closelog();
return CU_get_error();
}
|
a8202835b9013df40b5d44dd4871d1c0df9afc5e
|
64b6cf9b72190897ff9b35c5374d92cc4ee76cbd
|
/push_swap_src/get_value_in_stack.c
|
c7ef40b9e8fcb48ce16112b0962e860e720abd51
|
[] |
no_license
|
tapark/push_swap
|
2d8bbfd821d15eb70b017887f65df1287345f7a1
|
c2d03230a79a13571d0909d3c8b77474bd0b684b
|
refs/heads/master
| 2023-05-11T20:09:11.993155 | 2021-06-03T09:02:03 | 2021-06-03T09:02:03 | 359,795,139 | 0 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 2,042 |
c
|
get_value_in_stack.c
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_value_in_stack.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tapark <tapark@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/04/30 15:39:46 by tapark #+# #+# */
/* Updated: 2021/05/18 12:57:53 by tapark ### ########.fr */
/* */
/* ************************************************************************** */
#include "../push_swap.h"
int *get_stack_array(t_stack **head, int num)
{
int i;
int *sort;
t_stack *count;
if (!(sort = (int *)malloc(sizeof(int) * num)))
return (NULL);
i = 0;
count = (*head);
while (i < num)
{
sort[i] = count->n;
count = count->next;
i++;
}
return (sort);
}
int get_mid_value(t_stack **head, int len)
{
int *sort;
int mid_value;
sort = get_stack_array(head, len);
quick_sort(sort, 0, len - 1);
mid_value = sort[len / 2];
free(sort);
return (mid_value);
}
int get_min_value(t_stack **head, int len)
{
int *sort;
int min_value;
sort = get_stack_array(head, len);
quick_sort(sort, 0, len - 1);
min_value = sort[0];
free(sort);
return (min_value);
}
int get_max_value(t_stack **head, int len)
{
int *sort;
int max_value;
sort = get_stack_array(head, len);
quick_sort(sort, 0, len - 1);
max_value = sort[len - 1];
free(sort);
return (max_value);
}
int get_value_index(t_stack **head, int value)
{
int index;
t_stack *count;
index = 1;
count = (*head);
while (count != NULL)
{
if (count->n == value)
return (index);
count = count->next;
index++;
}
return (0);
}
|
1022af26d3c87a9858e84884376cbe86f1e1b2a1
|
e7408bf38690f0b4488616fc6033b4c0bdd019c8
|
/main.c
|
d6424140a8eb3fd245859577f41e4fcca9cc0a06
|
[] |
no_license
|
lucasspinelli/cadastro-pessoas-covid
|
f19632e6b9d55853d21a7bcc190385f1896779ed
|
a995c0f9b9d4bf8fbedef223833cacb8603751c1
|
refs/heads/main
| 2023-01-23T07:43:30.567946 | 2020-11-17T17:54:56 | 2020-11-17T17:54:56 | 307,161,172 | 0 | 0 | null | null | null | null |
ISO-8859-1
|
C
| false | false | 10,826 |
c
|
main.c
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h> //Biblioteca para usar a funçao strcmp
#include<windows.h>
#include<conio.h> //biblioteca para fazer o Beep
#include <locale.h> // Biblioteca para salvar arquivos
int main(void){
/*VARIAVEIS*/
FILE *risco; //Var para arquivos Grupo de risco
FILE *pacientesDB; // Var para arquivos DB
int opcao,opcao1,opcao2, opcaom,i,qtd; // Variáveis de controle
struct paciente // Lista Paciente
{
char nome[100],cpf[30],telefone[15],rua[50],
nrua[4],bairro[50],cidade[50],estado[50],cep[20],email[30], data[15];
} // Fim lista Paciente
//Inicio MAtriz
CA[600];
CA[600];
CA[600];
CA[600];
CA[600];
CA[600];
CA[600];
CA[600];
CA[600];
//Fim matriz
//Váriáveis Globais
char usuario [100]; //Variável que guarda o nome do usuário
setlocale(LC_ALL,"");
system("cls");
char c;
char login[20];
char senha[20];
int a=10;
int p=0;
int verifica_senha=0;
//Fim variáveis globais
// Começo Login
while(verifica_senha==0){
printf("\n\t\tCADASTRO DE PACIENTE\n\n login: ");
//fflush(stdin); //Limpando o buffer do teclado
gets(usuario);
printf("\n senha: ");
while((c=getch())!=13){ //13 é o valor de ENTER na tabela ASCII
senha[p]=c;
p++;
printf("*"); //imprime o * Anterisco
}
senha[p]='\0';
p=0;
system("cls");
a= strcmp(senha,"chico"); //
if(a==0){
printf("SENHA CORRETA");
system("color 0a");
verifica_senha=1;
Beep(1200,200);
}
else {
printf("SENHA INCORRETA\n");
system("color 0c");Beep(1500,2000);
}
printf("\n");
}
system("pause");
system("color 0F");
//read_option();
//Fim Login
while(opcao2 != 1)
{
system("color f9"); //mundando fundo e cor do sistema
system("cls");
//começo menu
printf("---------------------------------------\n");
printf("\t Olá, Bem vindo(a) ao sistema de Cadastro, %s\n",usuario);
printf("---------------------------------------\n");
printf(" 1- Cadastrar pacientes\n ");
printf("2- Pacientes Cadastrados nessa sessão\n ");
printf("3- Desenvolvedores\n ");
printf("4- SAIR\n ");
printf("---------------------------------------\n\n");
printf("\nEscolha uma opção: ");
scanf("%d",&opcao);
switch(opcao)
//fim menu
{
case 1:
system("cls");
printf("\n\n Quantos cadastros deseja fazer : "); // Controle de buffer
scanf("%d",&qtd);
for (i=1;i<=qtd;i++) //laço de repetição do controle
{
int ano, idade;
char morbidade;
int anoatual = 2020;
risco = fopen("pacientes-risco.txt","a"); //Arquivo Paciente de Riisco
pacientesDB = fopen("pacientes-db.txt", "a"); // Arquivo Paciente Geral
system("cls");
printf("\n\n\t\t\t INICIANDO CADASTRO %d\n",i);
printf("\t\t\t ----------------\n\n");
//Começo Validação idade
printf("\nDigite o ano de nascimento do paciente: ");
scanf("%d",&ano);
idade = anoatual - ano;
printf("O paciente tem %d anos \n",idade);
//Fim Validação de Idade
//Cpmeço Cadastro
printf("\n Nome do paciente: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].nome);
printf("\n CPF do paciente: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].cpf);
printf("\n Tel: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].telefone);
printf("\n Email: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].email);
printf("\n CEP: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].cep);
printf("\n Rua: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].rua);
printf("\n Número da Casa: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].nrua);
printf("\n Bairro: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].bairro);
printf("\n cidade: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].cidade);
printf("\n estado: ");
fflush(stdin);
scanf("%[^\n]s",CA[i].estado);
printf("\n Data do Diagnóstico (dd/mm/aaaa): ");
fflush(stdin);
scanf("%[^\n]s",CA[i].data);
//Fim cadastro
printf("\n O paciente tem alguma comorbidade?\n 1 - SIM \n 2 - NÃO \n");
scanf("%d",&opcaom);
if (opcaom == 1){
printf("\n Qual sua comorbidade? ");
scanf("%s",&morbidade);
}
if(idade >= 65 || opcaom == 1 ){ // Começo Salvando Dados Grupo de risco
printf("O paciente FAZ parte do grupo de risco.\n");
while(!feof(stdin) && i<=qtd){
fprintf(risco, "\n NOME DO PACIENTE: %s\n CPF: %s\n TELEFONE: %s\n CEP: %s\n IDADE: %d\n", CA[i].nome, CA[i].cpf,CA[i].telefone,CA[i].cep, idade );
fprintf(pacientesDB, "\n NOME DO PACIENTE: %s\n CPF: %s\n TELEFONE: %s\n CEP: \n EMAIL: %s\n DATA DO DIAGNOSTICO: %s\n IDADE: %d\n ", CA[i].nome, CA[i].cpf,CA[i].telefone,CA[i].cep, CA[i].email,CA[i].data, idade ); // Colocamos no arquivo normal também
printf("PRESSIONE CTRL+Z PARA ENCERRAR ");
scanf("%s%s%s",CA[i].estado,CA[i].cidade,&CA[i].bairro);
}
fclose(pacientesDB);
fclose(risco);
printf("\n\n");
system("pause");
system("cls");
}
//Fim salvando dados Grupo de risco
//Começo salvando dados gerais
else {
printf("O paciente NÃO FAZ parte do grupo de risco.\n");
while(!feof(stdin) && i<=qtd){
fprintf(pacientesDB, "\n NOME DO PACIENTE: %s\n CPF: %s\n TELEFONE: %s\n CEP: \n EMAIL: %s\n DATA DO DIAGNOSTICO: %s\n IDADE: %d\n ", CA[i].nome, CA[i].cpf,CA[i].telefone,CA[i].cep, CA[i].email,CA[i].data, idade );
printf("PRESSIONE CTRL+Z PARA ENCERRAR ");
scanf("%s%s%s",CA[i].estado,CA[i].cidade,&CA[i].bairro);
}
fclose(pacientesDB);
system("pause");
system("cls");
}
//fim dados ferais
}
break;
case 2:
system("cls");
for (i=1;i<=qtd;i++)
{
system("cls");
printf("\n\n\t\t EXIBINDO CADASTRO DO PACIENTE\n\n");
printf("\n\n\t\t para ver o próximo cadastro, tecle ENTER\n\n");
printf("\n NOME DO PACIENTE: %s\n",CA[i].nome);
printf("\n CPF DO PACIENTE: %s\n",CA[i].cpf);
printf("\n TELEFONE DO PACIÊNTE: %s\n",CA[i].telefone);
printf("\n EMAIL DO PACIÊNTE: %s\n",CA[i].email);
printf("\n CEP: %s\n",CA[i].cep);
printf("\n NOME DA RUA: %s\n",CA[i].rua);
printf("\n NÚMERO: %s\n",CA[i].nrua);
printf("\n BAIRRO: %s\n",CA[i].bairro);
printf("\n CIDADE: %s\n",CA[i].cidade);
printf("\n ESTADO: %s\n",CA[i].estado);
printf("\n DATA DO DIAGNOSTICO: %s\n",CA[i].data);
system("pause"); // Não deixamos exibir todos os dados para o programa não bugar
}
break;
case 3: // Informações das pessoas do trabalho
system("cls");
printf("Desenvolvedores: \n\n");
printf("Lucas Spinelli Levi \n");
system("pause");
break;
case 4:
system("cls");
printf("\n DESEJA SAIR? %s\n",usuario); //validação de segurança, caso tenha clicado em 4 sem querer
printf(" 1-SIM\n 2-NÃO");
printf("\n\n");
scanf("%d",&opcao2);
switch(opcao2)
{
case 1:
system("cls");
printf("\n\n Até breve %s\n",usuario);
system("pause");
return(0);
break;
}
}
}
return 0;
}
|
48eb4665331bf001d249b4a53ddca279370d86bf
|
0444209d614ed63bb6d2cae19b5b69b0dd6b4dd2
|
/src/hacklib.c
|
ad2bdc7dfdbd87f849344cbc3b8c4ac9c2dd1aaf
|
[] |
no_license
|
thejoshwolfe/nethack
|
17db0cd6c70582a1e540c19ce3e7c714e624ac13
|
8aafc6e7d4a13bd11edd409ae74fc8c809de47c9
|
refs/heads/master
| 2020-05-29T14:42:38.021534 | 2015-02-09T22:46:35 | 2015-02-09T22:53:35 | 28,373,474 | 4 | 1 | null | 2015-01-08T22:11:35 | 2014-12-23T02:53:27 |
C
|
UTF-8
|
C
| false | false | 13,557 |
c
|
hacklib.c
|
/* See LICENSE in the root of this project for change info */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "do_name.h"
#include "end.h"
#include "global.h"
#include "hacklib.h"
#include "util.h"
/*=
Assorted 'small' utility routines. They're virtually independent of
NetHack, except that rounddiv may call panic().
return type routine name argument type(s)
bool digit (char)
bool letter (char)
char highc (char)
char lowc (char)
char * lcase (char *)
char * upstart (char *)
char * mungspaces (char *)
char * eos (char *)
char * strkitten (char *,char)
char * s_suffix (const char *)
char * xcrypt (const char *, char *)
bool onlyspace (const char *)
char * tabexpand (char *)
char * visctrl (char)
const char * ordin (int)
char * sitoa (int)
int sgn (int)
int rounddiv (long, int)
int distmin (int, int, int, int)
int dist2 (int, int, int, int)
bool online2 (int, int)
bool pmatch (const char *, const char *)
int strncmpi (const char *, const char *, int)
char * strstri (const char *, const char *)
bool fuzzymatch (const char *,const char *,const char *,bool)
void setrandom (void)
int getyear (void)
char * yymmdd (time_t)
long yyyymmdd (time_t)
int phase_of_the_moon (void)
bool friday_13th (void)
int night (void)
int midnight (void)
=*/
/* is 'c' a digit? */
bool digit(char c) {
return ((bool)('0' <= c && c <= '9'));
}
/* is 'c' a letter? note: '@' classed as letter */
bool letter(char c) {
return ((bool)(('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z')));
}
/* force 'c' into uppercase */
char highc(char c) {
return ((char)(('a' <= c && c <= 'z') ? (c & ~040) : c));
}
/* force 'c' into lowercase */
char lowc(char c) {
return ((char)(('A' <= c && c <= 'Z') ? (c | 040) : c));
}
/* convert a string into all lowercase */
char * lcase(char *s) {
char *p;
for (p = s; *p; p++)
if ('A' <= *p && *p <= 'Z')
*p |= 040;
return s;
}
/* convert first character of a string to uppercase */
char * upstart(char *s) {
if (s)
*s = highc(*s);
return s;
}
/* remove excess whitespace from a string buffer (in place) */
char * mungspaces(char *bp) {
char c, *p, *p2;
bool was_space = true;
for (p = p2 = bp; (c = *p) != '\0'; p++) {
if (c == '\t')
c = ' ';
if (c != ' ' || !was_space)
*p2++ = c;
was_space = (c == ' ');
}
if (was_space && p2 > bp)
p2--;
*p2 = '\0';
return bp;
}
/* return the end of a string (pointing at '\0') */
char * eos(char *s) {
while (*s)
s++;
return s;
}
const char * const_eos(const char *s) {
while (*s)
s++;
return s;
}
/* strcat(s, {c,'\0'}); */
/* append a character to a string (in place) */
char * strkitten(char *s, char c) {
char *p = eos(s);
*p++ = c;
*p = '\0';
return s;
}
const char *possessive_suffix(const char *s) {
if (!strncmpi(s, "it", -1))
return "s";
else if (*(const_eos(s) - 1) == 's')
return "'";
else
return "'s";
}
/* return a name converted to possessive */
size_t s_suffix(char *dest, size_t dest_size, const char *s) {
return nh_slprintf(dest, dest_size, "%s%s", s, possessive_suffix(s));
}
size_t monster_possessive(char *dest, size_t dest_size, const struct monst *mon) {
char name[BUFSZ];
mon_nam(name, BUFSZ, mon);
return nh_slprintf(dest, dest_size, "%s%s", name, possessive_suffix(name));
}
size_t monster_possessive_cap(char *dest, size_t dest_size, const struct monst *mon) {
char name[BUFSZ];
size_t ret = monster_possessive(name, BUFSZ, mon);
upstart(name);
return ret;
}
/* trivial text encryption routine (see makedefs) */
char * xcrypt(const char *str, char *buf) {
const char *p;
char *q;
int bitmask;
for (bitmask = 1, p = str, q = buf; *p; q++) {
*q = *p++;
if (*q & (32 | 64))
*q ^= bitmask;
if ((bitmask <<= 1) >= 32)
bitmask = 1;
}
*q = '\0';
return buf;
}
/* is a string entirely whitespace? */
bool onlyspace(const char *s) {
for (; *s; s++)
if (*s != ' ' && *s != '\t')
return false;
return true;
}
/* expand tabs into proper number of spaces */
char * tabexpand(char *sbuf) {
char buf[BUFSZ];
char *bp, *s = sbuf;
int idx;
if (!*s)
return sbuf;
/* warning: no bounds checking performed */
for (bp = buf, idx = 0; *s; s++)
if (*s == '\t') {
do
*bp++ = ' ';
while (++idx % 8);
} else {
*bp++ = *s;
idx++;
}
*bp = 0;
return strcpy(sbuf, buf);
}
/* make a displayable string from a character */
char * visctrl(char c) {
static char ccc[3];
c &= 0177;
ccc[2] = '\0';
if (c < 040) {
ccc[0] = '^';
ccc[1] = c | 0100; /* letter */
} else if (c == 0177) {
ccc[0] = '^';
ccc[1] = c & ~0100; /* '?' */
} else {
ccc[0] = c; /* printable character */
ccc[1] = '\0';
}
return ccc;
}
/* return the ordinal suffix of a number */
/* note: n should be non-negative */
const char * ordin(int n) {
int dd = n % 10;
return (dd == 0 || dd > 3 || (n % 100) / 10 == 1) ? "th" : (dd == 1) ? "st" : (dd == 2) ? "nd" : "rd";
}
/* make a signed digit string from a number */
char * sitoa(int n) {
static char buf[13];
sprintf(buf, (n < 0) ? "%d" : "+%d", n);
return buf;
}
/* return the sign of a number: -1, 0, or 1 */
int sgn(int n) {
return (n < 0) ? -1 : (n != 0);
}
/* calculate x/y, rounding as appropriate */
int rounddiv(long x, int y) {
int r, m;
int divsgn = 1;
if (y == 0)
panic("division by zero in rounddiv");
else if (y < 0) {
divsgn = -divsgn;
y = -y;
}
if (x < 0) {
divsgn = -divsgn;
x = -x;
}
r = x / y;
m = x % y;
if (2 * m >= y)
r++;
return divsgn * r;
}
/* distance between two points, in moves */
int distmin(int x0, int y0, int x1, int y1) {
int dx = x0 - x1, dy = y0 - y1;
if (dx < 0)
dx = -dx;
if (dy < 0)
dy = -dy;
/* The minimum number of moves to get from (x0,y0) to (x1,y1) is the
: larger of the [absolute value of the] two deltas.
*/
return (dx < dy) ? dy : dx;
}
/* square of euclidean distance between pair of pts */
int dist2(int x0, int y0, int x1, int y1) {
int dx = x0 - x1, dy = y0 - y1;
return dx * dx + dy * dy;
}
/* are two points lined up (on a straight line)? */
bool online2(int x0, int y0, int x1, int y1) {
int dx = x0 - x1, dy = y0 - y1;
/* If either delta is zero then they're on an orthogonal line,
* else if the deltas are equal (signs ignored) they're on a diagonal.
*/
return ((bool)(!dy || !dx || (dy == dx) || (dy + dx == 0))); /* (dy == -dx) */
}
/* match a string against a pattern */
bool pmatch(const char *patrn, const char *strng) {
char s, p;
/*
: Simple pattern matcher: '*' matches 0 or more characters, '?' matches
: any single character. Returns true if 'strng' matches 'patrn'.
*/
pmatch_top: s = *strng++;
p = *patrn++; /* get next chars and pre-advance */
if (!p) /* end of pattern */
return ((bool)(s == '\0')); /* matches iff end of string too */
else if (p == '*') /* wildcard reached */
return ((bool)((!*patrn || pmatch(patrn, strng - 1)) ? true : s ? pmatch(patrn - 1, strng) : false));
else if (p != s && (p != '?' || !s)) /* check single character */
return false; /* doesn't match */
else
/* return pmatch(patrn, strng); */
goto pmatch_top;
/* optimize tail recursion */
}
/* case insensitive counted string comparison */
int strncmpi(const char *s1, const char *s2, int n /*(should probably be size_t, which is usually unsigned)*/
) { /*{ aka strncasecmp }*/
char t1, t2;
while (n--) {
if (!*s2)
return (*s1 != 0); /* s1 >= s2 */
else if (!*s1)
return -1; /* s1 < s2 */
t1 = lowc(*s1++);
t2 = lowc(*s2++);
if (t1 != t2)
return (t1 > t2) ? 1 : -1;
}
return 0; /* s1 == s2 */
}
/* case insensitive substring search */
char * strstri(const char *str, const char *sub) {
const char *s1, *s2;
int i, k;
#define TABSIZ 0x20 /* 0x40 would be case-sensitive */
char tstr[TABSIZ], tsub[TABSIZ]; /* nibble count tables */
/* special case: empty substring */
if (!*sub)
return (char *)str;
/* do some useful work while determining relative lengths */
for (i = 0; i < TABSIZ; i++)
tstr[i] = tsub[i] = 0; /* init */
for (k = 0, s1 = str; *s1; k++)
tstr[*s1++ & (TABSIZ - 1)]++;
for (s2 = sub; *s2; --k)
tsub[*s2++ & (TABSIZ - 1)]++;
/* evaluate the info we've collected */
if (k < 0)
return (char *)0; /* sub longer than str, so can't match */
for (i = 0; i < TABSIZ; i++) /* does sub have more 'x's than str? */
if (tsub[i] > tstr[i])
return (char *)0; /* match not possible */
/* now actually compare the substring repeatedly to parts of the string */
for (i = 0; i <= k; i++) {
s1 = &str[i];
s2 = sub;
while (lowc(*s1++) == lowc(*s2++))
if (!*s2)
return (char *)&str[i]; /* full match */
}
return (char *)0; /* not found */
}
/* compare two strings for equality, ignoring the presence of specified
characters (typically whitespace) and possibly ignoring case */
bool fuzzymatch(const char *s1, const char *s2, const char *ignore_chars, bool caseblind) {
char c1, c2;
do {
while ((c1 = *s1++) != '\0' && index(ignore_chars, c1) != 0)
continue;
while ((c2 = *s2++) != '\0' && index(ignore_chars, c2) != 0)
continue;
if (!c1 || !c2)
break; /* stop when end of either string is reached */
if (caseblind) {
c1 = lowc(c1);
c2 = lowc(c2);
}
} while (c1 == c2);
/* match occurs only when the end of both strings has been reached */
return (bool)(!c1 && !c2);
}
/*
* Time routines
*
* The time is used for:
* - seed for rand()
* - year on tombstone and yyyymmdd in record file
* - phase of the moon (various monsters react to NEW_MOON or FULL_MOON)
* - night and midnight (the undead are dangerous at midnight)
* - determination of what files are "very old"
*/
static struct tm *getlt(void);
void setrandom(void) {
/* the types are different enough here that sweeping the different
* routine names into one via #defines is even more confusing
*/
srandom((int)time((time_t *)0));
}
static struct tm * getlt(void) {
time_t date;
time(&date);
return (localtime((long *)(&date)));
}
int getyear(void) {
return (1900 + getlt()->tm_year);
}
long yyyymmdd(time_t date) {
long datenum;
struct tm *lt;
if (date == 0)
lt = getlt();
else
lt = localtime(&date);
/* just in case somebody's localtime supplies (year % 100)
rather than the expected (year - 1900) */
if (lt->tm_year < 70)
datenum = (long)lt->tm_year + 2000L;
else
datenum = (long)lt->tm_year + 1900L;
/* yyyy --> yyyymm */
datenum = datenum * 100L + (long)(lt->tm_mon + 1);
/* yyyymm --> yyyymmdd */
datenum = datenum * 100L + (long)lt->tm_mday;
return datenum;
}
/*
* moon period = 29.53058 days ~= 30, year = 365.2422 days
* days moon phase advances on first day of year compared to preceding year
* = 365.2422 - 12*29.53058 ~= 11
* years in Metonic cycle (time until same phases fall on the same days of
* the month) = 18.6 ~= 19
* moon phase on first day of year (epact) ~= (11*(year%19) + 29) % 30
* (29 as initial condition)
* current phase in days = first day phase + days elapsed in year
* 6 moons ~= 177 days
* 177 ~= 8 reported phases * 22
* + 11/22 for rounding
*/
/* 0-7, with 0: new, 4: full */
int phase_of_the_moon(void) {
struct tm *lt = getlt();
int epact, diy, goldn;
diy = lt->tm_yday;
goldn = (lt->tm_year % 19) + 1;
epact = (11 * goldn + 18) % 30;
if ((epact == 25 && goldn > 11) || epact == 24)
epact++;
return ((((((diy + epact) * 6) + 11) % 177) / 22) & 7);
}
bool friday_13th(void) {
struct tm *lt = getlt();
return ((bool)(lt->tm_wday == 5 /* friday */&& lt->tm_mday == 13));
}
int night(void) {
int hour = getlt()->tm_hour;
return (hour < 6 || hour > 21);
}
int midnight(void) {
return (getlt()->tm_hour == 0);
}
|
633a20055d31430bc34133a405b0378bcaa35d9a
|
890e8a95dc85ba102364f1dd61c8d3ff216beb79
|
/codeblocks/subsumvalid.c
|
443438ad3777e9efe1eb9fdb547886687a19b5ab
|
[] |
no_license
|
minopile/prog
|
59d0ce3e743dfbbd01fe116ff30e976d61415ff5
|
6884362536659fa978edd1d470844de48b07739d
|
refs/heads/master
| 2020-03-27T05:10:21.516624 | 2018-08-24T13:55:00 | 2018-08-24T13:55:00 | 145,998,781 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 507 |
c
|
subsumvalid.c
|
#include<stdio.h>
#include<stdbool.h>
int main()
{
int set[] = {3, 34, 4, 12, 5, 2};
int sum = 9;
int n = sizeof(set)/sizeof(set[0]);
if (isSubsetSum(set, n, sum) == true)
printf("Found a subset with given sum");
else
printf("No subset with given sum");
return 0;
}
isSubsetSum(set,n,sum){
if(sum==0)
return true;
if(sum!=0&&n==0)
return false;
if(set[n-1]>sum)
return isSubsetSum(set,n-1,sum);
return isSubsetSum(set,n-1,sum-set[n-1])||isSubsetSum(set,n-1,sum);
}
|
56bf33959830ea168ba65aa51c5d8ef7fa902c60
|
9d96bb0627d7abf63295394ddc53d56906446e06
|
/mbvdp/MB_VDP/helper_B_diag.c
|
76b0e89019b4d35ffdfdfd161348d6516389dfc6
|
[] |
no_license
|
alexalex222/Cluster-Analysis
|
856f845342d0bcbac1b62c2ed4178427673758d5
|
41842da82b9728f99929275d313e6f8864993d94
|
refs/heads/master
| 2016-09-11T08:02:34.039748 | 2015-06-27T23:42:12 | 2015-06-27T23:42:12 | 38,179,391 | 1 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 860 |
c
|
helper_B_diag.c
|
#include "mex.h"
#include "mxutils.c"
#include <math.h>
#define X_IN prhs[0]
#define Q_OF_Z prhs[1]
#define B_OUT plhs[0]
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray*prhs[] )
{
double *B, *X, *q_of_z;
double temp;
int mrows, ncols, ii, kk;
mrows = mxGetM(X_IN);
ncols = mxGetN(X_IN);
X = mxGetPr(X_IN);
q_of_z = mxGetPr(Q_OF_Z);
B_OUT = mxCreateDoubleMatrix(mrows,1,mxREAL);
B = mxGetPr(B_OUT);
for (ii = 0; ii < mrows; ii++)
{
B[ii] = 0;
}
/*traverse columnwise to prevent excessive cache hits*/
for (kk = 0; kk < ncols; kk++)
{
for (ii = 0; ii < mrows; ii++)
{
temp = (X[kk*mrows+ii]);
B[ii] += q_of_z[kk]*temp*temp;
}
}
}
|
0483ddcaf594cd78faaa17abad750ac8b9afdc5c
|
fa4fadb5e20ebefc5ee67654fb12f919d89b6c78
|
/02_print_scan/aula2.c
|
3b40bd61035ab11b9bb58eb48a2db97fc0f9d071
|
[] |
no_license
|
lineu96/estudo_c
|
cd7c396b9e69ea148f1e9fc7b26ea1f119965bc3
|
6112130109f09dce2d264a7374c4bf612ca8e745
|
refs/heads/master
| 2023-02-17T21:35:21.039341 | 2023-02-14T22:54:44 | 2023-02-14T22:54:44 | 282,337,446 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 260 |
c
|
aula2.c
|
// Aula 2 - printf e scanf
// scanf() - ler entrada do teclado
# include <stdio.h>
# include <stdlib.h>
int main(void){
int numero;
printf("Digite um numero: \n");
scanf("%i", &numero);
printf("\nVoce digitou %i\n", numero);
return 0;
}
|
2028fcdf3276472b6f7ff87ebfee4a499232a85c
|
a311dd75d9cbe0402c75a6e528630656d0b0bc40
|
/vendor/pbc/guru/prodpairing_test.c
|
083f4a66edb22b7b9ebee223c7e8a28bc26814e4
|
[
"GPL-1.0-or-later",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-3.0-only",
"MIT"
] |
permissive
|
sighttviewliu/ultrain-core-production
|
e158d375cf83caf7a952688708b3be9bbdee5783
|
c2807d9310da8b5dc1408502866be59299a96c22
|
refs/heads/master
| 2020-09-26T09:03:22.816526 | 2019-10-16T09:01:33 | 2019-11-06T11:53:45 | 226,222,711 | 1 | 0 |
MIT
| 2019-12-06T01:42:31 | 2019-12-06T01:42:30 | null |
UTF-8
|
C
| false | false | 1,089 |
c
|
prodpairing_test.c
|
// Check product of pairings works for F pairings when initialized via
// pairing_init_pbc_param().
//
// By Michael Adjedj, Ben Lynn.
#include "pbc.h"
#include "pbc_test.h"
int main(void) {
pbc_param_t param;
pbc_param_init_f_gen(param, 200);
pairing_t pairing;
pairing_init_pbc_param(pairing, param);
element_t P[2], Q[2], res, tmp, tmp2;
element_init_G1(P[0], pairing); element_random(P[0]);
element_init_G1(P[1], pairing); element_random(P[1]);
element_init_G2(Q[0], pairing); element_random(Q[0]);
element_init_G2(Q[1], pairing); element_random(Q[1]);
element_init_GT(res, pairing);
element_init_GT(tmp, pairing);
element_init_GT(tmp2, pairing);
element_prod_pairing(res, P, Q, 2);
element_pairing(tmp, P[0], Q[0]);
element_pairing(tmp2, P[1], Q[1]);
element_mul(tmp, tmp, tmp2);
EXPECT(!element_cmp(res, tmp));
element_clear(P[0]);
element_clear(P[1]);
element_clear(Q[0]);
element_clear(Q[1]);
element_clear(res);
element_clear(tmp);
element_clear(tmp2);
pairing_clear(pairing);
pbc_param_clear(param);
return 0;
}
|
c1fd0a498e0412a671ab7d89e546f79879df3e73
|
b367fe5f0c2c50846b002b59472c50453e1629bc
|
/xbox_leak_may_2020/xbox trunk/xbox/private/test/ui/cortana/xbDebug/xbDebug_i.c
|
68eb3beac708f60d89303d6583722f5dce3aa09e
|
[] |
no_license
|
sgzwiz/xbox_leak_may_2020
|
11b441502a659c8da8a1aa199f89f6236dd59325
|
fd00b4b3b2abb1ea6ef9ac64b755419741a3af00
|
refs/heads/master
| 2022-12-23T16:14:54.706755 | 2020-09-27T18:24:48 | 2020-09-27T18:24:48 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,159 |
c
|
xbDebug_i.c
|
/* this file contains the actual definitions of */
/* the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 5.01.0164 */
/* at Mon Feb 11 15:00:43 2002
*/
/* Compiler settings for C:\xbox\private\test\ui\automation\xbDebug\xbDebug.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#ifdef __cplusplus
extern "C"{
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
const IID IID_INetDebug = {0xB6BD872B,0xD6C7,0x4ACD,{0x97,0x04,0x81,0xF4,0xDC,0xE6,0x5C,0xA4}};
const IID LIBID_XBDEBUGLib = {0x2EF1DC7D,0xB7B4,0x4B86,{0x92,0xBE,0x93,0x57,0x20,0xE3,0x25,0xBB}};
const CLSID CLSID_NetDebug = {0xB11C43CA,0x5735,0x43FD,{0x98,0xAF,0x52,0x87,0x5C,0xC5,0x6E,0xA7}};
#ifdef __cplusplus
}
#endif
|
a92786853056182c3241dc87f6ade358fffb8fdb
|
ab2e91f75e3d6485cd397c34fa4189d0e0882723
|
/Lab/Lab04-4_Freq/dr_lcdseg.h
|
b4a685deb76d7c83e8e23f416f8bb4b6be9e4a07
|
[] |
no_license
|
ljjliujunjie123/mySOCcourse
|
eb55ac1d5dd23ccdbd27a6d04c9406a85c9aa556
|
83fa2ddbdd2723f749f009df4842bea88139ed8e
|
refs/heads/main
| 2023-03-25T16:03:58.503721 | 2021-03-25T00:31:17 | 2021-03-25T00:31:17 | 344,007,683 | 3 | 0 | null | null | null | null |
GB18030
|
C
| false | false | 692 |
h
|
dr_lcdseg.h
|
/*
* dr_lcdseg.h
*
* Created on: 2013-5-28
* Additional: DengPihui
*/
#ifndef DR_LCDSEG_H_
#define DR_LCDSEG_H_
void initLcdSeg(); //显示频初始化
void LCDSEG_SetDigit(int pos, int value);
/* 在pos(0<=pos<=5)位置写入一个
* 整数value(-1《=value《=16,0《=pos《=5),
* value=16表示写入负号,value=-1表示清除该位
*/
void LCDSEG_SetSpecSymbol(int pos);//在pos位置清除小数点(3<=pos<=5)
void LCDSEG_ResetSpecSymbol(int pos);//在pos位置写小数点(3<=pos<=5)
void LCDSEG_DisplayNumber(long num, int dppos);//让段式液晶显示num这个整数,并在dppos位置处添加小数点(《0《dppos《=3)
#endif /* DR_LCDSEG_H_ */
|
8145d9feea6f63740bf6c8b659becfb1e5c222be
|
d78b579c4f7ea090478360fd560fca0de21fec5a
|
/XML_Parser_C/stdFunc.h
|
289f6c94b740cd98d7e696d5f419618a3a6e8257
|
[] |
no_license
|
pointmoon/XML_Parser_C
|
b932006804d30adece67da3da2c0dde1657af161
|
196332885d7f9c49480329df6a34656d1e0860a4
|
refs/heads/master
| 2020-12-02T10:02:16.234570 | 2017-07-09T11:59:37 | 2017-07-09T11:59:37 | 96,680,883 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 410 |
h
|
stdFunc.h
|
#ifndef STDFUNC_H_INCLUDED
#define STDFUNC_H_INCLUDED
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Lecser.h"
/*
* Display info for help.
*/
void vInitial();
/*
* Free dynamic memory.
*/
void vDestruction(char**, int*);
/*
* Read file from memory.
*/
char** vReadFile(FILE*, char**, int*);
/*
* Open file from memory.
*/
FILE* pFileOpen(char*, char*);
#endif // STDFUNC_H_INCLUDED
|
5f8f96a7ad3b3196a6465305f0b42f1cd2e5f379
|
b6415599daa28e8f44b431a6418ceb7283bf5971
|
/12.6.c
|
89a84fd0fdefe37eb7b4871eeb24ff05c7d248ea
|
[] |
no_license
|
aviralkukreja/C-Programs
|
cba50a4df45eb879711f2b391126936cc749abba
|
2b249e24025340ffea141a1eb64de3d2ba0a4246
|
refs/heads/master
| 2021-01-17T21:03:20.063897 | 2016-09-20T06:16:23 | 2016-09-20T06:16:23 | 68,680,407 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 3,329 |
c
|
12.6.c
|
//Exercise 12.6
#include <stdio.h>
#include <stdlib.h>
/* ListNode structure definition */
struct ListNode {
char data; /* node data */
struct ListNode *nextPtr; /* pointer to next node */
}; /* end struct ListNode */
typedef struct ListNode ListNode; typedef ListNode *ListNodePtr;
/* function prototypes */
void concatenate( ListNodePtr a, ListNodePtr b );
void insert( ListNodePtr *sPtr, char value );
void printList( ListNodePtr currentPtr );
int main()
{
ListNodePtr list1Ptr = NULL; /* pointer to first list */ ListNodePtr list2Ptr = NULL; /* pointer to second list */
char i; /* loop counter */
/* assign letters from A to C into first list */
for(i='A';i<='C';i++){
insert( &list1Ptr, i );
}/*endfor*/
printf( "List 1 is: " );
printList( list1Ptr );
/* assign letters from D to F into second list */
for(i='D';i<='F';i++){
insert( &list2Ptr, i );
}/*endfor*/
printf( "List 2 is: " );
printList( list2Ptr );
concatenate( list1Ptr, list2Ptr ); printf( "The concatenated list is: " ); printList( list1Ptr );
return 0; /* indicate successful termination */ }/*endmain*/
/* Concatenate two lists */
void concatenate( ListNodePtr a, ListNodePtr b )
{
ListNodePtr currentPtr; /* temporary pointer */ currentPtr = a; /* set currentPtr to first linked list */
/* while currentPtr does not equal NULL */
while( currentPtr->nextPtr != NULL ) { currentPtr = currentPtr->nextPtr;
} /* end while */
currentPtr->nextPtr = b; /* concatenate both lists */
} /* end function concatenate */
/* Insert a new value into the list in sorted order */
void insert( ListNodePtr *sPtr, char value ) {
ListNodePtr newPtr; /* new node */
ListNodePtr previousPtr; /* previous node */
ListNodePtr currentPtr; /* current node */
/* dynamically allocate memory */
newPtr = malloc( sizeof( ListNode ) );
/* if newPtr does not equal NULL */
if(newPtr){
newPtr->data = value;
newPtr->nextPtr = NULL; previousPtr = NULL;
currentPtr = *sPtr; /* set currentPtr to start of list */
/* loop to find correct location in list */
while ( currentPtr != NULL && value > currentPtr->data ) { previousPtr = currentPtr;
currentPtr = currentPtr->nextPtr;
} /* end while */
/* insert at beginning of list */
if ( previousPtr == NULL ) { newPtr->nextPtr = *sPtr; *sPtr = newPtr;
} /* end if */
else { /* insert node between previousPtr and currentPtr */ previousPtr->nextPtr = newPtr;
newPtr->nextPtr = currentPtr;
} /* end else */
} /* end if */ else {
printf( "%c not inserted. No memory available.\n", value ); } /* end else */
} /* end function insert */
/* Print the list */
void printList( ListNodePtr currentPtr ) {
/* if list is empty */
if ( !currentPtr ) {
printf( "List is empty.\n\n" ); } /* end if */
else {
/* loop while currentPtr does not equal NULL */
while ( currentPtr ) {
printf( "%c ", currentPtr->data ); currentPtr = currentPtr->nextPtr;
} /* end while */
printf( "*\n\n" );
} /* end else */
} /* end function printList */
|
63944461d9b7e27dee8a2f4c645ec9303ffdabb4
|
110d796225af0617952e6ad535a9cfd1adb99883
|
/File_Input_Output/han.c
|
ab389c820d119e7181a95b1054deff5cb028edb7
|
[
"MIT"
] |
permissive
|
jaeheeLee17/System_Programming
|
f999d0ff04e47207c9c7cf527e58dfbdca94aca5
|
64a453748e317fb52896ac54a045f20fce969b47
|
refs/heads/main
| 2023-06-02T10:28:10.385739 | 2021-06-23T12:34:58 | 2021-06-23T12:34:58 | 377,444,257 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 385 |
c
|
han.c
|
Welcome to the System Programming Class!
We have learned about File System Calls.
There are many kinds of File System Calls such as open, read, write, lseek etc.
These system calls are used at files in which we make some sentences.
If you are skilled at these calls, You can make some commands about files.
The class will end of this point.
Thank you for listening my class.
Good Bye!
|
4254407f4051034409ce0573a985c14be162eb91
|
2f0e9bdda9388f9a5f8bfc03198483c2af0ff414
|
/_en/Computer/Data_Structure/List/Reverse_List.c
|
e7c26d73ebeaff06d09b6b1c8e8f408176513102
|
[] |
no_license
|
bss9395/bss9395.github.io
|
b3428a874583ce5a3192b863b4c432a007aa24e6
|
cb19d1756649a48905df452b492aa0b9f16ebd72
|
refs/heads/master
| 2023-09-01T12:32:57.801403 | 2023-08-29T04:26:59 | 2023-08-29T04:26:59 | 57,353,103 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,526 |
c
|
Reverse_List.c
|
/* Reverse_List.c
Author: BSS9395
Update: 2020-08-25T09:31:00+08@China-Guangdong-Zhanjiang+08
Design: Reverse Linked List
*/
#include <stdio.h>
#include <stdlib.h>
typedef struct _Node {
int _data;
struct _Node *_next;
} Node;
void Reverse_List(Node *list) {
Node *prev = NULL;
Node *curr = list->_next;
Node *next = NULL;
while (curr != NULL) {
next = curr->_next;
curr->_next = prev;
prev = curr;
curr = next;
}
list->_next = prev;
}
int main(int argc, char *argv[]) {
Node list;
Node node0 = { 9, NULL };
Node node1 = { 0, NULL };
Node node2 = { 8, NULL };
Node node3 = { 2, NULL };
Node node4 = { 6, NULL };
Node node5 = { 1, NULL };
Node node6 = { 3, NULL };
Node node7 = { 4, NULL };
Node node8 = { 5, NULL };
Node node9 = { 7,NULL };
list._next = &node0;
node0._next = &node1;
node1._next = &node2;
node2._next = &node3;
node3._next = &node4;
node4._next = &node5;
node5._next = &node6;
node6._next = &node7;
node7._next = &node8;
node8._next = &node9;
node9._next = NULL;
for (Node *head = list._next; head != NULL; head = head->_next) {
fprintf(stdout, " => %d", head->_data);
}
fprintf(stdout, "\n");
////////////////////////////////////
Reverse_List(&list);
for (Node *head = list._next; head != NULL; head = head->_next) {
fprintf(stdout, " => %d", head->_data);
}
fprintf(stdout, "\n");
return 0;
}
|
aed14973636d1975415858b75a4fb2295df91a03
|
9d8022d9614190158f5799cf4f812e07fcd87527
|
/pset3/helpers.c
|
8093719c8f195bf47d40184cf31afe97d84e293a
|
[] |
no_license
|
kungfucat/CS50x
|
9f65d495094f7a17c834f2df3d5d7e4386a15616
|
ffdf0dad0a1520276444c3906a2a6ef617e66d99
|
refs/heads/master
| 2021-03-22T00:26:38.230422 | 2017-06-01T15:32:52 | 2017-06-01T15:32:52 | 93,069,860 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,014 |
c
|
helpers.c
|
/**
* helpers.c
*
* Computer Science 50
* Problem Set 3
*
* Helper functions for Problem Set 3.
*/
#include <cs50.h>
#include "helpers.h"
/**
* Returns true if value is in array of n values, else false.
*/
bool search(int value, int values[], int n)
{
int mid,beg=0,end=n-1;
if(n<0)
return false;
else
{
while(beg<=end)
{
mid=(beg+end)/2;
if(values[mid]==value)
return true;
else if(values[mid]<value)
beg=mid+1;
else
end=mid-1;
}
return false;
}
}
/**
* Sorts array of n values.
*/
void sort(int values[], int n)
{
int i,j;
for(i=0;i<n;i++)
{
for(j=0;j<n-1;j++)
{
if(values[j]>values[j+1])
{
values[j+1]=values[j]+values[j+1];
values[j]=values[j+1]-values[j];
values[j+1]=values[j+1]-values[j];
}
}
}
return;
}
|
aa33c03927242fcebf4e1c484527f9f437d56c50
|
cf1ac47ed00becb0027454d3b406dbbdb221c06e
|
/Modulo2/Sesion6/Ejercicio1.c
|
c33439f9d20502a8e33ef8224db0b7a2fe02e392
|
[] |
no_license
|
jadelarosac/Practicas_SO
|
67aa56a9799caf8a1038c8ce76ad5f50d0706df3
|
5869d93f2404e87edd37d527eb10f0b859f7f4fe
|
refs/heads/main
| 2023-02-15T01:55:53.796735 | 2021-01-12T09:06:57 | 2021-01-12T09:06:57 | 315,972,169 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,794 |
c
|
Ejercicio1.c
|
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
char * sym = argv[argc-2];
char * filename = argv[argc-1];
int fd, i;
char * argumentos[argc];
if (argc < 2 ){
printf("Error, número de argumentos incorrectos");
exit(EXIT_FAILURE);
}
for (i = 0; i < argc - 3; i++) {
argumentos[i] = (char *) malloc(strlen(argv[i+1])+1);
strcpy(argumentos[i], argv[i+1]);
}
argumentos[i] = NULL;
if( strcmp(sym, ">") == 0 )
{
if( (fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC , S_IRWXU ) ) < 0 )
{
perror("Error en el open\n");
exit(EXIT_FAILURE);
}
close(STDOUT_FILENO);
if ( fcntl(fd, F_DUPFD, STDOUT_FILENO) == -1 )
{
perror("Fallo en el fcntl\n");
exit(EXIT_FAILURE);
}
if(execvp(argv[1], argumentos) < 0){
perror("Error en execvp.\n");
exit(EXIT_FAILURE);
}
}
else if ( strcmp(sym, "<") == 0 )
{
if( (fd = open(filename, O_RDONLY ) ) < 0 )
{
perror("Error en el open\n");
exit(EXIT_FAILURE);
}
close(STDIN_FILENO);
if ( fcntl(fd, F_DUPFD, STDIN_FILENO) == -1 )
{
perror("Fallo en el fcntl\n");
exit(EXIT_FAILURE);
}
if(execvp(argv[1], argumentos) < 0){
perror("Error en execvp.\n");
exit(EXIT_FAILURE);
}
}
else
{
perror("Error. debe usarse: ./programa <orden bash> \">\"|\"<\" <archivo>\n");
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
|
13b3a2552a4c6cc17a3f05aaffac5ba45796d5f9
|
4770198915790b7afb89a96e4e89e61c24768c56
|
/EVT2_Function_TEST_0927/User/spi/bsp_spi_flash.c
|
4711948d1e72b8beb932de38251ea0df1bf21b36
|
[] |
no_license
|
Wang-shuange/gitdemo
|
f733c2cde2b8016832a281617a70b14ea608cfc2
|
68804d084c2c9f5393254cbd2184d52f56674baf
|
refs/heads/master
| 2020-03-29T16:32:37.231382 | 2018-10-18T01:42:22 | 2018-10-18T01:42:22 | 150,117,688 | 1 | 0 | null | null | null | null |
GB18030
|
C
| false | false | 4,526 |
c
|
bsp_spi_flash.c
|
/**
******************************************************************************
* @file bsp_xxx.c
* @author STMicroelectronics
* @version V1.0
* @date 2013-xx-xx
* @brief spi flash 底层应用函数bsp
******************************************************************************
* @attention
*
* 实验平台:野火 iSO STM32 开发板
* 论坛 :http://www.chuxue123.com
* 淘宝 :http://firestm32.taobao.com
*
******************************************************************************
*/
#include "bsp_spi_flash.h"
#include "bsp_usart.h"
/*******************************************************************************
* Function Name : SPI_FLASH_Init
* Description : Initializes the peripherals used by the SPI FLASH driver.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SPI_FLASH_Init(void)
{
SPI_InitTypeDef SPI_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
/* Enable SPI1 and GPIO clocks */
/*!< SPI_FLASH_SPI_CS_GPIO, SPI_FLASH_SPI_MOSI_GPIO,
SPI_FLASH_SPI_MISO_GPIO, SPI_FLASH_SPI_DETECT_GPIO
and SPI_FLASH_SPI_SCK_GPIO Periph clock enable */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOD| RCC_APB2Periph_GPIOE| RCC_APB2Periph_GPIOC, ENABLE);
/*!< SPI_FLASH_SPI Periph clock enable */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);
/*!< Configure SPI_FLASH_SPI pins: SCK */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/*!< Configure SPI_FLASH_SPI pins: MISO */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/*!< Configure SPI_FLASH_SPI pins: MOSI */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/*!< Configure SPI_FLASH_SPI_CS_PIN pin: SPI_FLASH Card CS pin */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/********************************************************************///BT复位引脚
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_1|GPIO_Pin_11;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);
GPIO_SetBits(GPIOE, GPIO_Pin_8);GPIO_SetBits(GPIOE, GPIO_Pin_9);GPIO_SetBits(GPIOE, GPIO_Pin_10);
GPIO_ResetBits(GPIOE, GPIO_Pin_1);
GPIO_ResetBits(GPIOE, GPIO_Pin_11);
/* SPI1 configuration */
// W25X16: data input on the DIO pin is sampled on the rising edge of the CLK.
// Data on the DO and DIO pins are clocked out on the falling edge of CLK.
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(SPI1, &SPI_InitStructure);
SPI_Cmd(SPI1, ENABLE);
}
/*******************************************************************************
* Function Name : SPI_FLASH_SendByte
* Description : Sends a byte through the SPI interface and return the byte
* received from the SPI bus.
* Input : byte : byte to send.
* Output : None
* Return : The value of the received byte.
*******************************************************************************/
u8 SPI_FLASH_SendByte(u8 byte)
{
/* Loop while DR register in not emplty */
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
/* Send byte through the SPI1 peripheral */
SPI_I2S_SendData(SPI1, byte);
/* Wait to receive a byte */
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
/* Return the byte read from the SPI bus */
return SPI_I2S_ReceiveData(SPI1);
}
/*********************************************END OF FILE**********************/
|
f034411bb4294aad9eaf09b0a479cd3c02b1e1d5
|
e5fc59a4b92aff128de78c2cc96c425fdbdd5340
|
/libc/newlib/libc/sys/or1k/mlock.c
|
ccb8401611482679d3463e8fcaf999853a3e1954
|
[
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"MIT",
"LGPL-2.1-only",
"BSD-2-Clause-Views",
"GPL-2.0-or-later",
"GCC-exception-2.0",
"LicenseRef-scancode-gcc-compiler-exception-2.0",
"BSD-3-Clause",
"HP-1986",
"LicenseRef-scancode-newlib-historical",
"BSD-2-Clause",
"SunPro",
"LicenseRef-scancode-nilsson-historical",
"LicenseRef-scancode-delorie-historical",
"LicenseRef-scancode-amd-historical",
"LGPL-3.0-only",
"Spencer-94",
"LGPL-2.1-or-later",
"SMLNJ",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-x11-hanson",
"LicenseRef-scancode-intel-osl-1993",
"LicenseRef-scancode-other-copyleft",
"dtoa",
"LicenseRef-scancode-bsd-unmodified",
"GPL-3.0-only",
"GPL-2.0-only"
] |
permissive
|
virtines/wasp
|
2ad58fe6628b0655e90a2d6dde80694fafce4efa
|
0ddb5143057d7e6aaa3a3f2dfdebcc384c15c2fe
|
refs/heads/main
| 2023-05-23T23:29:50.213465 | 2023-03-31T17:43:23 | 2023-03-31T17:43:23 | 415,649,935 | 12 | 5 |
MIT
| 2023-03-31T17:43:25 | 2021-10-10T17:10:12 |
C
|
UTF-8
|
C
| false | false | 3,216 |
c
|
mlock.c
|
/* malloc-lock.c. Lock malloc.
*
* Copyright (C) 2014, Authors
*
* Contributor Stefan Wallentowitz <stefan.wallentowitz@tum.de>
*
* The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided
* that existing copyright notices are retained in all copies and that this
* notice is included verbatim in any distributions. No written agreement,
* license, or royalty fee is required for any of the authorized uses.
* Modifications to this software may be copyrighted by their authors
* and need not follow the licensing terms described here, provided that
* the new terms are clearly indicated on the first page of each file where
* they apply.
*/
#include <reent.h>
#include <stdint.h>
/* Lock calls from different cores, but allows recursive calls from the same
* core. The lock is not only atomic to other cores calling malloc, but also
* disables all external interrupts. This is necessary as it could otherwise
* lead to a deadlock to interrupt while in malloc and then call it from an
* exception. But as we want the exceptions to be flexible to use all library
* calls and especially memory management this is necessary.
*/
// The lock. It is zero when unlocked and contains a unique value for each core.
// This value is not the core id (to avoid id zero), but the pointer value of
// the core specific struct _reent.
volatile uint32_t _or1k_malloc_lock;
// Count how often the current holder has entered the lock
volatile uint32_t _or1k_malloc_lock_cnt;
// The exception enable restore of the current mutex holder
volatile uint32_t _or1k_malloc_lock_restore;
extern uint32_t or1k_sync_cas(void *address, uint32_t compare, uint32_t swap);
/**
* Recursive lock of the malloc
*/
void __malloc_lock(struct _reent *ptr) {
uint32_t restore;
uint32_t id;
// Each core is identified by its struct _reent pointer
id = (uint32_t) ptr;
// Disable timer and interrupt exception, save TEE and IEE flag
// temporarily to restore them later on unlock
restore = or1k_critical_begin();
// We cannot be disturbed by an interrupt or timer exception from here
// Check if we currently don't hold the lock
if (_or1k_malloc_lock != id) {
do {
// Repeatedly check the lock until it is set to zero
while (_or1k_malloc_lock != 0) {}
// .. and then try to set it atomically. As this may
// fail, we need to repeat this
} while (or1k_sync_cas((void*) &_or1k_malloc_lock, 0, id) != 0);
}
// Store the TEE and IEE flags for later restore
if (_or1k_malloc_lock_cnt == 0) {
_or1k_malloc_lock_restore = restore;
}
// Increment counter. The lock may be accessed recursively
_or1k_malloc_lock_cnt++;
return;
}
void __malloc_unlock(struct _reent *ptr) {
// Decrement counter. The lock may be unlocked recursively
_or1k_malloc_lock_cnt--;
// If this was the last recursive unlock call
if(_or1k_malloc_lock_cnt == 0){
// We need to temporarily store the value to avoid a race
// condition between unlocking and reading restore
uint32_t restore = _or1k_malloc_lock_restore;
// unset lock
_or1k_malloc_lock = 0;
// Restore flags
or1k_critical_end(restore);
}
return;
}
|
165d66c7c5c56f95c438378c89e9b31eee891248
|
61109c6e4d52c3e066260f2b38223b80a698808c
|
/codes/ADXL345_I2C.c
|
48656145337ff7a5d6f3352e7a4cc59f911563fd
|
[] |
no_license
|
Waqar-107/Nymeria
|
40b15374614f97b76df3b11273e083fca57a4aa7
|
7324b34afbb9eeb76e9f7ccb4cef81d252c713a4
|
refs/heads/master
| 2021-07-14T12:36:27.179112 | 2020-05-10T16:46:25 | 2020-05-10T16:46:25 | 134,294,318 | 1 | 3 | null | null | null | null |
UTF-8
|
C
| false | false | 724 |
c
|
ADXL345_I2C.c
|
/*
* CFile1.c
*
* Created: 9/25/2017 6:35:24 AM
* Author: hesham_omr
*/
#include "ADXL345_I2C.h"
void ADXL_init()
{
TWI_Ini();
ADXL_write(0x2D,0x08);
}
void ADXL_write(char address,char data)
{
TWI_start();
TWI_write(dev_write);
TWI_write(address);
TWI_write(data);
TWI_stop();
}
void ADXL_Acc(float data_array[])
{
int x0,x1,y0,y1,z0,z1;
TWI_start();
TWI_write(dev_write);
TWI_write(x0_address);
TWI_start();
TWI_write(dev_read);
x0=TWI_read(ACKM);
x1=TWI_read(ACKM);
y0=TWI_read(ACKM);
y1=TWI_read(ACKM);
z0=TWI_read(ACKM);
z1=TWI_read(NACKM);
TWI_stop();
data_array[0]=((x1<<8)|x0)*g/sensitivity;
data_array[1]=((y1<<8)|y0)*g/sensitivity;
data_array[2]=((z1<<8)|z0)*g/sensitivity ;
}
|
54d98e8ad7ebf0893dbeaefd82d9d684dc25c3d0
|
110978b6025d556f32c154ab979c5f0fa8c76af4
|
/src/types.h
|
587adae73d3f19a65557bbf93004c489f1b1e608
|
[
"Zlib"
] |
permissive
|
Mikenno/ModelGen
|
8bfafb85f932efd74eca75d2e4b4aecc6a521728
|
1e036f2eb9f08219ddd77de0518b68fc9fe2453b
|
refs/heads/master
| 2020-05-18T14:27:20.220213 | 2018-06-03T12:05:22 | 2018-06-03T12:05:22 | 184,472,152 | 0 | 1 |
Zlib
| 2019-05-01T19:46:42 | 2019-05-01T19:46:42 | null |
UTF-8
|
C
| false | false | 2,512 |
h
|
types.h
|
#ifndef MODELGEN_TYPES_H
#define MODELGEN_TYPES_H
typedef enum MGType {
MG_TYPE_NULL,
MG_TYPE_INTEGER,
MG_TYPE_FLOAT,
MG_TYPE_STRING,
MG_TYPE_TUPLE,
MG_TYPE_LIST,
MG_TYPE_MAP,
MG_TYPE_CFUNCTION,
MG_TYPE_BOUND_CFUNCTION,
MG_TYPE_FUNCTION,
MG_TYPE_PROCEDURE,
MG_TYPE_MODULE
} MGType;
typedef char MGbool;
typedef MGbool MGtribool;
#define MG_INDETERMINATE (MGbool) (-1)
#define MG_FALSE (MGbool) 0
#define MG_TRUE (MGbool) 1
typedef struct MGInstance MGInstance;
typedef struct MGValue MGValue;
typedef MGValue* (*MGCFunction)(MGInstance *instance, size_t argc, const MGValue* const* argv);
typedef MGValue* (*MGBoundCFunction)(MGInstance *instance, const MGValue *value, size_t argc, const MGValue* const* argv);
typedef void (*MGTypeCreate)(MGValue *value);
typedef void (*MGTypeCopy)(MGValue *copy, const MGValue *value, MGbool shallow);
typedef void (*MGTypeDestroy)(MGValue *value);
typedef MGValue* (*MGTypeConvert)(const MGValue *value, MGType type);
typedef MGbool (*MGTypeTruthValue)(const MGValue *value);
typedef char* (*MGTypeToString)(const MGValue *value);
typedef MGValue* (*MGTypeUnaryOp)(const MGValue *operand);
typedef MGValue* (*MGTypeBinOp)(const MGValue *lhs, const MGValue *rhs);
typedef MGtribool (*MGTypeBinOpCompare)(const MGValue *lhs, const MGValue *rhs);
typedef MGValue* (*MGTypeSubscriptGet)(const MGValue *collection, const MGValue *index);
typedef MGbool (*MGTypeSubscriptSet)(const MGValue *collection, const MGValue *index, MGValue *value);
typedef MGValue* (*MGTypeAttributeGet)(const MGValue *collection, const char *key);
typedef MGbool (*MGTypeAttributeSet)(const MGValue *collection, const char *key, MGValue *value);
typedef struct MGTypeData {
const char *name;
MGTypeCreate create;
MGTypeCopy copy;
MGTypeDestroy destroy;
MGTypeConvert convert;
MGTypeTruthValue truth;
MGTypeToString str;
MGTypeUnaryOp pos;
MGTypeUnaryOp neg;
MGTypeUnaryOp inv;
MGTypeBinOp add;
MGTypeBinOp sub;
MGTypeBinOp mul;
MGTypeBinOp div;
MGTypeBinOp intdiv;
MGTypeBinOp mod;
MGTypeBinOpCompare eq;
MGTypeBinOpCompare lt;
MGTypeBinOpCompare le;
MGTypeSubscriptGet subGet;
MGTypeSubscriptSet subSet;
MGTypeAttributeGet attrGet;
MGTypeAttributeSet attrSet;
} MGTypeData;
extern const MGTypeData _mgTypes[];
#define mgGetType(type) (_mgTypes + (int) (type))
#define mgGetTypeName(type) mgGetType(type)->name
#define _MG_LONGEST_TYPE_NAME_LENGTH 6
MGType mgLookupType(const char *name);
const MGTypeData* mgLookupTypeData(const char *name);
#endif
|
4c5d07d20bd5b8a42a1d92f4ed3ab58812415db7
|
1d882bf4135ba734217b529419681161cea689fa
|
/Supernova/projects/board/ChipInfo/MSD5040S.h
|
14a6f8124c8370bd39718973ed569cca503f2d1f
|
[] |
no_license
|
kungfu-monkey/Supernova
|
0445eee3ef5b7d6d5edd93cfe35c1213696fa5a9
|
42bcd6365134b50acac6fd1f207e132681fa8eda
|
refs/heads/master
| 2016-04-29T08:06:49.820616 | 2015-11-23T13:07:17 | 2015-11-23T13:07:17 | 46,719,653 | 0 | 3 | null | null | null | null |
UTF-8
|
C
| false | false | 33,352 |
h
|
MSD5040S.h
|
//<MStar Software>
//******************************************************************************
// MStar Software
// Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
// All software, firmware and related documentation herein ("MStar Software") are
// intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
// law, including, but not limited to, copyright law and international treaties.
// Any use, modification, reproduction, retransmission, or republication of all
// or part of MStar Software is expressly prohibited, unless prior written
// permission has been granted by MStar.
//
// By accessing, browsing and/or using MStar Software, you acknowledge that you
// have read, understood, and agree, to be bound by below terms ("Terms") and to
// comply with all applicable laws and regulations:
//
// 1. MStar shall retain any and all right, ownership and interest to MStar
// Software and any modification/derivatives thereof.
// No right, ownership, or interest to MStar Software and any
// modification/derivatives thereof is transferred to you under Terms.
//
// 2. You understand that MStar Software might include, incorporate or be
// supplied together with third party`s software and the use of MStar
// Software may require additional licenses from third parties.
// Therefore, you hereby agree it is your sole responsibility to separately
// obtain any and all third party right and license necessary for your use of
// such third party`s software.
//
// 3. MStar Software and any modification/derivatives thereof shall be deemed as
// MStar`s confidential information and you agree to keep MStar`s
// confidential information in strictest confidence and not disclose to any
// third party.
//
// 4. MStar Software is provided on an "AS IS" basis without warranties of any
// kind. Any warranties are hereby expressly disclaimed by MStar, including
// without limitation, any warranties of merchantability, non-infringement of
// intellectual property rights, fitness for a particular purpose, error free
// and in conformity with any international standard. You agree to waive any
// claim against MStar for any loss, damage, cost or expense that you may
// incur related to your use of MStar Software.
// In no event shall MStar be liable for any direct, indirect, incidental or
// consequential damages, including without limitation, lost of profit or
// revenues, lost or damage of data, and unauthorized system use.
// You agree that this Section 4 shall still apply without being affected
// even if MStar Software has been modified by MStar in accordance with your
// request or instruction for your use, except otherwise agreed by both
// parties in writing.
//
// 5. If requested, MStar may from time to time provide technical supports or
// services in relation with MStar Software to you for your use of
// MStar Software in conjunction with your or your customer`s product
// ("Services").
// You understand and agree that, except otherwise agreed by both parties in
// writing, Services are provided on an "AS IS" basis and the warranty
// disclaimer set forth in Section 4 above shall apply.
//
// 6. Nothing contained herein shall be construed as by implication, estoppels
// or otherwise:
// (a) conferring any license or right to use MStar name, trademark, service
// mark, symbol or any other identification;
// (b) obligating MStar or any of its affiliates to furnish any person,
// including without limitation, you and your customers, any assistance
// of any kind whatsoever, or any information; or
// (c) conferring any license or right under any intellectual property right.
//
// 7. These terms shall be governed by and construed in accordance with the laws
// of Taiwan, R.O.C., excluding its conflict of law rules.
// Any and all dispute arising out hereof or related hereto shall be finally
// settled by arbitration referred to the Chinese Arbitration Association,
// Taipei in accordance with the ROC Arbitration Law and the Arbitration
// Rules of the Association by three (3) arbitrators appointed in accordance
// with the said Rules.
// The place of arbitration shall be in Taipei, Taiwan and the language shall
// be English.
// The arbitration award shall be final and binding to both parties.
//
//******************************************************************************
//<MStar Software>
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2009 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// ("MStar Confidential Information") by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
////////////////////////////////////////////////////////////////////////////////
// This file is generated by script, please do not edit it directly
#ifndef _MSD5040S_H_
#define _MSD5040S_H_
#define PAD_NC 9999
#define PAD_GND 0
#define PIN_2 PAD_HSYNC_OUT
#define PAD_HSYNC_OUT 159
#define GPIO_PAD_159 GPIO158
#ifndef PIN_2_IS_GPIO
#define PIN_2_IS_GPIO 0
#endif
#ifndef PAD_HSYNC_OUT_IS_GPIO
#define PAD_HSYNC_OUT_IS_GPIO PIN_2_IS_GPIO
#endif
#define PIN_3 PAD_VSYNC_OUT
#define PAD_VSYNC_OUT 160
#define GPIO_PAD_160 GPIO159
#ifndef PIN_3_IS_GPIO
#define PIN_3_IS_GPIO 0
#endif
#ifndef PAD_VSYNC_OUT_IS_GPIO
#define PAD_VSYNC_OUT_IS_GPIO PIN_3_IS_GPIO
#endif
#define PIN_4 PAD_SM1_RST
#define PAD_SM1_RST 33
#define GPIO_PAD_33 GPIO32
#ifndef PIN_4_IS_GPIO
#define PIN_4_IS_GPIO 0
#endif
#ifndef PAD_SM1_RST_IS_GPIO
#define PAD_SM1_RST_IS_GPIO PIN_4_IS_GPIO
#endif
#define PAD_SM0_IO 9999
#ifndef PAD_SM0_IO_IS_GPIO
#define PAD_SM0_IO_IS_GPIO 0
#endif
#define PIN_5 PAD_SM1_CD
#define PAD_SM1_CD 34
#define GPIO_PAD_34 GPIO33
#ifndef PIN_5_IS_GPIO
#define PIN_5_IS_GPIO 0
#endif
#ifndef PAD_SM1_CD_IS_GPIO
#define PAD_SM1_CD_IS_GPIO PIN_5_IS_GPIO
#endif
#define PAD_SM0_CLK 9999
#ifndef PAD_SM0_CLK_IS_GPIO
#define PAD_SM0_CLK_IS_GPIO 0
#endif
#define PIN_6 PAD_SM1_VCC
#define PAD_SM1_VCC 35
#define GPIO_PAD_35 GPIO34
#ifndef PIN_6_IS_GPIO
#define PIN_6_IS_GPIO 0
#endif
#ifndef PAD_SM1_VCC_IS_GPIO
#define PAD_SM1_VCC_IS_GPIO PIN_6_IS_GPIO
#endif
#define PAD_SM0_RST 9999
#ifndef PAD_SM0_RST_IS_GPIO
#define PAD_SM0_RST_IS_GPIO 0
#endif
#define PIN_7 PAD_SM1_GPIO0
#define PAD_SM1_GPIO0 36
#define GPIO_PAD_36 GPIO35
#ifndef PIN_7_IS_GPIO
#define PIN_7_IS_GPIO 0
#endif
#ifndef PAD_SM1_GPIO0_IS_GPIO
#define PAD_SM1_GPIO0_IS_GPIO PIN_7_IS_GPIO
#endif
#define PAD_SM0_CD 9999
#ifndef PAD_SM0_CD_IS_GPIO
#define PAD_SM0_CD_IS_GPIO 0
#endif
#define PIN_8 PAD_SM1_GPIO1
#define PAD_SM1_GPIO1 37
#define GPIO_PAD_37 GPIO36
#ifndef PIN_8_IS_GPIO
#define PIN_8_IS_GPIO 0
#endif
#ifndef PAD_SM1_GPIO1_IS_GPIO
#define PAD_SM1_GPIO1_IS_GPIO PIN_8_IS_GPIO
#endif
#define PAD_SM0_VCC 9999
#ifndef PAD_SM0_VCC_IS_GPIO
#define PAD_SM0_VCC_IS_GPIO 0
#endif
#define PAD_SM0_GPIO0 9999
#ifndef PAD_SM0_GPIO0_IS_GPIO
#define PAD_SM0_GPIO0_IS_GPIO 0
#endif
#define PIN_11 PAD_TS1_CLK
#define PAD_TS1_CLK 53
#define GPIO_PAD_53 GPIO52
#ifndef PIN_11_IS_GPIO
#define PIN_11_IS_GPIO 0
#endif
#ifndef PAD_TS1_CLK_IS_GPIO
#define PAD_TS1_CLK_IS_GPIO PIN_11_IS_GPIO
#endif
#define PAD_SM0_GPIO1 9999
#ifndef PAD_SM0_GPIO1_IS_GPIO
#define PAD_SM0_GPIO1_IS_GPIO 0
#endif
#define PIN_12 PAD_TS1_SYNC
#define PAD_TS1_SYNC 54
#define GPIO_PAD_54 GPIO53
#ifndef PIN_12_IS_GPIO
#define PIN_12_IS_GPIO 0
#endif
#ifndef PAD_TS1_SYNC_IS_GPIO
#define PAD_TS1_SYNC_IS_GPIO PIN_12_IS_GPIO
#endif
#define PAD_SM1_IO 9999
#ifndef PAD_SM1_IO_IS_GPIO
#define PAD_SM1_IO_IS_GPIO 0
#endif
#define PIN_13 PAD_TS1_VLD
#define PAD_TS1_VLD 55
#define GPIO_PAD_55 GPIO54
#ifndef PIN_13_IS_GPIO
#define PIN_13_IS_GPIO 0
#endif
#ifndef PAD_TS1_VLD_IS_GPIO
#define PAD_TS1_VLD_IS_GPIO PIN_13_IS_GPIO
#endif
#define PAD_SM1_CLK 9999
#ifndef PAD_SM1_CLK_IS_GPIO
#define PAD_SM1_CLK_IS_GPIO 0
#endif
#define PIN_14 PAD_TS1_D7
#define PAD_TS1_D7 56
#define GPIO_PAD_56 GPIO55
#ifndef PIN_14_IS_GPIO
#define PIN_14_IS_GPIO 0
#endif
#ifndef PAD_TS1_D7_IS_GPIO
#define PAD_TS1_D7_IS_GPIO PIN_14_IS_GPIO
#endif
#define PIN_15 PAD_TS1_D2
#define PAD_TS1_D2 57
#define GPIO_PAD_57 GPIO56
#ifndef PIN_15_IS_GPIO
#define PIN_15_IS_GPIO 0
#endif
#ifndef PAD_TS1_D2_IS_GPIO
#define PAD_TS1_D2_IS_GPIO PIN_15_IS_GPIO
#endif
#define PIN_18 PAD_TS1_D6
#define PAD_TS1_D6 58
#define GPIO_PAD_58 GPIO57
#ifndef PIN_18_IS_GPIO
#define PIN_18_IS_GPIO 0
#endif
#ifndef PAD_TS1_D6_IS_GPIO
#define PAD_TS1_D6_IS_GPIO PIN_18_IS_GPIO
#endif
#define PAD_TS2_CLK 9999
#ifndef PAD_TS2_CLK_IS_GPIO
#define PAD_TS2_CLK_IS_GPIO 0
#endif
#define PIN_19 PAD_TS1_D5
#define PAD_TS1_D5 59
#define GPIO_PAD_59 GPIO58
#ifndef PIN_19_IS_GPIO
#define PIN_19_IS_GPIO 0
#endif
#ifndef PAD_TS1_D5_IS_GPIO
#define PAD_TS1_D5_IS_GPIO PIN_19_IS_GPIO
#endif
#define PAD_TS2_SYNC 9999
#ifndef PAD_TS2_SYNC_IS_GPIO
#define PAD_TS2_SYNC_IS_GPIO 0
#endif
#define PIN_20 PAD_TS1_D4
#define PAD_TS1_D4 60
#define GPIO_PAD_60 GPIO59
#ifndef PIN_20_IS_GPIO
#define PIN_20_IS_GPIO 0
#endif
#ifndef PAD_TS1_D4_IS_GPIO
#define PAD_TS1_D4_IS_GPIO PIN_20_IS_GPIO
#endif
#define PAD_TS2_VLD 9999
#ifndef PAD_TS2_VLD_IS_GPIO
#define PAD_TS2_VLD_IS_GPIO 0
#endif
#define PIN_21 PAD_TS1_D3
#define PAD_TS1_D3 61
#define GPIO_PAD_61 GPIO60
#ifndef PIN_21_IS_GPIO
#define PIN_21_IS_GPIO 0
#endif
#ifndef PAD_TS1_D3_IS_GPIO
#define PAD_TS1_D3_IS_GPIO PIN_21_IS_GPIO
#endif
#define PAD_TS2_D0 9999
#ifndef PAD_TS2_D0_IS_GPIO
#define PAD_TS2_D0_IS_GPIO 0
#endif
#define PIN_22 PAD_TS1_D1
#define PAD_TS1_D1 62
#define GPIO_PAD_62 GPIO61
#ifndef PIN_22_IS_GPIO
#define PIN_22_IS_GPIO 0
#endif
#ifndef PAD_TS1_D1_IS_GPIO
#define PAD_TS1_D1_IS_GPIO PIN_22_IS_GPIO
#endif
#define PAD_I2CM0_SDA 9999
#ifndef PAD_I2CM0_SDA_IS_GPIO
#define PAD_I2CM0_SDA_IS_GPIO 0
#endif
#define PIN_23 PAD_TS1_D0
#define PAD_TS1_D0 63
#define GPIO_PAD_63 GPIO62
#ifndef PIN_23_IS_GPIO
#define PIN_23_IS_GPIO 0
#endif
#ifndef PAD_TS1_D0_IS_GPIO
#define PAD_TS1_D0_IS_GPIO PIN_23_IS_GPIO
#endif
#define PAD_I2CM0_SCL 9999
#ifndef PAD_I2CM0_SCL_IS_GPIO
#define PAD_I2CM0_SCL_IS_GPIO 0
#endif
#define PIN_101 PAD_S_GPIO0
#define PAD_S_GPIO0 163
#define GPIO_PAD_163 GPIO162
#ifndef PIN_101_IS_GPIO
#define PIN_101_IS_GPIO 0
#endif
#ifndef PAD_S_GPIO0_IS_GPIO
#define PAD_S_GPIO0_IS_GPIO PIN_101_IS_GPIO
#endif
#define PIN_102 PAD_S_GPIO2
#define PAD_S_GPIO2 164
#define GPIO_PAD_164 GPIO163
#ifndef PIN_102_IS_GPIO
#define PIN_102_IS_GPIO 0
#endif
#ifndef PAD_S_GPIO2_IS_GPIO
#define PAD_S_GPIO2_IS_GPIO PIN_102_IS_GPIO
#endif
#define PIN_103 PAD_S_GPIO4
#define PAD_S_GPIO4 165
#define GPIO_PAD_165 GPIO164
#ifndef PIN_103_IS_GPIO
#define PIN_103_IS_GPIO 0
#endif
#ifndef PAD_S_GPIO4_IS_GPIO
#define PAD_S_GPIO4_IS_GPIO PIN_103_IS_GPIO
#endif
#define PIN_106 PAD_CI_A14
#define PAD_CI_A14 69
#define GPIO_PAD_69 GPIO68
#ifndef PIN_106_IS_GPIO
#define PIN_106_IS_GPIO 0
#endif
#ifndef PAD_CI_A14_IS_GPIO
#define PAD_CI_A14_IS_GPIO PIN_106_IS_GPIO
#endif
#define PAD_I2CM1_SCL 9999
#ifndef PAD_I2CM1_SCL_IS_GPIO
#define PAD_I2CM1_SCL_IS_GPIO 0
#endif
#define PIN_107 PAD_CI_A13
#define PAD_CI_A13 70
#define GPIO_PAD_70 GPIO69
#ifndef PIN_107_IS_GPIO
#define PIN_107_IS_GPIO 0
#endif
#ifndef PAD_CI_A13_IS_GPIO
#define PAD_CI_A13_IS_GPIO PIN_107_IS_GPIO
#endif
#define PAD_I2CM1_SDA 9999
#ifndef PAD_I2CM1_SDA_IS_GPIO
#define PAD_I2CM1_SDA_IS_GPIO 0
#endif
#define PIN_108 PAD_CI_A12
#define PAD_CI_A12 71
#define GPIO_PAD_71 GPIO70
#ifndef PIN_108_IS_GPIO
#define PIN_108_IS_GPIO 0
#endif
#ifndef PAD_CI_A12_IS_GPIO
#define PAD_CI_A12_IS_GPIO PIN_108_IS_GPIO
#endif
#define PIN_109 PAD_CI_A11
#define PAD_CI_A11 72
#define GPIO_PAD_72 GPIO71
#ifndef PIN_109_IS_GPIO
#define PIN_109_IS_GPIO 0
#endif
#ifndef PAD_CI_A11_IS_GPIO
#define PAD_CI_A11_IS_GPIO PIN_109_IS_GPIO
#endif
#define PIN_110 PAD_CI_A10
#define PAD_CI_A10 73
#define GPIO_PAD_73 GPIO72
#ifndef PIN_110_IS_GPIO
#define PIN_110_IS_GPIO 0
#endif
#ifndef PAD_CI_A10_IS_GPIO
#define PAD_CI_A10_IS_GPIO PIN_110_IS_GPIO
#endif
#define PAD_PF_A25 9999
#ifndef PAD_PF_A25_IS_GPIO
#define PAD_PF_A25_IS_GPIO 0
#endif
#define PIN_111 PAD_CI_A9
#define PAD_CI_A9 74
#define GPIO_PAD_74 GPIO73
#ifndef PIN_111_IS_GPIO
#define PIN_111_IS_GPIO 0
#endif
#ifndef PAD_CI_A9_IS_GPIO
#define PAD_CI_A9_IS_GPIO PIN_111_IS_GPIO
#endif
#define PAD_PF_A24 9999
#ifndef PAD_PF_A24_IS_GPIO
#define PAD_PF_A24_IS_GPIO 0
#endif
#define PIN_112 PAD_CI_A8
#define PAD_CI_A8 75
#define GPIO_PAD_75 GPIO74
#ifndef PIN_112_IS_GPIO
#define PIN_112_IS_GPIO 0
#endif
#ifndef PAD_CI_A8_IS_GPIO
#define PAD_CI_A8_IS_GPIO PIN_112_IS_GPIO
#endif
#define PAD_PF_A23 9999
#ifndef PAD_PF_A23_IS_GPIO
#define PAD_PF_A23_IS_GPIO 0
#endif
#define PIN_113 PAD_CI_A7
#define PAD_CI_A7 76
#define GPIO_PAD_76 GPIO75
#ifndef PIN_113_IS_GPIO
#define PIN_113_IS_GPIO 0
#endif
#ifndef PAD_CI_A7_IS_GPIO
#define PAD_CI_A7_IS_GPIO PIN_113_IS_GPIO
#endif
#define PAD_PF_A22 9999
#ifndef PAD_PF_A22_IS_GPIO
#define PAD_PF_A22_IS_GPIO 0
#endif
#define PIN_114 PAD_CI_A6
#define PAD_CI_A6 77
#define GPIO_PAD_77 GPIO76
#ifndef PIN_114_IS_GPIO
#define PIN_114_IS_GPIO 0
#endif
#ifndef PAD_CI_A6_IS_GPIO
#define PAD_CI_A6_IS_GPIO PIN_114_IS_GPIO
#endif
#define PAD_PF_A21 9999
#ifndef PAD_PF_A21_IS_GPIO
#define PAD_PF_A21_IS_GPIO 0
#endif
#define PIN_115 PAD_CI_A5
#define PAD_CI_A5 78
#define GPIO_PAD_78 GPIO77
#ifndef PIN_115_IS_GPIO
#define PIN_115_IS_GPIO 0
#endif
#ifndef PAD_CI_A5_IS_GPIO
#define PAD_CI_A5_IS_GPIO PIN_115_IS_GPIO
#endif
#define PAD_PF_A20 9999
#ifndef PAD_PF_A20_IS_GPIO
#define PAD_PF_A20_IS_GPIO 0
#endif
#define PIN_116 PAD_CI_A4
#define PAD_CI_A4 79
#define GPIO_PAD_79 GPIO78
#ifndef PIN_116_IS_GPIO
#define PIN_116_IS_GPIO 0
#endif
#ifndef PAD_CI_A4_IS_GPIO
#define PAD_CI_A4_IS_GPIO PIN_116_IS_GPIO
#endif
#define PAD_PF_A19 9999
#ifndef PAD_PF_A19_IS_GPIO
#define PAD_PF_A19_IS_GPIO 0
#endif
#define PIN_117 PAD_CI_A3
#define PAD_CI_A3 80
#define GPIO_PAD_80 GPIO79
#ifndef PIN_117_IS_GPIO
#define PIN_117_IS_GPIO 0
#endif
#ifndef PAD_CI_A3_IS_GPIO
#define PAD_CI_A3_IS_GPIO PIN_117_IS_GPIO
#endif
#define PAD_PF_A18 9999
#ifndef PAD_PF_A18_IS_GPIO
#define PAD_PF_A18_IS_GPIO 0
#endif
#define PIN_119 PAD_CI_A2
#define PAD_CI_A2 81
#define GPIO_PAD_81 GPIO80
#ifndef PIN_119_IS_GPIO
#define PIN_119_IS_GPIO 0
#endif
#ifndef PAD_CI_A2_IS_GPIO
#define PAD_CI_A2_IS_GPIO PIN_119_IS_GPIO
#endif
#define PAD_PF_A17 9999
#ifndef PAD_PF_A17_IS_GPIO
#define PAD_PF_A17_IS_GPIO 0
#endif
#define PIN_120 PAD_CI_A1
#define PAD_CI_A1 82
#define GPIO_PAD_82 GPIO81
#ifndef PIN_120_IS_GPIO
#define PIN_120_IS_GPIO 0
#endif
#ifndef PAD_CI_A1_IS_GPIO
#define PAD_CI_A1_IS_GPIO PIN_120_IS_GPIO
#endif
#define PAD_PF_A16 9999
#ifndef PAD_PF_A16_IS_GPIO
#define PAD_PF_A16_IS_GPIO 0
#endif
#define PIN_121 PAD_CI_A0
#define PAD_CI_A0 83
#define GPIO_PAD_83 GPIO82
#ifndef PIN_121_IS_GPIO
#define PIN_121_IS_GPIO 0
#endif
#ifndef PAD_CI_A0_IS_GPIO
#define PAD_CI_A0_IS_GPIO PIN_121_IS_GPIO
#endif
#define PAD_PF_A15 9999
#ifndef PAD_PF_A15_IS_GPIO
#define PAD_PF_A15_IS_GPIO 0
#endif
#define PIN_122 PAD_CI_D7
#define PAD_CI_D7 84
#define GPIO_PAD_84 GPIO83
#ifndef PIN_122_IS_GPIO
#define PIN_122_IS_GPIO 0
#endif
#ifndef PAD_CI_D7_IS_GPIO
#define PAD_CI_D7_IS_GPIO PIN_122_IS_GPIO
#endif
#define PAD_PF_A14 9999
#ifndef PAD_PF_A14_IS_GPIO
#define PAD_PF_A14_IS_GPIO 0
#endif
#define PIN_123 PAD_CI_D6
#define PAD_CI_D6 85
#define GPIO_PAD_85 GPIO84
#ifndef PIN_123_IS_GPIO
#define PIN_123_IS_GPIO 0
#endif
#ifndef PAD_CI_D6_IS_GPIO
#define PAD_CI_D6_IS_GPIO PIN_123_IS_GPIO
#endif
#define PAD_PF_A13 9999
#ifndef PAD_PF_A13_IS_GPIO
#define PAD_PF_A13_IS_GPIO 0
#endif
#define PIN_124 PAD_CI_D5
#define PAD_CI_D5 86
#define GPIO_PAD_86 GPIO85
#ifndef PIN_124_IS_GPIO
#define PIN_124_IS_GPIO 0
#endif
#ifndef PAD_CI_D5_IS_GPIO
#define PAD_CI_D5_IS_GPIO PIN_124_IS_GPIO
#endif
#define PAD_PF_A12 9999
#ifndef PAD_PF_A12_IS_GPIO
#define PAD_PF_A12_IS_GPIO 0
#endif
#define PIN_125 PAD_CI_D4
#define PAD_CI_D4 87
#define GPIO_PAD_87 GPIO86
#ifndef PIN_125_IS_GPIO
#define PIN_125_IS_GPIO 0
#endif
#ifndef PAD_CI_D4_IS_GPIO
#define PAD_CI_D4_IS_GPIO PIN_125_IS_GPIO
#endif
#define PAD_PF_A11 9999
#ifndef PAD_PF_A11_IS_GPIO
#define PAD_PF_A11_IS_GPIO 0
#endif
#define PIN_126 PAD_CI_D3
#define PAD_CI_D3 88
#define GPIO_PAD_88 GPIO87
#ifndef PIN_126_IS_GPIO
#define PIN_126_IS_GPIO 0
#endif
#ifndef PAD_CI_D3_IS_GPIO
#define PAD_CI_D3_IS_GPIO PIN_126_IS_GPIO
#endif
#define PAD_PF_A10 9999
#ifndef PAD_PF_A10_IS_GPIO
#define PAD_PF_A10_IS_GPIO 0
#endif
#define PIN_127 PAD_CI_D2
#define PAD_CI_D2 89
#define GPIO_PAD_89 GPIO88
#ifndef PIN_127_IS_GPIO
#define PIN_127_IS_GPIO 0
#endif
#ifndef PAD_CI_D2_IS_GPIO
#define PAD_CI_D2_IS_GPIO PIN_127_IS_GPIO
#endif
#define PAD_PF_A9 9999
#ifndef PAD_PF_A9_IS_GPIO
#define PAD_PF_A9_IS_GPIO 0
#endif
#define PIN_128 PAD_CI_D1
#define PAD_CI_D1 90
#define GPIO_PAD_90 GPIO89
#ifndef PIN_128_IS_GPIO
#define PIN_128_IS_GPIO 0
#endif
#ifndef PAD_CI_D1_IS_GPIO
#define PAD_CI_D1_IS_GPIO PIN_128_IS_GPIO
#endif
#define PAD_PF_A8 9999
#ifndef PAD_PF_A8_IS_GPIO
#define PAD_PF_A8_IS_GPIO 0
#endif
#define PIN_129 PAD_CI_D0
#define PAD_CI_D0 91
#define GPIO_PAD_91 GPIO90
#ifndef PIN_129_IS_GPIO
#define PIN_129_IS_GPIO 0
#endif
#ifndef PAD_CI_D0_IS_GPIO
#define PAD_CI_D0_IS_GPIO PIN_129_IS_GPIO
#endif
#define PAD_PF_A7 9999
#ifndef PAD_PF_A7_IS_GPIO
#define PAD_PF_A7_IS_GPIO 0
#endif
#define PIN_130 PAD_CI_IORDZ
#define PAD_CI_IORDZ 92
#define GPIO_PAD_92 GPIO91
#ifndef PIN_130_IS_GPIO
#define PIN_130_IS_GPIO 0
#endif
#ifndef PAD_CI_IORDZ_IS_GPIO
#define PAD_CI_IORDZ_IS_GPIO PIN_130_IS_GPIO
#endif
#define PAD_PF_A6 9999
#ifndef PAD_PF_A6_IS_GPIO
#define PAD_PF_A6_IS_GPIO 0
#endif
#define PIN_131 PAD_CI_IOWRZ
#define PAD_CI_IOWRZ 93
#define GPIO_PAD_93 GPIO92
#ifndef PIN_131_IS_GPIO
#define PIN_131_IS_GPIO 0
#endif
#ifndef PAD_CI_IOWRZ_IS_GPIO
#define PAD_CI_IOWRZ_IS_GPIO PIN_131_IS_GPIO
#endif
#define PAD_PF_A5 9999
#ifndef PAD_PF_A5_IS_GPIO
#define PAD_PF_A5_IS_GPIO 0
#endif
#define PIN_132 PAD_CI_OEZ
#define PAD_CI_OEZ 94
#define GPIO_PAD_94 GPIO93
#ifndef PIN_132_IS_GPIO
#define PIN_132_IS_GPIO 0
#endif
#ifndef PAD_CI_OEZ_IS_GPIO
#define PAD_CI_OEZ_IS_GPIO PIN_132_IS_GPIO
#endif
#define PAD_PF_A4 9999
#ifndef PAD_PF_A4_IS_GPIO
#define PAD_PF_A4_IS_GPIO 0
#endif
#define PIN_135 PAD_CI_WEZ
#define PAD_CI_WEZ 95
#define GPIO_PAD_95 GPIO94
#ifndef PIN_135_IS_GPIO
#define PIN_135_IS_GPIO 0
#endif
#ifndef PAD_CI_WEZ_IS_GPIO
#define PAD_CI_WEZ_IS_GPIO PIN_135_IS_GPIO
#endif
#define PAD_PF_A3 9999
#ifndef PAD_PF_A3_IS_GPIO
#define PAD_PF_A3_IS_GPIO 0
#endif
#define PIN_136 PAD_CI_REGZ
#define PAD_CI_REGZ 96
#define GPIO_PAD_96 GPIO95
#ifndef PIN_136_IS_GPIO
#define PIN_136_IS_GPIO 0
#endif
#ifndef PAD_CI_REGZ_IS_GPIO
#define PAD_CI_REGZ_IS_GPIO PIN_136_IS_GPIO
#endif
#define PAD_PF_A2 9999
#ifndef PAD_PF_A2_IS_GPIO
#define PAD_PF_A2_IS_GPIO 0
#endif
#define PIN_137 PAD_CI_CEZ
#define PAD_CI_CEZ 97
#define GPIO_PAD_97 GPIO96
#ifndef PIN_137_IS_GPIO
#define PIN_137_IS_GPIO 0
#endif
#ifndef PAD_CI_CEZ_IS_GPIO
#define PAD_CI_CEZ_IS_GPIO PIN_137_IS_GPIO
#endif
#define PAD_PF_A1 9999
#ifndef PAD_PF_A1_IS_GPIO
#define PAD_PF_A1_IS_GPIO 0
#endif
#define PIN_138 PAD_CI_IRQAZ
#define PAD_CI_IRQAZ 98
#define GPIO_PAD_98 GPIO97
#ifndef PIN_138_IS_GPIO
#define PIN_138_IS_GPIO 0
#endif
#ifndef PAD_CI_IRQAZ_IS_GPIO
#define PAD_CI_IRQAZ_IS_GPIO PIN_138_IS_GPIO
#endif
#define PAD_PF_A0 9999
#ifndef PAD_PF_A0_IS_GPIO
#define PAD_PF_A0_IS_GPIO 0
#endif
#define PAD_CI_WAITZ 9999
#ifndef PAD_CI_WAITZ_IS_GPIO
#define PAD_CI_WAITZ_IS_GPIO 0
#endif
#define PAD_PF_CE0Z 9999
#ifndef PAD_PF_CE0Z_IS_GPIO
#define PAD_PF_CE0Z_IS_GPIO 0
#endif
#define PAD_CI_RST 9999
#ifndef PAD_CI_RST_IS_GPIO
#define PAD_CI_RST_IS_GPIO 0
#endif
#define PAD_PF_OEZ 9999
#ifndef PAD_PF_OEZ_IS_GPIO
#define PAD_PF_OEZ_IS_GPIO 0
#endif
#define PAD_CI_CDZ 9999
#ifndef PAD_CI_CDZ_IS_GPIO
#define PAD_CI_CDZ_IS_GPIO 0
#endif
#define PAD_PF_WEZ 9999
#ifndef PAD_PF_WEZ_IS_GPIO
#define PAD_PF_WEZ_IS_GPIO 0
#endif
#define PIN_139 PAD_DM_GPIO0
#define PAD_DM_GPIO0 161
#define GPIO_PAD_161 GPIO160
#ifndef PIN_139_IS_GPIO
#define PIN_139_IS_GPIO 0
#endif
#ifndef PAD_DM_GPIO0_IS_GPIO
#define PAD_DM_GPIO0_IS_GPIO PIN_139_IS_GPIO
#endif
#define PAD_DM_GPIO1 9999
#ifndef PAD_DM_GPIO1_IS_GPIO
#define PAD_DM_GPIO1_IS_GPIO 0
#endif
#define PIN_141 PAD_TS0_CLK
#define PAD_TS0_CLK 42
#define GPIO_PAD_42 GPIO41
#ifndef PIN_141_IS_GPIO
#define PIN_141_IS_GPIO 0
#endif
#ifndef PAD_TS0_CLK_IS_GPIO
#define PAD_TS0_CLK_IS_GPIO PIN_141_IS_GPIO
#endif
#define PAD_TS0_SYNC 9999
#ifndef PAD_TS0_SYNC_IS_GPIO
#define PAD_TS0_SYNC_IS_GPIO 0
#endif
#define PAD_TS0_VLD 9999
#ifndef PAD_TS0_VLD_IS_GPIO
#define PAD_TS0_VLD_IS_GPIO 0
#endif
#define PIN_142 PAD_TS0_D7
#define PAD_TS0_D7 45
#define GPIO_PAD_45 GPIO44
#ifndef PIN_142_IS_GPIO
#define PIN_142_IS_GPIO 0
#endif
#ifndef PAD_TS0_D7_IS_GPIO
#define PAD_TS0_D7_IS_GPIO PIN_142_IS_GPIO
#endif
#define PIN_143 PAD_TS0_D6
#define PAD_TS0_D6 46
#define GPIO_PAD_46 GPIO45
#ifndef PIN_143_IS_GPIO
#define PIN_143_IS_GPIO 0
#endif
#ifndef PAD_TS0_D6_IS_GPIO
#define PAD_TS0_D6_IS_GPIO PIN_143_IS_GPIO
#endif
#define PIN_144 PAD_TS0_D5
#define PAD_TS0_D5 47
#define GPIO_PAD_47 GPIO46
#ifndef PIN_144_IS_GPIO
#define PIN_144_IS_GPIO 0
#endif
#ifndef PAD_TS0_D5_IS_GPIO
#define PAD_TS0_D5_IS_GPIO PIN_144_IS_GPIO
#endif
#define PIN_145 PAD_TS0_D4
#define PAD_TS0_D4 48
#define GPIO_PAD_48 GPIO47
#ifndef PIN_145_IS_GPIO
#define PIN_145_IS_GPIO 0
#endif
#ifndef PAD_TS0_D4_IS_GPIO
#define PAD_TS0_D4_IS_GPIO PIN_145_IS_GPIO
#endif
#define PIN_146 PAD_TS0_D3
#define PAD_TS0_D3 49
#define GPIO_PAD_49 GPIO48
#ifndef PIN_146_IS_GPIO
#define PIN_146_IS_GPIO 0
#endif
#ifndef PAD_TS0_D3_IS_GPIO
#define PAD_TS0_D3_IS_GPIO PIN_146_IS_GPIO
#endif
#define PIN_147 PAD_TS0_D2
#define PAD_TS0_D2 50
#define GPIO_PAD_50 GPIO49
#ifndef PIN_147_IS_GPIO
#define PIN_147_IS_GPIO 0
#endif
#ifndef PAD_TS0_D2_IS_GPIO
#define PAD_TS0_D2_IS_GPIO PIN_147_IS_GPIO
#endif
#define PIN_148 PAD_TS0_D1
#define PAD_TS0_D1 51
#define GPIO_PAD_51 GPIO50
#ifndef PIN_148_IS_GPIO
#define PIN_148_IS_GPIO 0
#endif
#ifndef PAD_TS0_D1_IS_GPIO
#define PAD_TS0_D1_IS_GPIO PIN_148_IS_GPIO
#endif
#define PIN_149 PAD_TS0_D0
#define PAD_TS0_D0 52
#define GPIO_PAD_52 GPIO51
#ifndef PIN_149_IS_GPIO
#define PIN_149_IS_GPIO 0
#endif
#ifndef PAD_TS0_D0_IS_GPIO
#define PAD_TS0_D0_IS_GPIO PIN_149_IS_GPIO
#endif
#define PAD_RF_AGC 9999
#ifndef PAD_RF_AGC_IS_GPIO
#define PAD_RF_AGC_IS_GPIO 0
#endif
#define PAD_IF_AGC 9999
#ifndef PAD_IF_AGC_IS_GPIO
#define PAD_IF_AGC_IS_GPIO 0
#endif
#define PIN_155 PAD_SAR0
#define PAD_SAR0 20
#define GPIO_PAD_20 GPIO19
#ifndef PIN_155_IS_GPIO
#define PIN_155_IS_GPIO 0
#endif
#ifndef PAD_SAR0_IS_GPIO
#define PAD_SAR0_IS_GPIO PIN_155_IS_GPIO
#endif
#define PIN_156 PAD_SAR1
#define PAD_SAR1 21
#define GPIO_PAD_21 GPIO20
#ifndef PIN_156_IS_GPIO
#define PIN_156_IS_GPIO 0
#endif
#ifndef PAD_SAR1_IS_GPIO
#define PAD_SAR1_IS_GPIO PIN_156_IS_GPIO
#endif
#define PAD_SAR2 9999
#ifndef PAD_SAR2_IS_GPIO
#define PAD_SAR2_IS_GPIO 0
#endif
#define PAD_SAR3 9999
#ifndef PAD_SAR3_IS_GPIO
#define PAD_SAR3_IS_GPIO 0
#endif
#define PIN_159 PAD_PM_SPI_CK
#define PAD_PM_SPI_CK 2
#define GPIO_PAD_2 GPIO1
#ifndef PIN_159_IS_GPIO
#define PIN_159_IS_GPIO 0
#endif
#ifndef PAD_PM_SPI_CK_IS_GPIO
#define PAD_PM_SPI_CK_IS_GPIO PIN_159_IS_GPIO
#endif
#define PIN_160 PAD_PM_SPI_DI
#define PAD_PM_SPI_DI 3
#define GPIO_PAD_3 GPIO2
#ifndef PIN_160_IS_GPIO
#define PIN_160_IS_GPIO 0
#endif
#ifndef PAD_PM_SPI_DI_IS_GPIO
#define PAD_PM_SPI_DI_IS_GPIO PIN_160_IS_GPIO
#endif
#define PIN_161 PAD_PM_SPI_DO
#define PAD_PM_SPI_DO 4
#define GPIO_PAD_4 GPIO3
#ifndef PIN_161_IS_GPIO
#define PIN_161_IS_GPIO 0
#endif
#ifndef PAD_PM_SPI_DO_IS_GPIO
#define PAD_PM_SPI_DO_IS_GPIO PIN_161_IS_GPIO
#endif
#define PIN_162 PAD_PM_SPI_CZ
#define PAD_PM_SPI_CZ 1
#define GPIO_PAD_1 GPIO0
#ifndef PIN_162_IS_GPIO
#define PIN_162_IS_GPIO 0
#endif
#ifndef PAD_PM_SPI_CZ_IS_GPIO
#define PAD_PM_SPI_CZ_IS_GPIO PIN_162_IS_GPIO
#endif
#define PAD_GPIO_PM0 9999
#ifndef PAD_GPIO_PM0_IS_GPIO
#define PAD_GPIO_PM0_IS_GPIO 0
#endif
#define PAD_GPIO_PM1 9999
#ifndef PAD_GPIO_PM1_IS_GPIO
#define PAD_GPIO_PM1_IS_GPIO 0
#endif
#define PIN_165 PAD_GPIO_PM4
#define PAD_GPIO_PM4 11
#define GPIO_PAD_11 GPIO10
#ifndef PIN_165_IS_GPIO
#define PIN_165_IS_GPIO 0
#endif
#ifndef PAD_GPIO_PM4_IS_GPIO
#define PAD_GPIO_PM4_IS_GPIO PIN_165_IS_GPIO
#endif
#define PAD_GPIO_PM2 9999
#ifndef PAD_GPIO_PM2_IS_GPIO
#define PAD_GPIO_PM2_IS_GPIO 0
#endif
#define PAD_GPIO_PM5 9999
#ifndef PAD_GPIO_PM5_IS_GPIO
#define PAD_GPIO_PM5_IS_GPIO 0
#endif
#define PAD_GPIO_PM3 9999
#ifndef PAD_GPIO_PM3_IS_GPIO
#define PAD_GPIO_PM3_IS_GPIO 0
#endif
#define PIN_166 PAD_GPIO_PM6
#define PAD_GPIO_PM6 13
#define GPIO_PAD_13 GPIO12
#ifndef PIN_166_IS_GPIO
#define PIN_166_IS_GPIO 0
#endif
#ifndef PAD_GPIO_PM6_IS_GPIO
#define PAD_GPIO_PM6_IS_GPIO PIN_166_IS_GPIO
#endif
#define PAD_GPIO_PM7 9999
#ifndef PAD_GPIO_PM7_IS_GPIO
#define PAD_GPIO_PM7_IS_GPIO 0
#endif
#define PIN_167 PAD_IRIN
#define PAD_IRIN 5
#define GPIO_PAD_5 GPIO4
#ifndef PIN_167_IS_GPIO
#define PIN_167_IS_GPIO 0
#endif
#ifndef PAD_IRIN_IS_GPIO
#define PAD_IRIN_IS_GPIO PIN_167_IS_GPIO
#endif
#define PAD_GPIO_PM8 9999
#ifndef PAD_GPIO_PM8_IS_GPIO
#define PAD_GPIO_PM8_IS_GPIO 0
#endif
#define PIN_168 PAD_CEC
#define PAD_CEC 6
#define GPIO_PAD_6 GPIO5
#ifndef PIN_168_IS_GPIO
#define PIN_168_IS_GPIO 0
#endif
#ifndef PAD_CEC_IS_GPIO
#define PAD_CEC_IS_GPIO PIN_168_IS_GPIO
#endif
#define PAD_GPIO_PM9 9999
#ifndef PAD_GPIO_PM9_IS_GPIO
#define PAD_GPIO_PM9_IS_GPIO 0
#endif
#define PAD_GPIO_PM10 9999
#ifndef PAD_GPIO_PM10_IS_GPIO
#define PAD_GPIO_PM10_IS_GPIO 0
#endif
#define PIN_170 PAD_GPIO_PM11
#define PAD_GPIO_PM11 18
#define GPIO_PAD_18 GPIO17
#ifndef PIN_170_IS_GPIO
#define PIN_170_IS_GPIO 0
#endif
#ifndef PAD_GPIO_PM11_IS_GPIO
#define PAD_GPIO_PM11_IS_GPIO PIN_170_IS_GPIO
#endif
#define PAD_GPIO_PM12 9999
#ifndef PAD_GPIO_PM12_IS_GPIO
#define PAD_GPIO_PM12_IS_GPIO 0
#endif
#define PAD_NF_CEZ 9999
#ifndef PAD_NF_CEZ_IS_GPIO
#define PAD_NF_CEZ_IS_GPIO 0
#endif
#define PAD_I2S_OUT_SD1 9999
#ifndef PAD_I2S_OUT_SD1_IS_GPIO
#define PAD_I2S_OUT_SD1_IS_GPIO 0
#endif
#define PIN_173 PAD_SPDIF_OUT
#define PAD_SPDIF_OUT 151
#define GPIO_PAD_151 GPIO150
#ifndef PIN_173_IS_GPIO
#define PIN_173_IS_GPIO 0
#endif
#ifndef PAD_SPDIF_OUT_IS_GPIO
#define PAD_SPDIF_OUT_IS_GPIO PIN_173_IS_GPIO
#endif
#define PAD_I2S_OUT_SD2 9999
#ifndef PAD_I2S_OUT_SD2_IS_GPIO
#define PAD_I2S_OUT_SD2_IS_GPIO 0
#endif
#define PIN_174 PAD_I2S_OUT_SD0
#define PAD_I2S_OUT_SD0 157
#define GPIO_PAD_157 GPIO156
#ifndef PIN_174_IS_GPIO
#define PIN_174_IS_GPIO 0
#endif
#ifndef PAD_I2S_OUT_SD0_IS_GPIO
#define PAD_I2S_OUT_SD0_IS_GPIO PIN_174_IS_GPIO
#endif
#define PAD_I2S_OUT_SD3 9999
#ifndef PAD_I2S_OUT_SD3_IS_GPIO
#define PAD_I2S_OUT_SD3_IS_GPIO 0
#endif
#define PIN_175 PAD_I2S_OUT_WS
#define PAD_I2S_OUT_WS 155
#define GPIO_PAD_155 GPIO154
#ifndef PIN_175_IS_GPIO
#define PIN_175_IS_GPIO 0
#endif
#ifndef PAD_I2S_OUT_WS_IS_GPIO
#define PAD_I2S_OUT_WS_IS_GPIO PIN_175_IS_GPIO
#endif
#define PAD_I2S_OUT_MCK 9999
#ifndef PAD_I2S_OUT_MCK_IS_GPIO
#define PAD_I2S_OUT_MCK_IS_GPIO 0
#endif
#define PIN_176 PAD_I2S_OUT_BCK
#define PAD_I2S_OUT_BCK 156
#define GPIO_PAD_156 GPIO155
#ifndef PIN_176_IS_GPIO
#define PIN_176_IS_GPIO 0
#endif
#ifndef PAD_I2S_OUT_BCK_IS_GPIO
#define PAD_I2S_OUT_BCK_IS_GPIO PIN_176_IS_GPIO
#endif
#define PIN_177 PAD_ET_COL
#define PAD_ET_COL 134
#define GPIO_PAD_134 GPIO133
#ifndef PIN_177_IS_GPIO
#define PIN_177_IS_GPIO 0
#endif
#ifndef PAD_ET_COL_IS_GPIO
#define PAD_ET_COL_IS_GPIO PIN_177_IS_GPIO
#endif
#define PAD_ET_CRS 9999
#ifndef PAD_ET_CRS_IS_GPIO
#define PAD_ET_CRS_IS_GPIO 0
#endif
#define PIN_178 PAD_ET_TXD1
#define PAD_ET_TXD1 137
#define GPIO_PAD_137 GPIO136
#ifndef PIN_178_IS_GPIO
#define PIN_178_IS_GPIO 0
#endif
#ifndef PAD_ET_TXD1_IS_GPIO
#define PAD_ET_TXD1_IS_GPIO PIN_178_IS_GPIO
#endif
#define PAD_ET_TXD3 9999
#ifndef PAD_ET_TXD3_IS_GPIO
#define PAD_ET_TXD3_IS_GPIO 0
#endif
#define PIN_179 PAD_ET_TXD0
#define PAD_ET_TXD0 138
#define GPIO_PAD_138 GPIO137
#ifndef PIN_179_IS_GPIO
#define PIN_179_IS_GPIO 0
#endif
#ifndef PAD_ET_TXD0_IS_GPIO
#define PAD_ET_TXD0_IS_GPIO PIN_179_IS_GPIO
#endif
#define PAD_ET_TXD2 9999
#ifndef PAD_ET_TXD2_IS_GPIO
#define PAD_ET_TXD2_IS_GPIO 0
#endif
#define PIN_180 PAD_ET_TX_EN
#define PAD_ET_TX_EN 139
#define GPIO_PAD_139 GPIO138
#ifndef PIN_180_IS_GPIO
#define PIN_180_IS_GPIO 0
#endif
#ifndef PAD_ET_TX_EN_IS_GPIO
#define PAD_ET_TX_EN_IS_GPIO PIN_180_IS_GPIO
#endif
#define PAD_ET_TXER 9999
#ifndef PAD_ET_TXER_IS_GPIO
#define PAD_ET_TXER_IS_GPIO 0
#endif
#define PIN_181 PAD_ET_TX_CLK
#define PAD_ET_TX_CLK 140
#define GPIO_PAD_140 GPIO139
#ifndef PIN_181_IS_GPIO
#define PIN_181_IS_GPIO 0
#endif
#ifndef PAD_ET_TX_CLK_IS_GPIO
#define PAD_ET_TX_CLK_IS_GPIO PIN_181_IS_GPIO
#endif
#define PAD_ET_RXER 9999
#ifndef PAD_ET_RXER_IS_GPIO
#define PAD_ET_RXER_IS_GPIO 0
#endif
#define PIN_182 PAD_ET_RXD0
#define PAD_ET_RXD0 145
#define GPIO_PAD_145 GPIO144
#ifndef PIN_182_IS_GPIO
#define PIN_182_IS_GPIO 0
#endif
#ifndef PAD_ET_RXD0_IS_GPIO
#define PAD_ET_RXD0_IS_GPIO PIN_182_IS_GPIO
#endif
#define PAD_ET_RX_CLK 9999
#ifndef PAD_ET_RX_CLK_IS_GPIO
#define PAD_ET_RX_CLK_IS_GPIO 0
#endif
#define PIN_183 PAD_ET_RXD1
#define PAD_ET_RXD1 146
#define GPIO_PAD_146 GPIO145
#ifndef PIN_183_IS_GPIO
#define PIN_183_IS_GPIO 0
#endif
#ifndef PAD_ET_RXD1_IS_GPIO
#define PAD_ET_RXD1_IS_GPIO PIN_183_IS_GPIO
#endif
#define PAD_ET_RX_DV 9999
#ifndef PAD_ET_RX_DV_IS_GPIO
#define PAD_ET_RX_DV_IS_GPIO 0
#endif
#define PIN_184 PAD_ET_MDC
#define PAD_ET_MDC 149
#define GPIO_PAD_149 GPIO148
#ifndef PIN_184_IS_GPIO
#define PIN_184_IS_GPIO 0
#endif
#ifndef PAD_ET_MDC_IS_GPIO
#define PAD_ET_MDC_IS_GPIO PIN_184_IS_GPIO
#endif
#define PAD_ET_RXD2 9999
#ifndef PAD_ET_RXD2_IS_GPIO
#define PAD_ET_RXD2_IS_GPIO 0
#endif
#define PIN_185 PAD_ET_MDIO
#define PAD_ET_MDIO 150
#define GPIO_PAD_150 GPIO149
#ifndef PIN_185_IS_GPIO
#define PIN_185_IS_GPIO 0
#endif
#ifndef PAD_ET_MDIO_IS_GPIO
#define PAD_ET_MDIO_IS_GPIO PIN_185_IS_GPIO
#endif
#define PAD_ET_RXD3 9999
#ifndef PAD_ET_RXD3_IS_GPIO
#define PAD_ET_RXD3_IS_GPIO 0
#endif
// chip capbilities
#define CHIP_HAS_BT656_IN 0
#define CHIP_HAS_TS0 1
#define CHIP_HAS_TS1 0
#define CHIP_HAS_LVDS_10BIT_X2 1
#define CHIP_HAS_LVDS_8BIT_X2 1
#define CHIP_HAS_LVDS_8BIT_X1 1
#define CHIP_HAS_CIMAX 0
#define CHIP_HAS_USB_P0 1
#define CHIP_HAS_USB_P1 1
#define CHIP_HAS_USBVBUS0 0
#define CHIP_HAS_USBVBUS1 0
#define CHIP_HAS_UART1_MODE1 1
#define CHIP_HAS_UART1_MODE2 1
#define CHIP_HAS_UART1_MODE3 1
#define CHIP_HAS_PCMCIA1 0
#define CHIP_HAS_PCMCIA2 0
#define CHIP_HAS_PCMCIA 0
#define CHIP_HAS_UART2_MODE1 1
#define CHIP_HAS_UART2_MODE2 1
#define CHIP_HAS_UART2_MODE3 1
#define CHIP_HAS_RGB_A 1
#define CHIP_HAS_RGB_B 1
#define CHIP_HAS_RGB_C 1
#define CHIP_HAS_HDMI_A 1
#define CHIP_HAS_HDMI_B 1
#define CHIP_HAS_HDMI_C 1
#define CHIP_HAS_SPI_CZ1 1
#define CHIP_HAS_SPI_CZ2 0
#define CHIP_HAS_SPI_CZ3 0
#define CHIP_HAS_DDCR 1
#define CHIP_HAS_DDCR2 1
#define CHIP_HAS_TCON 1
#define CHIP_HAS_ET_MODE0_MII 1
#define CHIP_HAS_ET_MODE0_RMII 1
#define CHIP_HAS_ET_MODE1_MII 1
#define CHIP_HAS_ET_MODE1_RMII 1
#define CHIP_HAS_ET_MODE2_MII 1
#define CHIP_HAS_ET_MODE2_RMII 1
#define CHIP_HAS_I2S_IN 1
#define CHIP_HAS_I2S_OUT 1
#define CHIP_HAS_SPDIF_IN 0
#define CHIP_HAS_SPDIF_OUT 1
#define CHIP_HAS_DDR_A_CMD 1
#define CHIP_HAS_DDR_A_DATA 1
#define CHIP_HAS_DDR_B_CMD 1
#define CHIP_HAS_DDR_B_DATA 1
#define CHIP_USE_PCM_CDN_IN_PCM2 0
#define CHIP_USE_I2S_IN_IN_PCM 0
#define CHIP_USE_I2S_OUT_IN_PCM 0
#define CHIP_USE_SPDIF_IN_IN_PCM 0
#define CHIP_USE_SPDIF_OUT_IN_PCM 0
#define CHIP_USE_IIC_IN_DDCR2 0
#define CHIP_USE_PWM2_IN_GPIO14 0
#define CHIP_USE_PWM3_IN_GPIO15 0
// chip additional information
#define CHIP_FAMILY_TYPE CHIP_FAMILY_U4
#endif /* _MSD5040S_H_*/
|
67a8cb1db586155cb5b6ce82fa96a3dd09e8dd7e
|
3567309d3f25020ec7a0d59e0ef55da7be113085
|
/std/souls/_thank.c
|
003ed3e9dc71d2639e3f2863b8d6bf6ad4e90781
|
[] |
no_license
|
flyingstupid/gbapoclib
|
64ec8b3828201d7eb158b5371164765d1b65ce93
|
dea2a4be3399509c7df44d33b2a307db3821017d
|
refs/heads/master
| 2021-04-27T08:02:48.717277 | 2018-02-23T17:04:11 | 2018-02-23T17:04:11 | 122,640,255 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 261 |
c
|
_thank.c
|
#include <mudlib.h>
inherit SOUL_I;
void reset(status arg) {
if (arg) return;
set_default_adverb("politely");
set_origin_view("You thank $[$t|everyone$] $a.");
set_target_view("$e thanks you $a.");
set_other_view("$e thanks $[$t|everyone$] $a.");
}
|
f2319ad99fcda05f99262142ca8dbb1571e36bf5
|
7c1796239eebe58760a480e0886bff340da294a4
|
/final slave/GccApplication1/GccApplication1/LCD.c
|
0508ef747ed86bae81e275ab2009bddaadda3647
|
[] |
no_license
|
MahmoudAhmed2/final-project
|
ad30641ce79715dffe4af9efe77de90024270041
|
d27f61c2a0957870cc18042e11c2a3c4f306f796
|
refs/heads/main
| 2023-01-30T16:29:10.975278 | 2020-12-18T06:46:38 | 2020-12-18T06:46:38 | 322,386,199 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,403 |
c
|
LCD.c
|
/*
* LCD.c
*
* Created: 11/12/2020 8:40:43 PM
* Author: Mahmoud
*/
#include <math.h>
#define F_CPU 16000000UL
#include <util/delay.h>
#include "DIO.h"
#include "STD.h"
#include "reg.h"
#include "spi.h"
//#include "keypad.h"
#include "LCD.h"
#include "INTERRUPT.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#define RS 1
#define RW 2
#define EN 3
void SEND_FALLING_EDGE(void){
SIT_BIT(PORTB,EN);
_delay_ms(5);
CLR_BIT(PORTB,EN);
_delay_ms(5);
}
void SEND_CMD(uint8 cmd){
PORTA&=0x0f;
PORTA|=(cmd&0xf0);//send last 4 digits
CLR_BIT(PORTB,RS);
SEND_FALLING_EDGE();
PORTA&=0x0f;
PORTA|=(cmd<<4);//send first 4 digits
CLR_BIT(PORTB,RS);
SEND_FALLING_EDGE();
}
void SEND_DATA(uint8 cmd){
PORTA&=0x0f;
PORTA|=(cmd&0xf0);//send last 4 digits
SIT_BIT(PORTB,RS);
SEND_FALLING_EDGE();
PORTA&=0x0f;
PORTA|=(cmd<<4);//send first 4 digits
SIT_BIT(PORTB,RS);
SEND_FALLING_EDGE();
}
void LCD_INITIALIZE(void){
DDRB|=0x0E;
DDRA|=0xf0;
CLR_BIT(PORTB,RW);
SEND_CMD(0x33);
SEND_CMD(0x32);
SEND_CMD(0x28);
SEND_CMD(0x01);
SEND_CMD(0x0f);
_delay_ms(20);
}
void MOVING_CURSOR(uint8 row ,uint8 col){
uint8 temp;
if(row==0){
temp=0x80+col;
}
else{
temp=0xc0+col;
}
SEND_CMD(temp);
}
void LCD_PRINT(char *cmd){
for(int i=0;i<16;i++)
{
if(cmd[i]=='\0'){
break;
}
SEND_DATA(cmd[i]);
}
}
|
70f1294ebc852d76453d3b93f5b106e228889e93
|
15df06ef8bc91dfac61e9e56eff3ace20daded0b
|
/DES/src/main_DES.c
|
f66be6e4013ec2249953721f9dfe103fa2a1b078
|
[
"Apache-2.0"
] |
permissive
|
leoperez02/Garbanzo_Resistivo
|
f62356a21c84794be1f5817cc5850b6255b42f5f
|
67f641aeb9f0503065df92df61e34083d2fbf94e
|
refs/heads/master
| 2020-03-28T09:53:54.607489 | 2018-09-09T22:00:35 | 2018-09-09T22:00:35 | 148,067,908 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 773 |
c
|
main_DES.c
|
#include"DES.h"
#include<stdio.h>
#include<string.h>
/* DES (DATA ENCRYPTION STANDARD) */
int main(int argc,char* argv[])
{
/* argv[1] = C/D (cifrar/descifrar) */
if(argc==2)
{
int i;
b64 texto,clave;
b48* K;
printf("Texto plano: ");
scanf("%lx",&texto);
fflush(stdin);
printf("Clave: ");
scanf("%lx",&clave);
fflush(stdin);
/* Calcula subclaves */
K=calcula_subclaves(clave);
/* Imprimir claves */
printf("\nSubllaves k1 ... k16\n");
for(i=0;i<16;i++)
printf("k%d = %lx\n",i+1,K[i]);
if(!strcmp(argv[1],"C"))
texto=DES(texto,K,CIFRA);
else
texto=DES(texto,K,DESCIFRA);
printf("\n\nTexto: %lx\n",texto);
free(K);
return 0;
}
else
{
printf("\nArgumentos incompletos. Programa finalizado...\n");
return 1;
}
}
|
6f7475872113b24dece45f72b7f70c3fb6c6f53a
|
f989a482a3cfbe7597a925fc1392ec9c03ce66b2
|
/project-essentials/doxygen/src/null.h
|
5646a5eafa3a492ce0593aaee84c1a069f607f5e
|
[] |
no_license
|
Rohan-Kadam/random-stuff
|
e81a2de6112a126bd88a63536f91cb59193f2bd1
|
e95366a1203d1d6aa1f68d4ae81e48b62c0308aa
|
refs/heads/master
| 2021-06-08T22:13:47.458115 | 2021-05-14T18:05:51 | 2021-05-14T18:05:51 | 165,479,689 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 131 |
h
|
null.h
|
/**
* @file null.h
* @author Rohan-Kadam
* @date March 7, 2019
* @brief This is dynamic library
*
**/
void null_func(void);
|
3b0fa3f51a30694fbc9d2d9f5514706fb47d0b0a
|
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
|
/source/TDengine/src/util/src/extr_ttimer.c_doStopTimer.c
|
15d62062960365d4f6fa91a3ae00f3fc90943ce8
|
[] |
no_license
|
isabella232/AnghaBench
|
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
|
9a5f60cdc907a0475090eef45e5be43392c25132
|
refs/heads/master
| 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 2,684 |
c
|
extr_ttimer.c_doStopTimer.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ uint8_t ;
struct TYPE_6__ {scalar_t__ executedBy; int /*<<< orphan*/ param; int /*<<< orphan*/ fp; int /*<<< orphan*/ id; TYPE_1__* ctrl; int /*<<< orphan*/ state; } ;
typedef TYPE_2__ tmr_obj_t ;
struct TYPE_5__ {int /*<<< orphan*/ label; } ;
/* Variables and functions */
scalar_t__ TIMER_STATE_EXPIRED ;
scalar_t__ TIMER_STATE_STOPPED ;
scalar_t__ TIMER_STATE_WAITING ;
int /*<<< orphan*/ assert (int) ;
scalar_t__ atomic_load_8 (int /*<<< orphan*/ *) ;
scalar_t__ removeFromWheel (TYPE_2__*) ;
int /*<<< orphan*/ removeTimer (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sched_yield () ;
scalar_t__ taosGetPthreadId () ;
int /*<<< orphan*/ tmrTrace (char const*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static bool doStopTimer(tmr_obj_t* timer, uint8_t state) {
bool reusable = false;
if (state == TIMER_STATE_WAITING) {
if (removeFromWheel(timer)) {
removeTimer(timer->id);
// only safe to reuse the timer when timer is removed from the wheel.
// we cannot guarantee the thread safety of the timr in all other cases.
reusable = true;
}
const char* fmt = "%s timer[id=%lld, fp=%p, param=%p] is cancelled.";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
} else if (state != TIMER_STATE_EXPIRED) {
// timer already stopped or cancelled, has nothing to do in this case
} else if (timer->executedBy == taosGetPthreadId()) {
// taosTmrReset is called in the timer callback, should do nothing in this
// case to avoid dead lock. note taosTmrReset must be the last statement
// of the callback funtion, will be a bug otherwise.
} else {
assert(timer->executedBy != taosGetPthreadId());
const char* fmt = "%s timer[id=%lld, fp=%p, param=%p] fired, waiting...";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
for (int i = 1; atomic_load_8(&timer->state) != TIMER_STATE_STOPPED; i++) {
if (i % 1000 == 0) {
sched_yield();
}
}
fmt = "%s timer[id=%lld, fp=%p, param=%p] stopped.";
tmrTrace(fmt, timer->ctrl->label, timer->id, timer->fp, timer->param);
}
return reusable;
}
|
1a852892064ea4a14150abf1dede2c4d6801a84f
|
a23473af09b888cec4ba85c4991877b9ff9c6157
|
/Algorithms/Implementation/Sherlock and Squares.c
|
3a082454a611a28e156b16f22f81a63241963599
|
[] |
no_license
|
ujjwal123123/HackerRank
|
e098414977e3b5c22b03cd62da2b57ee9bd3b698
|
fb2eadf155858631188c71e1ef01383f924d1fd0
|
refs/heads/master
| 2022-12-13T18:29:31.809731 | 2020-01-08T18:01:24 | 2020-01-08T18:01:24 | 232,550,018 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 418 |
c
|
Sherlock and Squares.c
|
#include <math.h>
#include <stdio.h>
int solve()
{
long long int start, end;
scanf(" %lld %lld", &start, &end);
long long int ans = 0;
long long int sqrt = ceil(sqrtf((float)start));
while (sqrt * sqrt <= end) {
ans++;
sqrt++;
}
printf("%lld\n", ans);
return 0;
}
int main()
{
int times;
scanf(" %d", ×);
while (times--) {
solve();
}
}
|
67eeff73652b84202ae463d30b2053dc47e08010
|
b4b673ec5d9abea48985008d207318c77032b77e
|
/src/ft_lstmap.c
|
27f0c57e5092d188140767dfd08c7180196807e4
|
[] |
no_license
|
psdiaspedro/libft-42Cursus
|
337588e3c45bee42548c1041a0ca2f866d8258e1
|
daf82559b484e95f8ef2cdef0ea3b9145dd4884b
|
refs/heads/main
| 2023-07-14T23:58:16.996084 | 2021-09-01T00:23:11 | 2021-09-01T00:23:11 | 393,788,016 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,258 |
c
|
ft_lstmap.c
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstmap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: paugusto <paugusto@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/10 10:12:16 by paugusto #+# #+# */
/* Updated: 2021/08/31 20:41:54 by paugusto ### ########.fr */
/* */
/* ************************************************************************** */
#include "../include/libft.h"
t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *))
{
t_list *new;
t_list *item;
if (!lst)
return (0);
new = NULL;
while (lst != NULL)
{
item = ft_lstnew(f(lst->content));
if (!item)
{
ft_lstclear(&new, del);
return (0);
}
ft_lstadd_back(&new, item);
lst = lst->next;
}
return (new);
}
|
325cc3e62ae5e7683a170fe24d0f8743072b19a4
|
13fcd28a47095474064811f3155d923d6ea3e8ad
|
/dmx/src/timer1.c
|
7038a173d854b8af7f077a2e89e27a120b957995
|
[] |
no_license
|
reubenrl/GitReubenWorkspace
|
bef0aa48da79ffb833165259be66e2df2a40351d
|
2f2a06b159844de610f8f9feed43cb676483318e
|
refs/heads/master
| 2021-03-16T09:13:13.872274 | 2018-01-01T07:04:26 | 2018-01-01T07:04:26 | 115,904,549 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,750 |
c
|
timer1.c
|
/*
* timer1.c
*
* Created on: Nov 29, 2014
* Author: reuben
*/
#include "mb90540.h"
#include "eclipse_cpu.h"
#include "timer1.h"
volatile static unsigned int usec_delay;
volatile static unsigned int ow_usec_timeout;
//-------------------------------------------------------------------
// timer1_init
// Purpose:
// Initialise reload timer1 to 1us
// Parameters:
// Returns:
//-------------------------------------------------------------------
void timer1_init(void)
{
usec_delay = 0;
ow_usec_timeout = 0;
TMRLR1 = 0x08; // set reload value [0x08 --> 1 usec resolution]
TMCSR1 = 0x001B; // prescaler 125ns at 16 MHz
//TMCSR1 = 0x0018; // prescaler 125ns at 16 MHz
//TMCSR1_INTE = 1;
} // timer1_init
void timer1_stop(void)
{
TMCSR1_CNTE = 0;
TMCSR1_INTE = 0;
}
void timer1_start(void)
{
TMCSR1_INTE = 1;
TMCSR1_CNTE = 1;
}
//-------------------------------------------------------------------
// timer1
// Purpose:
// Timer1 timer overflow interrupt 1us resolution
// Parameters:
// Returns:
//-------------------------------------------------------------------
__interrupt void timer1(void)
{
TMCSR1_INTE = 0;
TMCSR1_UF = 0; // reset underflow interrupt request flag
if (usec_delay) usec_delay--;
if (ow_usec_timeout) ow_usec_timeout--;
TMCSR1_INTE = 1;
} // timer1
//-------------------------------------------------------------------
// us_delay
// Purpose:
// Waits usec microseconds. The resolution is -+ 1us.
// Uses the hardware timer1 for calculating the time.
// Parameters:
// usec - the amount of time in usec to wait;
// Returns:
//-------------------------------------------------------------------
void us_delay(unsigned int usec)
{
usec_delay = usec;
while (usec_delay);
} // us_delay
|
76f30b3b530e85a146dcdadddb8708579bbd8675
|
3729961e9a789ed6fc1e128b77e34e43aaa9dbdc
|
/out/tuple.c
|
8a99bcd2931eeca48886d4f55bbd47acf1a5e86f
|
[] |
no_license
|
Nicolas-Reyland/metalang
|
60daca09e403c5390288dec4820a486fe08b913a
|
431f0baa8ada74d6cfcdb09d465ab3a843c17088
|
refs/heads/master
| 2021-09-29T00:14:42.956123 | 2018-11-20T21:33:17 | 2018-11-21T20:15:33 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 822 |
c
|
tuple.c
|
#include <stdio.h>
#include <stdlib.h>
typedef struct tuple_int_int {
int tuple_int_int_field_0;
int tuple_int_int_field_1;
} tuple_int_int;
struct tuple_int_int * f(struct tuple_int_int * tuple0) {
struct tuple_int_int * c = tuple0;
int a = c->tuple_int_int_field_0;
int b = c->tuple_int_int_field_1;
struct tuple_int_int * d = malloc(sizeof(tuple_int_int));
d->tuple_int_int_field_0 = a + 1;
d->tuple_int_int_field_1 = b + 1;
return d;
}
int main(void) {
struct tuple_int_int * e = malloc(sizeof(tuple_int_int));
e->tuple_int_int_field_0 = 0;
e->tuple_int_int_field_1 = 1;
struct tuple_int_int * t = f(e);
struct tuple_int_int * g = t;
int a = g->tuple_int_int_field_0;
int b = g->tuple_int_int_field_1;
printf("%d -- %d--\n", a, b);
return 0;
}
|
d953500a5cf28e0d6cd70673e2d2fb0cea6ed043
|
d45c2851c41bfac7a169236460a368ebf5032394
|
/Lab 4/simodyssey/EIFGENs/simodyssey1/F_code/C3/ar147.c
|
f53aaf18030d55f507145592191ae2b1336227b1
|
[] |
no_license
|
GavinSit/EECS-3311-Software-Design
|
dd549ee44d7404a891e099e79d2545fefa502c57
|
c762d4a16643c4e9f2ae546a51fdddc9b5d6c952
|
refs/heads/main
| 2023-04-26T22:50:12.356097 | 2021-05-17T16:25:27 | 2021-05-17T16:25:27 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 2,827 |
c
|
ar147.c
|
/*
* Code for class ARGUMENTS
*/
#include "eif_eiffel.h"
#include "../E1/estructure.h"
#include "../E1/eoffsets.h"
#include "ar147.h"
#include "eif_built_in.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* {ARGUMENTS}.argument */
EIF_REFERENCE F565_2414 (EIF_REFERENCE Current, EIF_INTEGER_32 arg1)
{
GTCX
EIF_REFERENCE Result = ((EIF_REFERENCE) 0);
RTLD;
RTLI(2);
RTLR(0,Current);
RTLR(1,Result);
RTLIU(2);
RTGC;
Result = RTOUCR(150,F565_2437, (Current));
Result = F564_2438(RTCW(Result), arg1);
Result = F1558_6566(RTCW(Result));
RTLE;
return Result;
}
/* {ARGUMENTS}.argument_array */
static EIF_REFERENCE F565_2415_body (EIF_REFERENCE Current)
{
GTCX
RTEX;
#define Result RTOTRR
RTOUDR(151)
RTEV;
RTOTP;
Result = F565_2436(Current);
RTOTE;
RTEE;
return Result;
#undef Result
}
EIF_REFERENCE F565_2415 (EIF_REFERENCE Current)
{
GTCX
return RTOUCR(151,F565_2415_body,(Current));
}
/* {ARGUMENTS}.argument_count */
EIF_INTEGER_32 F565_2432 (EIF_REFERENCE Current)
{
GTCX
EIF_INTEGER_32 Result = ((EIF_INTEGER_32) 0);
RTLD;
RTLI(1);
RTLR(0,Current);
RTLIU(1);
RTGC;
Result = (EIF_INTEGER_32) eif_builtin_ARGUMENTS_32_argument_count;
RTLE;
return Result;
}
/* {ARGUMENTS}.internal_argument_array */
EIF_REFERENCE F565_2436 (EIF_REFERENCE Current)
{
GTCX
EIF_INTEGER_32 loc1 = (EIF_INTEGER_32) 0;
EIF_REFERENCE tr1 = NULL;
EIF_INTEGER_32 ti4_1;
EIF_REFERENCE Result = ((EIF_REFERENCE) 0);
RTLD;
RTLI(3);
RTLR(0,Current);
RTLR(1,tr1);
RTLR(2,Result);
RTLIU(3);
RTGC;
{
static EIF_TYPE_INDEX typarr0[] = {0xFF01,918,0xFF01,1560,0xFFFF};
EIF_TYPE typres0;
static EIF_TYPE typcache0 = {INVALID_DTYPE, 0};
typres0 = (typcache0.id != INVALID_DTYPE ? typcache0 : (typcache0 = eif_compound_id(Dftype(Current), typarr0)));
Result = RTLNS(typres0.id, 918, _OBJSIZ_1_1_0_2_0_0_0_0_);
}
tr1 = RTMS_EX_H("",0,0);
ti4_1 = F565_2432(Current);
F919_3186(RTCW(Result), tr1, ((EIF_INTEGER_32) 0L), ti4_1);
F575_2465(RTCW(Result));
for (;;) {
if ((EIF_BOOLEAN) (loc1 > F565_2432(Current))) break;
tr1 = F565_2414(Current, loc1);
F919_3210(RTCW(Result), tr1, loc1);
loc1++;
}
RTLE;
return Result;
}
/* {ARGUMENTS}.internal_arguments */
static EIF_REFERENCE F565_2437_body (EIF_REFERENCE Current)
{
GTCX
RTEX;
EIF_REFERENCE tr1 = NULL;
RTLD;
#define Result RTOTRR
RTOUDR(150)
RTLI(1);
RTLR(0,tr1);
RTLIU(1);
RTEV;
RTGC;
RTOTP;
tr1 = RTLNS(eif_new_type(563, 0x01).id, 563, _OBJSIZ_0_0_0_0_0_0_0_0_);
Result = (EIF_REFERENCE) tr1;
RTOTE;
RTLE;
RTEE;
return Result;
#undef Result
}
EIF_REFERENCE F565_2437 (EIF_REFERENCE Current)
{
GTCX
return RTOUCR(150,F565_2437_body,(Current));
}
void EIF_Minit147 (void)
{
GTCX
}
#ifdef __cplusplus
}
#endif
|
ccf4473bceaba302e888386be1688fd5aec6d7d6
|
2377b84a860af25959f05d01675fca3f7cafbfb5
|
/pg_wintools/computerdetails.h
|
dfc86b05234cecdb7ad67a4abc4aa91cb4165a13
|
[] |
no_license
|
zYg-sys/pg_wintools
|
096694f0d8656dd304cb32f78086898881f08c93
|
081f954b0dead86cfdcc0c5e0a3350d1273dec3a
|
refs/heads/master
| 2020-12-05T23:35:07.993323 | 2015-11-16T03:05:01 | 2015-11-16T03:05:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,233 |
h
|
computerdetails.h
|
/*
* Copyright (c) 2015 SQIG Inc.
*
* Permission to use, copy, modify, and distribute this software and its documentation
* for any purpose, without fee, and without a written agreement is hereby granted,
* provided that the above copyright notice and this paragraph and the following two paragraphs
* appear in all copies.
*
* IN NO EVENT SHALL SQIG Inc. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
* OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
* DOCUMENTATION, EVEN IF SQIG Inc. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* SQIG Inc. SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND SQIG Inc. HAS NO OBLIGATIONS TO PROVIDE
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#define DRIVE_LONG unsigned __int64
char * get_hostname(void);
BOOL check_file_exists(char * filename);
typedef struct
{
char * name;
DRIVE_LONG * total_number_of_MB;
DRIVE_LONG * free_MB_available;
} drive;
int fill_fixed_drives_list(drive *** drive_list);
|
6fe4a5f573cf4819aa2fd777791d99a8dc4b3633
|
a9cf63c67779c84ea4c80dba260f18a9432c41fa
|
/Project/include/GfxPrimitives.h
|
71cec302b90eeca096c2f8b1d45715053d7e4f65
|
[] |
no_license
|
Danjb1/openlierox-classic
|
bcf01e6a07d70e632e17ab60a51f55c32c2ea1eb
|
85f9ae8574976e2811d36a3f07341ff983bfbb2e
|
refs/heads/master
| 2020-12-03T00:18:45.692346 | 2017-07-02T12:23:27 | 2017-07-02T12:23:31 | 96,014,657 | 1 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 3,013 |
h
|
GfxPrimitives.h
|
/////////////////////////////////////////
//
// Auxiliary Software class library
//
/////////////////////////////////////////
// Graphics primitives
// Created 12/11/01
// By Jason Boettcher
#ifndef __GFXPRIMITIVES_H__
#define __GFXPRIMITIVES_H__
// Surface stuff
SDL_Surface *gfxCreateSurface(int width, int height);
// Image drawing
void DrawImage(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int x, int y);
void DrawImageEx(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int x, int y, int w, int h);
void DrawImageAdv(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int sx, int sy, int dx, int dy, int w, int h);
void DrawImageAdv_Mirror(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int sx, int sy, int dx, int dy, int w, int h);
void DrawImageStretch(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int dx, int dy);
void DrawImageStretch2(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int sx, int sy, int dx, int dy, int w, int h);
void DrawImageStretchKey(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int dx, int dy, Uint16 key);
void DrawImageStretch2Key(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int sx, int sy, int dx, int dy, int w, int h, Uint16 key);
void DrawImageStretchMirrorKey(SDL_Surface *bmpDest, SDL_Surface *bmpSrc, int sx, int sy, int dx, int dy, int w, int h, Uint16 key);
// Solid drawing
void DrawRectFill(SDL_Surface *bmpDest, int x, int y, int x2, int y2, int colour);
void DrawRect(SDL_Surface *bmpDest, int x, int y, int x2, int y2, int colour);
void DrawRectFillA(SDL_Surface *bmpDest, int x, int y, int x2, int y2, int color, int alpha);
void DrawHLine(SDL_Surface *bmpDest, int x, int x2, int y, int colour);
void DrawVLine(SDL_Surface *bmpDest, int x, int x2, int y, int colour);
//void DrawLine(SDL_Surface *bmpDest, int x, int y, int x2, int y2, int colour);
// Pixel drawing
void PutPixel(SDL_Surface *bmpDest, int x, int y, int colour);
Uint32 GetPixel(SDL_Surface *bmpSrc, int x, int y);
Uint32 GetPixelFromAddr(Uint8 *p, int bpp);
void RopePutPixel(SDL_Surface *bmpDest, int x, int y, int colour);
void BeamPutPixel(SDL_Surface *bmpDest, int x, int y, int colour);
void LaserSightPutPixel(SDL_Surface *bmpDest, int x, int y, int colour);
// Colour component
Uint32 MakeColour(Uint8 r, Uint8 g, Uint8 b);
void GetColour4(Uint32 pixel, SDL_Surface *img, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
// Line drawing
static int clipEncode (Sint16 x, Sint16 y, Sint16 left, Sint16 top, Sint16 right, Sint16 bottom);
static int clipLine(SDL_Surface *dst, Sint16 *x1, Sint16 *y1, Sint16 *x2, Sint16 *y2);
int DrawLine(SDL_Surface *dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
void DrawRope(SDL_Surface *bmp, int x1, int y1, int x2, int y2, Uint32 color);
void DrawBeam(SDL_Surface *bmp, int x1, int y1, int x2, int y2, Uint32 color);
void DrawLaserSight(SDL_Surface *bmp, int x1, int y1, int x2, int y2, Uint32 color);
void do_line(SDL_Surface *bmp, int x1, int y1, int x2, int y2, int d, void (*proc)(SDL_Surface *, int, int, int));
#endif // __GFXPRIMITIVES_H__
|
2154591e51cddd89fd30b85e98832a747f578b49
|
ee92f59d88bad7ab52501e157929022f3d1192b8
|
/get_next_line.h
|
7fa38f382abb2794b679cbede5d6ab3c8585acd7
|
[] |
no_license
|
jsmyb/gnl
|
fcd18086eaac39ade437a916fe9822fe61f9b12b
|
484c5423e288f6fca69a60b18076aeb52f3d8755
|
refs/heads/master
| 2023-05-15T08:40:40.759302 | 2021-06-12T15:04:23 | 2021-06-12T15:04:23 | 376,318,279 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,450 |
h
|
get_next_line.h
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lsoghomo <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/22 19:06:55 by lsoghomo #+# #+# */
/* Updated: 2021/02/22 19:06:57 by lsoghomo ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GET_NEXT_LINE_H
# define GET_NEXT_LINE_H
# include <stdlib.h>
# include <unistd.h>
# include <fcntl.h>
# ifndef BUFFER_SIZE
# define BUFFER_SIZE 1
# endif
# ifndef ARRAY_MAX_SIZE
# define ARRAY_MAX_SIZE 4096
# endif
typedef struct s_struct
{
int i;
int a;
char *temp;
int ret;
int return_number;
char *buffer;
} t_struct;
int get_next_line(int fd, char **line);
char *ft_strjoin(char *s1, char const *s2);
char *ft_strdup(const char *s);
size_t ft_strlen(const char *s);
char *ft_strchr(const char *str, int c);
#endif
|
3b013a7fe1e06e98f12992586f6e572d4fe603e2
|
f6e8fb547ba13ececde393d30328c25335432d00
|
/devel/include/mavros_msgs/ParamSetResponse.h
|
91ee7ad38d6803f36970e582ef18f87f8ecad949
|
[] |
no_license
|
lbf10/ardupilot_ws
|
c98cece2e22bf2b929f65ab60aba77b2baed761f
|
c6260c3927f76dabdd56987d49902a5ea7230012
|
refs/heads/master
| 2021-03-22T12:49:37.329321 | 2020-09-20T22:45:07 | 2020-09-20T22:45:07 | 247,365,946 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 90 |
h
|
ParamSetResponse.h
|
/home/lbf10/ardupilot_ws/devel/.private/mavros_msgs/include/mavros_msgs/ParamSetResponse.h
|
52ea3e9ef921f2c6df42e603481f4986f0cd8b7a
|
dc0640d489285b8b1fa64f8a7339a28fbe0f57e1
|
/ex4/ex4-5.c
|
bcd391b7dba6da208f832463013475611446efce
|
[] |
no_license
|
hankstag/POC
|
d288a7280694beed9acc53fe51e7b2f7aba217bb
|
83203c8fb43f3c5483868fdb2633657247e4fed5
|
refs/heads/master
| 2016-09-05T22:53:34.950997 | 2015-04-12T08:56:42 | 2015-04-12T08:56:42 | 31,931,164 | 3 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 431 |
c
|
ex4-5.c
|
#include <stdio.h>
#include <string.h>
int main(void){
char a[128];
char b[128];
int copy = 0;
if(fgets(a,sizeof(a),stdin) == NULL){
printf("File is empty!\n");
return 0;
}
while(fgets(b,sizeof(b),stdin) != NULL){
if(strcmp(a,b) == 0){
copy += 1;
if(copy == 1){
printf("%s",a);
}
}
else if(copy > 0){
copy = 0;
strlcpy(a,b,sizeof(b));
}
else{
strlcpy(a,b,sizeof(b));
}
}
return 0;
}
|
1926b32bca4709b28787d8fcbec9bf404712fb37
|
6eb9ccdbbd5b6419e4f93f83284e5d1a4e6c6644
|
/ProjektTestTestAmandus/jacobi.h
|
fa8297afe4f0cea4761f6a7cdf62fa8545b7d0e4
|
[] |
no_license
|
G-Sell-09/HPC-2
|
8642539dc4768bcddc5beb93b4b31a285f559876
|
ff46e4fd14ba0d8f19bb60c2035405ed35d379cf
|
refs/heads/main
| 2023-06-30T12:50:19.331034 | 2021-08-06T13:30:52 | 2021-08-06T13:30:52 | 357,222,679 | 0 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 1,850 |
h
|
jacobi.h
|
/*!
* \brief jacobi smoother for the 5-point stencil
*
* @param[in] x vector x
* @param[in] b right hand side
* @param[in] r residual
* @param[in] w relaxation factor
* @param[in] nu number of iterations
* @param[in] tol tolerance
* @param[in] N grid size
* @param[in] mfMult typdef myMult for 5-point or 9-point stencil
*
* @param[out] x vector x
* @param[out] b right hand side
* @param[out] r residual
*
* \author Robin Sell
* \author Neil Vetter
*
* \version 1.0
* \copyright HPC-2 Team RSNV
*
*/
void jac5(double *x, double *b, double *r, double w, double nu, double tol, int N, myMult mfMult)
{
// first redidual
residual(r, x, b, N, mfMult);
for (int i = 0;i<nu;i++)
{
// next x_k
vec2(x, r, w/4, N*N);
// next residiual
residual(r, x, b, N, mfMult);
if (norm2(r, N*N) / norm2(b,N*N) < tol)
break;
}
}
/*!
* \brief jacobi smoother for the 9-point stencil
*
* @param[in] x vector x
* @param[in] b right hand side
* @param[in] r residual
* @param[in] w relaxation factor
* @param[in] nu number of iterations
* @param[in] tol tolerance
* @param[in] N grid size
* @param[in] mfMult typdef myMult for 5-point or 9-point stencil
*
* @param[out] x vector x
* @param[out] b right hand side
* @param[out] r residual
*
* \author Robin Sell
* \author Neil Vetter
*
* \version 1.0
* \copyright HPC-2 Team RSNV
*
*/
void jac9(double *x, double *b, double *r, double w, double nu, double tol, int N, myMult mfMult)
{
// first residual
residual(r, x, b, N, mfMult);
for (int i = 0;i<nu;i++)
{
// next x_k
vec2(x, r, w/20, N*N);
// next residual
residual(r, x, b, N, mfMult);
if (norm2(r, N*N) / norm2(b,N*N) < tol)
break;
}
}
|
44fe411773e1c3fdb744eedc54904c9bfae04884
|
e891123fa4f0d13b42430e56543c4c84a2b8c54c
|
/nano/app/common/common_tests.c
|
a7dd9209cb9dcaeb27edf616597497a66757610a
|
[] |
no_license
|
yuhuidream/crane
|
e8422daa1ee44648691ff02a0b8f57ff83149322
|
bc4d2b830839c0678ee5ae249378d5cf606dfa9e
|
refs/heads/master
| 2020-04-12T22:39:45.294822 | 2018-12-22T08:40:39 | 2018-12-22T08:40:39 | 162,795,255 | 1 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 35,443 |
c
|
common_tests.c
|
#include "predefines.h"
#include <string.h>
#include "bbu.h"
#include "pmic.h"
#include "timer_dec.h"
#include "CIU.h"
#include "common_tests.h"
#include "i2c_dec.h"
#include "MCU.h"
#ifndef CONFIG_NANO
#include "spinlock.h"
#include "gpio_dec.h"
#include "utils.h"
#include "tri_led.h"
#include "gpio_dec.h"
#include "cache-test.h"
#include "vfp.h"
#include "gic_dec.h"
#ifdef CONFIG_HSI
#include "hsi_dec.h"
#endif
/* ........................................................................ */
void bbu_gpio(int argc, uint8_t **argv)
{
uint32_t value;
uint32_t reg, bit;
switch(argc){
case 1:
bbu_printf("Usage: gpio [/x] <gpio_pin>, "
"type gpio /h for detail help\n\r");
break;
case 2:
if(check_help(argv[1])){
bbu_gpio_help();
}else
bbu_printf("Usage: gpio [/x] <gpio_pin>, "
"type gpio /h for detail help\n\r");
break;
case 3:
value = conv_dec((char*)argv[2]);
if(!strcmp((const char*)argv[1], "/o")){
gpio_set_output(value);
bbu_printf("gpio--> GPIO line specified "
"above set to OUTPUT.\n\r");
}
else if(!strcmp((const char*)argv[1], "/i")){
gpio_set_input(value);
bbu_printf("gpio--> GPIO line specified above set to INPUT.\n\r");
}
else if(!strcmp((const char*)argv[1], "/s")){
gpio_output_high(value);
bbu_printf("gpio--> GPIO bit specified above set HIGH.\n\r");
}
else if(!strcmp((const char*)argv[1], "/c")){
gpio_output_low(value);
bbu_printf("gpio--> GPIO bit specified above set LOW.\n\r");
}
else if(!strcmp((const char*)argv[1], "/d")){
if(gpio_get_direction(value))
bbu_printf("gpio--> GPIO %d is configured as output.\n\r",value);
else
bbu_printf("gpio--> GPIO %d is configured as input.\n\r",value);
}
else if(!strcmp((const char*)argv[1], "/l")){
reg = value/32;
bit = value%32;
if(reg >= 6){
bbu_printf("gpio--> GPIO pin index is out of range\n\r");
return;
}
reg = gpio_get_pin_level_register(reg);
if(reg & (1<<bit)){
bbu_printf("gpio--> GPIO %d pin level is HIGH\n\r", value);
}else{
bbu_printf("gpio--> GPIO %d pin level is LOW\n\r", value);
}
}
else
bbu_printf("Usage: gpio [/x] <gpio_pin>, "
"type gpio /h for detail help\n\r");
break;
default:
bbu_printf("Usage: gpio [/x] <gpio_pin>, "
"type gpio /h for detail help\n\r");
break;
}
return;
}
/* ........................................................................ */
void bbu_ledt(int argc, uint8_t **argv)
{
uint32_t status = 0, config = 0;
status = tri_led_status();
if(argc == 1){
bbu_printf("ledt--> Current status: ");
if(status & LED_R_ON) bbu_printf("Red On, ");
else bbu_printf("Red Off, ");
if(status & LED_B_ON) bbu_printf("Blue On, ");
else bbu_printf("Blue Off, ");
if(status & LED_G_ON) bbu_printf("Green On. ");
else bbu_printf("Green Off. ");
bbu_printf("\n\r");
return;
}
argc -- ;
argv ++;
if(check_help(*argv))
return bbu_ledt_help();
while(argc > 0 ){
if(!strcmp((const char*)*argv, "off")){
bbu_printf("ledt--> LEDs are turned off\n\r");
tri_led_off(0xf);
return ;
}
if(!strcmp((const char*)*argv, "r") ||
!strcmp((const char*)*argv, "red"))
config |= LED_R_ON;
if(!strcmp((const char*)*argv, "b") ||
!strcmp((const char*)*argv, "blue"))
config |= LED_B_ON;
if(!strcmp((const char*)*argv, "g") ||
!strcmp((const char*)*argv, "green"))
config |= LED_G_ON;
argc -- ;
argv ++;
}
if(config == 0){
bbu_printf("ledt--> The arguments are all wrong\n\r");
bbu_ledt_help();
return;
}
tri_led_off(0xf);
tri_led_on(config);
bbu_printf("ledt--> Turn on LED: ");
if(config & LED_R_ON) bbu_printf("Red ");
if(config & LED_B_ON) bbu_printf("Blue ");
if(config & LED_G_ON) bbu_printf("Green ");
bbu_printf("\n\r"BBU_PROMPT);
return;
}
/* ........................................................................ */
void bbu_eica_test(int argc, uint8_t **argv)
{
#ifdef CONFIG_SMP
(void)argc;(void)argv;
bbu_eica(0, 0);
bbu_printf("L1 I&D cache, L2 cache and BPU enabled\n\r");
#else
if(argc == 1){
bbu_eica(0,0);
bbu_printf("L1 I-cache, D-cache, BPU and L2 cache (prefetch) enabled\n\r");
}
else{
if(check_help(argv[1])){
bbu_eica_help();
}
else if(strcmp((const char*)argv[1], "d") == 0){
bbu_eica(1, D_CACHE_ENABLE);
bbu_printf("L1 D-cache and L2 cache enabled\n\r");
}
else if(strcmp((const char*)argv[1], "i") == 0){
bbu_eica(1, I_CACHE_ENABLE);
bbu_printf("L1 I-cache enabled\n\r");
}
else
bbu_printf("The cache type not correct!\n\r");
}
#endif
return;
}
/* ........................................................................ */
void bbu_dica_test(int argc, uint8_t **argv)
{
#ifdef CONFIG_SMP
(void)argc;(void)argv;
bbu_dica();
bbu_printf("L1 I&D cache, L2 cache disabled\n\r");
#else
if((argc == 2) && (check_help(argv[1]))){
bbu_dica_help();
}
else{
bbu_dica();
bbu_printf("L1 I&D cache, L2 cache disabled\n\r");
}
return;
#endif
}
#ifndef CONFIG_CPU_AO
/* ........................................................................ */
void bbu_ivfp(int argc, uint8_t **argv)
{
int core = smp_processor_id();
if(argc == 1){
if(is_vfp_enabled())
{
bbu_printf("Core%d NEON/VFP current state: enabled\n\r", core);
}else{
bbu_printf("Core%d NEON/VFP current state: disabled\n\r", core);
}
}else{
if(check_help(argv[1]))
bbu_ivfp_help();
else if(!strcmp((const char*)argv[1], "1") ||
!strcmp((const char*)argv[1], "on")){
if(!is_vfp_enabled())
vfp_enable();
bbu_printf("Core%d NEON/VFP is enabled\n\r", core);
}else if(!strcmp((const char*)argv[1], "0") ||
!strcmp((const char*)argv[1], "off")){
if(is_vfp_enabled())
vfp_disable();
bbu_printf("Core%d NEON/VFP is disabled\n\r", core);
}else if(!strcmp((const char*)argv[1], "d") ||
!strcmp((const char*)argv[1], "dump")){
if(!is_vfp_enabled()){
bbu_printf("Can't dump registers of Core%d NEON/VFP as "
"it's disabled\n\r", core);
}else{
vfp_reg_dump();
}
}else
bbu_printf("Unsupported option\n\r");
}
bbu_printf(BBU_PROMPT);
return;
}
#else
static spinlock_t ivfp_lock = {0};
static void* __bbu_ivfp(void* info)
{
int mode = (int)info;
uint8_t c = smp_processor_id();
spin_lock(&ivfp_lock);
switch(mode){
case 0:
if(is_vfp_enabled())
{
bbu_printf("Core%d VFP current state: enabled\n\r", c);
}else{
bbu_printf("Core%d VFP current state: disabled\n\r", c);
}
break;
case 1:
if(!is_vfp_enabled())
vfp_enable();
bbu_printf("Core%d VFP is enabled\n\r", c);
break;
case 2:
if(is_vfp_enabled())
vfp_disable();
bbu_printf("Core%d VFP is disabled\n\r", c);
break;
case 3:
if(!is_vfp_enabled()){
bbu_printf("Can't dump registers of Core%d NEON/VFP as "
"it's disabled\n\r",c);
}else{
vfp_reg_dump();
}
break;
}
spin_unlock(&ivfp_lock);
return (void *)0;
}
/* ........................................................................ */
void bbu_ivfp(int argc, uint8_t **argv)
{
void *info;
uint8_t cpu = 1 << smp_processor_id();
bbu_printf("\n\r");
switch(argc){
case 1:
info = (void *)0;
core_start_parallel(__bbu_ivfp, info, 0xF);
break;
case 3:
if(!strcmp((const char*)argv[2], "all")){
cpu = (1<<CORE_NUM) - 1;
}
else{
cpu = conv_dec((char *)argv[2]);
if(cpu > CORE_NUM){
bbu_printf("CPU id is out of range\n\r"BBU_PROMPT);
return;
}
cpu = 1<<cpu;
}
case 2:
if(check_help(argv[1]))
bbu_ivfp_help();
else if(!strcmp((const char*)argv[1], "1") ||
!strcmp((const char*)argv[1], "on")){
info = (void *)1;
core_start_parallel(__bbu_ivfp, info, cpu);
}else if(!strcmp((const char*)argv[1], "0") ||
!strcmp((const char*)argv[1], "off")){
info = (void *)2;
core_start_parallel(__bbu_ivfp, info, cpu);
}else if(!strcmp((const char*)argv[1], "d") ||
!strcmp((const char*)argv[1], "dump")){
info = (void *)3;
core_start_parallel(__bbu_ivfp, info, cpu);
}else
bbu_printf("Unsupported option\n\r");
break;
default:
bbu_ivfp_help();
break;
}
return;
}
#endif
/* ........................................................................ */
void bbu_clear_screen(void)
{
bbu_printf("%c[H", 27); //clear screen
bbu_printf("%c[J", 27); //go to top
}
/* ........................................................................ */
void bbu_ddrp(int argc, uint8_t **argv){
uint8_t prio[8]; int port;
switch(argc){
case 1:
bbu_printf("\n\rddrp--> Current ports' priority is: "
"(0,1: low; 2:high; 3:critical)\n\r");
for(port = 0; port < DDR_PORT_INVALID; port++){
prio[0] = ddr_get_port_prio(port);
bbu_printf("ddrp--> DDR port priority is %d\n\r", port, prio[0]);
}
case 2:
if(check_help(argv[1])){
bbu_ddrp_help();
break;
}
port =conv_dec((char *)argv[1]);
if(port >= DDR_PORT_INVALID)
bbu_printf("ddrp--> Port number is out of range\n\r");
else{
prio[0] = ddr_get_port_prio(port);
bbu_printf("ddrp--> DDR port priority is %d\n\r", port, prio[0]);
}
break;
case 3:
port =conv_dec((char *)argv[1]);
if(port >= DDR_PORT_INVALID){
bbu_printf("ddrp--> Port number is out of range\n\r");
break;
}
prio[0] =conv_dec((char *)argv[2]);
if(prio[0] >= DDR_PRIO_CRITICAL){
bbu_printf("ddrp--> Priority is out of range\n\r");
break;
}
ddr_set_port_prio(port, prio[0]);
bbu_printf("ddrp--> DDR port priority is set to %d\n\r", port, prio[0]);
break;
case 10:
if( strcmp((const char*)argv[1], "all") ){
bbu_ddrp_help();
break;
}
for(port = 0; port < DDR_PORT_INVALID; port++){
prio[port] = conv_dec((char *)argv[2+port]);
if(prio[port] >= DDR_PRIO_CRITICAL){
bbu_printf("ddrp--> Priority is out of range\n\r");
return;
}
}
ddr_set_port_prio_all(prio);
bbu_printf("ddrp--> All the 8 ports' prioritys are updated\n\r");
break;
default:
bbu_ddrp_help();
break;
}
return;
}
/* ........................................................................ */
void bbu_ddr_power_test(int argc, uint8_t **argv){
int chip, power_state,zpr,znr,value;
int phy_zpr, phy_znr;
unsigned char bank_mask = 0;
switch(argc){
case 1:
case 3:
bbu_printf("error cmd formart\n\r");
break;
case 2:
if(check_help(argv[1])){
bbu_ddr_power_help();
break;
}
if(strcmp((const char*)argv[1], "dump") == 0)
dump_ddr_power_status();
else if((const char*)strcmp((const char*)argv[1], "mmusage") == 0){
mem_dump_range_status();
}
else if((const char*)strcmp((const char*)argv[1], "testvm") == 0){
test_vm();
}
else if((const char*)strcmp((const char*)argv[1], "dpmm") == 0){
dump_used_vmas();
dump_free_vmas();
}
else if((const char*)strcmp((const char*)argv[1], "testp") == 0){
ddr_power_set_test();
}
else if((const char*)strcmp((const char*)argv[1], "cpumask") == 0){
cpumask_test();
}
else if((const char*)strcmp((const char*)argv[1], "autor") == 0){
set_ddr_auto_self_refresh(0);
}
else{
bbu_printf("error cmd formart\n\r");
}
break;
case 4:
if(strcmp((const char*)argv[1], "set") == 0){
chip =conv_dec((char *)argv[2]);
if(chip > 3 || chip < 0){
bbu_printf("chip number out of range\n\r");
break;
}
power_state =conv_dec((char *)argv[3]);
if(chip > 4 || chip < 0){
bbu_printf("power state out of range\n\r");
break;
}
set_ddr_power_state(chip,power_state);
break;
}else if(strcmp((const char*)argv[1], "pasr") == 0){
chip =conv_dec((char *)argv[2]);
if(chip > 3 || chip < 0){
bbu_printf("chip number out of range\n\r");
break;
}
bank_mask =conv_hex((char *)argv[3]);
set_ddr_pasr(chip,bank_mask);
break;
} else if(strcmp((const char*)argv[1], "cal") == 0){
zpr =conv_dec((char *)argv[2]);
znr =conv_dec((char *)argv[3]);
bbu_printf("\n\rzpr is %d\n\r",zpr);
bbu_printf("znr is %d\n\r",znr);
value = BU_REG_READ(0xc010023c);
bbu_printf("0xc010023c: 0x%x\n\r",value);
value |= BIT_16;
BU_REG_WRITE(0xc010023c,value);
udelay(20);
value = BU_REG_READ(0xc010024c);
bbu_printf("0xc010024c: 0x%x\n\r",value);
if(((value&BIT_3)!=0) || ((value&BIT_2)==0)) {
bbu_printf("zpr/znr error\n\r");
return;
}
phy_zpr = ((value >> 20)&0xf);
phy_znr = ((value >> 16)&0xf);
bbu_printf("phy_zpr: %d , phy_znr: %d\n\r", phy_zpr, phy_znr);
if((zpr > (phy_zpr+3)) || (znr > (phy_znr+3))) {
bbu_printf("error zpr/znr, zpr/znr should <= %d/%d\n\r",
phy_zpr+3,phy_znr+3);
return;
}
value = BU_REG_READ(0xc0100230);
bbu_printf("0xc0100230: 0x%x\n\r",value);
value = BU_REG_READ(0xc0100230);
value &= 0xfffff00f;
value |= (zpr<<4);
value |= (znr << 8);
BU_REG_WRITE(0xc0100230,value);
value = BU_REG_READ(0xc0100230);
bbu_printf("0xc0100230: 0x%x\n\r",value);
value = BU_REG_READ(0xc0100234);
bbu_printf("0xc0100234: 0x%x\n\r",value);
value = BU_REG_READ(0xc0100234);
value &= 0xfffff00f;
value |= (zpr<<4);
value |= (znr << 8);
BU_REG_WRITE(0xc0100234,value);
value = BU_REG_READ(0xc0100234);
bbu_printf("0xc0100234: 0x%x\n\r",value);
value = BU_REG_READ(0xc0100238);
bbu_printf("0xc0100238: 0x%x\n\r",value);
value = BU_REG_READ(0xc0100238);
value &= 0xffffff00;
value |= (zpr<<0);
value |= (znr << 4);
BU_REG_WRITE(0xc0100238,value);
value = BU_REG_READ(0xc0100238);
bbu_printf("0xc0100238: 0x%x\n\r",value);
bbu_printf("now disable pad_cal_auto\n\r");
value = BU_REG_READ(0xc010023c);
bbu_printf("0xc010023c: 0x%x\n\r",value);
value &= ~BIT_16;
BU_REG_WRITE(0xc010023c,value);
value = BU_REG_READ(0xc010023c);
bbu_printf("0xc010023c: 0x%x\n\r",value);
break;
}else{
bbu_printf("error cmd formart\n\r");
break;
}
default:
bbu_ddr_power_help();
break;
}
return;
}
#ifdef CONFIG_HSI
/*
*hsi_test_argv[0]:
*hsi_test_argv[1]:start_channel
*hsi_test_argv[2]:test mode
*hsi_test_argv[3]:burst_size
*hsi_test_argv[4]:end_channel
*hsi_test_argv[5]:is_desc,pass 0
*hsi_test_argv[6]:is_lpbk
*hsi_test_argv[7]:int_num, pass 0
*/
char hsi_test_argv[MAX_PARMS][MAX_CHARS_PER_PARM] = {
{"0"},
{"1"},
{"1"}, /*dma int mode*/
{"6"},
{"0"},
{"0"},
{"0"},
{"0"},
};
/* ........................................................................ */
void bbu_hsi_test(int argc, uint8_t **argv){
int i,retval;
switch(argc){
case 1:
bbu_hsi_help();
break;
case 2:
if(check_help(argv[1])){
bbu_hsi_help();
break;
}
if(strcmp((const char*)argv[1], "1") == 0) {
for(i = 0;i < 1; i++)
{
sprintf(&hsi_test_argv[1][0],"%d",0);
sprintf(&hsi_test_argv[4][0],"%d",7);
retval = mipihsi_test(8, hsi_test_argv);
if(retval == MV_OK)
bbu_printf("HSI PASS.\n\r");
else
bbu_printf("HSI FAIL.\n\r");
}
}else{
bbu_printf("error cmd formart\n\r");
}
break;
default:
bbu_hsi_help();
break;
}
return;
}
#endif
/* ........................................................................ */
void bbu_ddrw(int argc, uint8_t **argv){
uint8_t wght[8];
int port;
switch(argc){
case 1:
bbu_printf("\n\rddrw--> Current ports' weight is: "
"(0~15)\n\r");
for(port = 0; port < DDR_PORT_INVALID; port++){
wght[0] = ddr_get_port_weight(port);
bbu_printf("ddrw--> DDR port weight is %d\n\r", port, wght[0]);
}
case 2:
if(check_help(argv[1])){
bbu_ddrw_help();
break;
}
port =conv_dec((char *)argv[1]);
if(port >= DDR_PORT_INVALID)
bbu_printf("ddrw--> Port number is out of range\n\r");
else{
wght[0] = ddr_get_port_weight(port);
bbu_printf("ddrw--> DDR port weight is %d\n\r", port, wght[0]);
}
break;
case 3:
port =conv_dec((char *)argv[1]);
if(port >= DDR_PORT_INVALID){
bbu_printf("ddrw--> Port number is out of range\n\r");
break;
}
wght[0] =conv_dec((char *)argv[2]);
if(wght[0] >= 0x10){
bbu_printf("ddrw--> weight is out of range\n\r");
break;
}
ddr_set_port_weight(port, wght[0]);
bbu_printf("ddrw--> DDR port weight is set to %d\n\r", port, wght[0]);
break;
case 10:
if(strcmp((const char*)argv[1], "all")){
bbu_ddrw_help();
break;
}
for(port = 0; port < DDR_PORT_INVALID; port++){
wght[port] = conv_dec((char *)argv[2+port]);
if(wght[port] >= 0x10){
bbu_printf("ddrw--> weight is out of range\n\r");
return;
}
}
ddr_set_port_weight_all(wght);
bbu_printf("ddrw--> All the 8 ports' weights are updated\n\r");
break;
default:
bbu_ddrw_help();
break;
}
return;
}
/* ........................................................................ */
void bbu_durm(int argc, uint8_t **argv){
switch(argc){
case 1:
bbu_durm_help();
break;
case 2:
if(strcmp((const char*)argv[1], "start") == 0 ||
strcmp((const char*)argv[1], "1") == 0)
ddr_utilization_measure_start(7);
else if(strcmp((const char*)argv[1], "update") == 0 ||
strcmp((const char*)argv[1], "2") == 0){
bbu_durm_help();
}
else if(strcmp((const char*)argv[1], "stop") == 0 ||
strcmp((const char*)argv[1], "0") == 0)
ddr_utilization_measure_stop();
else
bbu_durm_help();
break;
case 3:
if(strcmp((const char*)argv[1], "start") == 0 ||
strcmp((const char*)argv[1], "1") == 0){
uint8_t div = conv_dec((char *)argv[2]);
ddr_utilization_measure_start(div);
}
break;
default:
bbu_durm_help();
break;
}
}
/* ........................................................................ */
void bbu_xtc_test(int argc, uint8_t **argv){
uint32_t xtc;
switch(argc){
case 1:
bbu_printf("error cmd formart\n\r");
break;
case 2:
if(check_help(argv[1]))
{
bbu_xtc_help();
break;
}
else if(strcmp((const char*)argv[1], "/d") == 0)
{
bbu_printf("\n\r******************* XTC reg dump ********************\n\r");
bbu_printf(" MC_CONF(0x%x): 0x%x\n\r",&CIU->MC_CONF,CIU->MC_CONF);
bbu_printf(" GPU_2D_XTC(0x%x): 0x%x\n\r",&CIU->GPU_2D_XTC,CIU->GPU_2D_XTC);
bbu_printf(" GPU_3D_XTC(0x%x): 0x%x\n\r",&CIU->GPU_3D_XTC,CIU->GPU_3D_XTC);
bbu_printf(" VPU_XTC_REG(0x%x): 0x%x\n\r",&CIU->VPU_XTC_REG,CIU->VPU_XTC_REG);
bbu_printf("CPU_CONF_SRAM_0(0x%x): 0x%x\n\r",&CIU->CA7_CPU_CONF_SRAM_0,CIU->CA7_CPU_CONF_SRAM_0);
bbu_printf("CPU_CONF_SRAM_1(0x%x): 0x%x\n\r",&CIU->CA7_CPU_CONF_SRAM_1,CIU->CA7_CPU_CONF_SRAM_1);
bbu_printf("***************** XTC reg dump end ******************\n\r");
}
else
{
bbu_printf("error cmd formart\n\r");
}
break;
case 3:
if(strcmp((const char*)argv[1], "gcrf2p") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->GPU_2D_XTC &= 0xFFF000FF; //Clear bit8->bit19;
CIU->GPU_3D_XTC &= 0xFFF000FF; //Clear bit8->bit19;
bbu_printf("xtc: set gcrf2p to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->GPU_2D_XTC |= 0x00055500;
CIU->GPU_3D_XTC |= 0x00055500;
break;
case 2:
CIU->GPU_2D_XTC |= 0x000AAA00;
CIU->GPU_3D_XTC |= 0x000AAA00;
break;
case 3:
CIU->GPU_2D_XTC |= 0x000FFF00;
CIU->GPU_3D_XTC |= 0x000FFF00;
break;
}
}
else if(strcmp((const char*)argv[1], "gcrf1p") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->GPU_2D_XTC &= 0xFFFFFF00; //Clear bit0->bit7;
CIU->GPU_3D_XTC &= 0xFFFFFF00; //Clear bit0->bit7;
bbu_printf("xtc: set gcrf1p to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->GPU_2D_XTC |= 0x00000055;
CIU->GPU_3D_XTC |= 0x00000055;
break;
case 2:
CIU->GPU_2D_XTC |= 0x000000AA;
CIU->GPU_3D_XTC |= 0x000000AA;
break;
case 3:
CIU->GPU_2D_XTC |= 0x000000FF;
CIU->GPU_3D_XTC |= 0x000000FF;
break;
}
}
else if(strcmp((const char*)argv[1], "vpurf1p") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->VPU_XTC_REG &= 0xFFFFFFF0; //Clear bit0->bit7;
bbu_printf("xtc: set vpurf1p to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->VPU_XTC_REG |= 0x00000005;
break;
case 2:
CIU->VPU_XTC_REG |= 0x0000000A;
break;
case 3:
CIU->VPU_XTC_REG |= 0x0000000F;
break;
}
}
else if(strcmp((const char*)argv[1], "vpurf2p") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->VPU_XTC_REG &= 0xFFFFFF0F; //Clear bit0->bit7;
bbu_printf("xtc: set vpusr2p to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->VPU_XTC_REG |= 0x00000050;
break;
case 2:
CIU->VPU_XTC_REG |= 0x000000A0;
break;
case 3:
CIU->VPU_XTC_REG |= 0x000000F0;
break;
}
}
else if(strcmp((const char*)argv[1], "vpusrrtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->VPU_XTC_REG &= 0xFFFFCCFF; //Clear bit0->bit7;
bbu_printf("xtc: set vpusrRTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->VPU_XTC_REG |= 0x00001100;
break;
case 2:
CIU->VPU_XTC_REG |= 0x00002200;
break;
case 3:
CIU->VPU_XTC_REG |= 0x00003300;
break;
}
}
else if(strcmp((const char*)argv[1], "vpusrwtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->VPU_XTC_REG &= 0xFFFF33FF; //Clear bit0->bit7;
bbu_printf("xtc: set vpusrWTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->VPU_XTC_REG |= 0x00004400;
break;
case 2:
CIU->VPU_XTC_REG |= 0x00008800;
break;
case 3:
CIU->VPU_XTC_REG |= 0x0000CC00;
break;
}
}
else if(strcmp((const char*)argv[1], "l1xtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->CA7_CPU_CONF_SRAM_0 &= 0x00000FFF; //Clear bit12->bit32;
bbu_printf("xtc: set L1XTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x55555000;
break;
case 2:
CIU->CA7_CPU_CONF_SRAM_0 |= 0xAAAAA000;
break;
case 3:
CIU->CA7_CPU_CONF_SRAM_0 |= 0xFFFFF000;
break;
}
}
else if(strcmp((const char*)argv[1], "mmuxtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->CA7_CPU_CONF_SRAM_0 &= 0xFFFFF0FF; //Clear bit8->bit11;
bbu_printf("xtc: set mmuXTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x00000500;
break;
case 2:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x00000A00;
break;
case 3:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x00000F00;
break;
}
}
else if(strcmp((const char*)argv[1], "brxtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->CA7_CPU_CONF_SRAM_0 &= 0xFFFFFF0F; //Clear bit12->bit32;
bbu_printf("xtc: set branch_memXTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x00000050;
break;
case 2:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x000000A0;
break;
case 3:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x000000F0;
break;
}
}
else if(strcmp((const char*)argv[1], "hbxtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->CA7_CPU_CONF_SRAM_0 &= 0xFFFFFFF0; //Clear bit12->bit32;
bbu_printf("xtc: set history_buffer_memXTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x00000005;
break;
case 2:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x0000000A;
break;
case 3:
CIU->CA7_CPU_CONF_SRAM_0 |= 0x0000000F;
break;
}
}
else if(strcmp((const char*)argv[1], "scuxtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->CA7_CPU_CONF_SRAM_1 &= 0xFFFF0FFF; //Clear bit12->bit15;
bbu_printf("xtc: set scuXTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x00005000;
break;
case 2:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x0000A000;
break;
case 3:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x0000F000;
break;
}
}
else if(strcmp((const char*)argv[1], "l2rtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->CA7_CPU_CONF_SRAM_1 &= 0xFFFFFCCC; //Clear bit12->bit15;
bbu_printf("xtc: set L2RTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x00000111;
break;
case 2:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x00000222;
break;
case 3:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x00000333;
break;
}
}
else if(strcmp((const char*)argv[1], "l2wtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->CA7_CPU_CONF_SRAM_1 &= 0xFFFFF333; //Clear bit12->bit15;
bbu_printf("xtc: set L2WTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x00000444;
break;
case 2:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x00000888;
break;
case 3:
CIU->CA7_CPU_CONF_SRAM_1 |= 0x00000CCC;
break;
}
}
else if(strcmp((const char*)argv[1], "mcxtc") == 0)
{
xtc = conv_dec((char *)argv[2]);
if(xtc > 3)
xtc = 3;
CIU->MC_CONF &= 0xFC3FFFFF; //Clear bit22->bit25;
bbu_printf("xtc: set mcXTC to %d\n\r",xtc);
switch(xtc)
{
case 0:
break;
case 1:
CIU->MC_CONF |= 0x01400000;
break;
case 2:
CIU->MC_CONF |= 0x02800000;
break;
case 3:
CIU->MC_CONF |= 0x03C00000;
break;
}
}
break;
default:
bbu_xtc_help();
break;
}
bbu_printf("PASS\n\r");
return;
}
#endif /* end of ifndef CONFIG_NANO */
/* ........................................................................ */
uint32_t get_chip_id(void)
{
return CIU->CHIP_ID;
}
/* ........................................................................ */
int bbu_pid(uint32_t *type, uint32_t *step)
{
uint32_t chip_id = get_chip_id();
uint32_t pid = chip_id & 0xFFFF;
*type = pid;
bbu_printf("Marvell Processor: ");
switch(pid){
case 0x1822:
pid = 0x1822;
break;
case 0x1826:
pid = 0x1826;
break;
default:
bbu_printf("unknown chip id 0x%X\n\r", pid);
return SCREEN_TEST_FIAL;
}
bbu_printf("PXA%X, Revision: ", pid);
chip_id = (chip_id >> 16) & 0xFF; /* Get revision */
*step = chip_id;
switch(chip_id){
case 0xA0:
bbu_printf("A0\n\r");
break;
case 0xF0:
bbu_printf("Z1\n\r");
break;
case 0xF2:
bbu_printf("Z2\n\r");
break;
case 0xF3:
bbu_printf("Z3\n\r");
break;
default:
bbu_printf("Unknown 0x%X\n\r", chip_id);
break;
}
return SCREEN_TEST_PASS;
}
#ifndef CONFIG_SWP_DDR_ONLY
int bbu_pid_test(int argc, uint8_t **argv)
{
(void)argc;
(void)argv;
uint32_t cpu_type = 0, cpu_step = 0;
bbu_pid(&cpu_type, &cpu_step);
return 0;
}
#endif
#ifdef QF_STACK_PER_AO
int bbu_stack(int argc, uint8_t **argv){
if(argc == 3){
QActive *act = (QActive *)ao_info_translate((void *)argv[2], 1);
if(act == 0){
bbu_printf("This AO doesn't exist\n\r");
bbu_stack_help();
return 0;
}
if(!strcmp((const char*)argv[1], "o")){
if(QA_stkCheckOverflow(act))
bbu_printf("AO %s stack overflows\n\r", argv[2]);
else
bbu_printf("AO %s stack may not overflow\n\r", argv[2]);
}else if(!strcmp((const char*)argv[1], "s")){
int size = QA_stkUsedSize(act);
bbu_printf("%d bytes have been used of AO %s stack\n\r",
size, argv[2]);
}else if(!strcmp((const char*)argv[1], "i")){
bbu_printf("The stack of AO %s is from 0x%08X to 0x%08X(%dKB)\n\r",
argv[2], act->stk, act->stk - act->stkSize,
act->stkSize/0x400);
}else{
bbu_printf("The <opt> is not correct\n\r");
bbu_stack_help();
}
}else{
bbu_stack_help();
}
return 1;
}
#endif
int bbu_print_level = INFO_LEVEL;
#ifndef CONFIG_NANO
/* ........................................................................ */
int bbu_print_switch(int argc, uint8_t **argv){
if(argc == 2){
if(check_help((uint8_t *)argv[1]))
bbu_print_help();
else if(!strcmp((const char*)argv[1], "dbg")){
bbu_print_level = DBG_LEVEL;
bbu_printf("Set as DEBUG print level\n\r");
}
else if(!strcmp((const char*)argv[1], "info")){
bbu_print_level = INFO_LEVEL;
bbu_printf("Set as INFOMATION print level\n\r");
}
else if(!strcmp((const char*)argv[1], "crit")){
bbu_print_level = CRIT_LEVEL;
bbu_printf("Set as CRITICAL print level\n\r");
}
else if(!strcmp((const char*)argv[1], "off") ){
bbu_print_level = CRIT_LEVEL+1;
bbu_printf("All level logs are turned off\n\r");
}
else{
uint8_t level = conv_dec((char *)argv[1]);
if(level <= (CRIT_LEVEL+1)){
bbu_print_level = level;
bbu_printf("Print level is set to %d\n\r",level);
}else
bbu_printf("The level %d is out of range\n\r", level);
}
}else{
bbu_print_help();
}
return MV_OK;
}
#endif
static int get_board_version(void)
{
return NZA3_DKB_V10;
}
static int board_version = NZA3_DKB_V10;
void bbu_bid(void)
{
board_version = get_board_version();
bbu_printf("Board Version:");
switch(board_version){
case NZA3_DKB_V10:
bbu_printf("NEZHA3_DKB V1.0\n\r");
break;
default:
board_version = NZA3_DKB_V10;
break;
}
}
int board_is_nza3_dkb_v10(void)
{
if(board_version == NZA3_DKB_V10)
{
return 1;
}else{
return 0;
}
}
|
37634ddb9682961becc4a103b50b716661f86084
|
acb8d4c4f974d872f31997f591fea4d748f94b93
|
/u/kissme/kissme/kunlun/rascal.c
|
91a8b07a8788a91c16383f6407cf13e4f7e8bcbb
|
[] |
no_license
|
MudRen/SZMUD
|
8ae6b05718b1a83363478469185e0d776b0fda5c
|
e3b46e6efa6d353f7f0d00ef676f97d5c0ec3949
|
refs/heads/master
| 2023-05-27T16:04:35.845610 | 2021-06-18T12:47:19 | 2021-06-18T12:47:19 | 361,736,744 | 1 | 2 | null | null | null | null |
GB18030
|
C
| false | false | 486 |
c
|
rascal.c
|
inherit NPC;
void create()
{
set_name("小流氓",({"rascal"}));
set("long","看上去长的满凶恶得汉子。\n");
set("age",25);
set("shen_type",-1);
set("shen",-2000);
set_skill("strike",20);
set_skill("force",20);
set_skill("dodge",20);
set_skill("parry",20);
set("combat_chat_chance",5);
set("combat_chat_msg",({
"小流氓骂到:让老子给你长长记性!\n",
}));
setup();
add_money("silver",30);
}
|
9e54cd0759cdbf8949bb0c612261ab0fc2628993
|
a280aa9ac69d3834dc00219e9a4ba07996dfb4dd
|
/regularexpress/home/weilaidb/work/kernel/linux-3.0.8/arch/powerpc/math-emu/fmr.c
|
54fe97033b93d0afc33f7514e47520ec524b2c7c
|
[] |
no_license
|
weilaidb/PythonExample
|
b2cc6c514816a0e1bfb7c0cbd5045cf87bd28466
|
798bf1bdfdf7594f528788c4df02f79f0f7827ce
|
refs/heads/master
| 2021-01-12T13:56:19.346041 | 2017-07-22T16:30:33 | 2017-07-22T16:30:33 | 68,925,741 | 4 | 2 | null | null | null | null |
UTF-8
|
C
| false | false | 28 |
c
|
fmr.c
|
int
fmr(u32 *frD, u32 *frB)
|
c6e183ff4232fd77214d939acc96f70ac24e56a6
|
d4fd881b4fd14d65e4e66af865f41096abb6e234
|
/C_Language_Basic_Learning/살려줘/살려줘.c
|
80e0fe6025383fbf702d603aa602025b229d12aa
|
[] |
no_license
|
SonYeongDong/SYD_GitHub
|
36d2e7ef6b8d8ba33f53d5f1f46b65d3e15d9fea
|
1fc5b246826755f37311077db9b1c38dcd4a81ec
|
refs/heads/master
| 2020-03-10T21:50:38.681220 | 2019-01-02T05:06:28 | 2019-01-02T05:06:28 | 129,604,426 | 0 | 0 | null | null | null | null |
UHC
|
C
| false | false | 100 |
c
|
살려줘.c
|
#include <stdio.h>
int main(void)
{
printf("살려줘!!\n너무 어려워ㅠㅠ\n");
return 0;
}
|
57540bcce3a63e1d85770da9e4ea805c2bb7757c
|
f8f0070f748bca1c5be82c8725f93cc332db42d5
|
/network.c
|
f1f04ee6c74d801cd7bec9f7f01ab7363848db5d
|
[] |
no_license
|
ekollof/BlogEngine
|
45008d95c479248cc4bf35dfc7ff8621b96befa7
|
b227c8a8656a7546fc5a0d778526b84f19988f76
|
refs/heads/master
| 2016-09-06T19:06:53.632591 | 2010-09-29T11:56:21 | 2010-09-29T11:56:21 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 5,081 |
c
|
network.c
|
/*
* Copyright (c) 2003, Emiel Kollof <emiel@ninth-circle-alliance.net> All
* rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. Neither the name of
* the <ORGANIZATION> nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY 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.
*
* Created by Emiel Kollof on Tue Nov 25 2003. Copyright (c) 2003 All rights
* reserved.
*
* $Id: network.c,v 1.1.1.1 2008/05/14 07:19:43 root Exp $
*/
#include "blog.h"
#ifdef NO_ADDRINFO
#include "getaddrinfo.h"
#endif
#ifdef WANT_LIBWRAP
#include <tcpd.h>
#include <syslog.h>
static struct request_info request;
#endif
/**
* \brief Signal handler voor network_mainloop
* @param s
*/
/**
* @brief Connects to hostname on port sname (is ipv6 compatibe)
* @param hname Host name or IP to connect to
* @param sname Service port or name
* @return Connection socket
*/
int
network_connect(char *hname, char *sname)
{
struct addrinfo *res, *aip, hints;
int error;
int s = -1;
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo(hname, sname, &hints, &res);
if (error != 0) {
vbprintf("network_connect: getaddrinfo: %s \n", gai_strerror(error));
return -1;
}
for (aip = res; aip != NULL; aip = aip->ai_next) {
s = socket(aip->ai_family, aip->ai_socktype, aip->ai_protocol);
if (s < 0)
continue;
if (connect(s, aip->ai_addr, aip->ai_addrlen) == -1) {
(void)close(s);
s = -1;
continue;
}
}
freeaddrinfo(res);
return s;
}
/**
* \brief Send raw string to network socket
* @param fd File descriptor to write to
* @param buf Buffer to send over the network
* @return Amount of bytes sent
*/
int
network_send(int fd, char *buf)
{
int bout;
bout = 0;
if (fd < 0) {
vbprintf("Socket not connected...\n");
return -1;
}
if ((bout = send(fd, buf, strlen(buf), 0)) < 0) {
if (bout == 0) {
vbprintf("netsend: socket disconnected.\n");
close(fd);
return (-1);
} else {
perror("netsend");
return (-1);
}
}
return (bout);
}
/**
* \brief Network printf
* @param sock File descriptor to send to
* @param fmt fmt buffer (printf style)
* @return Amount of bytes sent
*/
int
nprintf(int sock, char *fmt,...)
{
va_list ap;
char *buf;
int ret;
va_start(ap, fmt);
ret = vasprintf(&buf, fmt, ap);
if (ret < 0) {
perror("network.c: nprintf: vasprintf error");
return -1;
}
va_end(ap);
network_send(sock, buf);
free(buf);
return 0;
}
/**
* \brief Read len bytes from socket fd
* @param fd File descriptor to read from
* @param bp Buffer to fill
* @param len length of buffer
* @return Amount of bytes read
*/
int
network_read(int fd, char *bp, size_t len)
{
size_t cnt;
ssize_t rc;
cnt = len;
while (cnt > 0) {
rc = recv(fd, bp, cnt, 0);
if (rc < 0) { /* read error? */
if (errno == EINTR) /* interruption */
continue;
return -1;
}
if (rc == 0) /* EOF */
return len - cnt;
bp += rc;
cnt -= rc;
}
return (len);
}
/**
* \brief Read a line from fd until end of file or \n is encountered
* @param fd Filedescriptor to read from
* @param bufptr Buffer to fill
* @param len buffer length
* @return Amount of bytes read
*/
int
network_gets(int fd, char *bufptr, size_t len)
{
char *bufx = bufptr;
static char *bp;
ssize_t cnt = 0;
static char b [1500];
char c;
if (len == 0) // prevent underflow
return -1;
while (--len > 0) {
if (--cnt <= 0) {
cnt = recv(fd, b, sizeof(b), 0);
if (cnt < 0) {
if (errno == EINTR) {
len++;
continue;
}
return -1;
}
if (cnt == 0)
return 0;
bp = b;
}
c = *bp++;
*bufptr++ = c;
if (c == '\n') {
*bufptr = '\0';
return bufptr - bufx;
}
}
errno = (EMSGSIZE);
return -1;
}
|
59df2f8a21629ac459fe58f58f18819dc0bb67ab
|
b5ca5bee3c335f456715a40d7fa4cccb51d20c64
|
/dp12txss/src/xdptxss_intr.c
|
c448d30c02168a5cf7c0a708d8ac00977e92f5dd
|
[] |
no_license
|
hbendaoudi/embeddedsw.github.io
|
910837dd4395eaa984a6a135056c02ebcac6a3e9
|
35b4e4ece75fddbe63047b2962b4f945b00512d9
|
refs/heads/master
| 2022-09-17T19:23:49.160865 | 2020-06-04T12:45:04 | 2020-06-04T12:45:04 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 13,590 |
c
|
xdptxss_intr.c
|
/******************************************************************************
* Copyright (C) 2015 - 2020 Xilinx, Inc. All rights reserved.
* SPDX-License-Identifier: MIT
******************************************************************************/
/*****************************************************************************/
/**
*
* @file xdptxss_intr.c
* @addtogroup dptxss_v5_2
* @{
*
* This file contains interrupt related functions of Xilinx DisplayPort TX
* Subsystem core. Please see xdptxss.h for more details of the core.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ---- --- -------- ---------------------------------------------------------
* 1.00 sha 01/29/15 Initial release.
* 2.00 sha 08/07/15 Added new handler types: lane count, link rate,
* Pre-emphasis voltage swing adjust and Set MSA.
* 2.00 sha 09/28/15 Added HDCP and Timer Counter interrupt handlers.
* 3.0 sha 02/19/16 Added switch cases for
* XDPTXSS_HANDLER_HDCP_RPTR_DWN_STRM_RDY and
* XDPTXSS_HANDLER_HDCP_RPTR_EXCHG to register callback
* with HDCP.
* 4.1 als 08/08/16 Synchronize with new HDCP APIs.
* 5.0 tu 09/08/17 Added two interrupt handler that addresses driver's
* internal callback function of application
* DrvHpdEventHandler and DrvHpdPulseHandler
* </pre>
*
******************************************************************************/
/***************************** Include Files *********************************/
#include "xdptxss.h"
/************************** Constant Definitions *****************************/
/***************** Macros (Inline Functions) Definitions *********************/
/**************************** Type Definitions *******************************/
/************************** Function Prototypes ******************************/
/************************** Variable Definitions *****************************/
/************************** Function Definitions *****************************/
/*****************************************************************************/
/**
*
* This function is the interrupt handler for the DisplayPort TX core operating
* in TX mode.
*
* The application is responsible for connecting this function to the interrupt
* system. Application beyond this driver is also responsible for providing
* callbacks to handle interrupts and installing the callbacks using
* XDpTxSs_SetCallBack() during initialization phase.
*
* @param InstancePtr is a pointer to the XDpTxSs core instance that
* just interrupted.
*
* @return None.
*
* @note None.
*
******************************************************************************/
void XDpTxSs_DpIntrHandler(void *InstancePtr)
{
XDpTxSs *XDpTxSsPtr = (XDpTxSs *)InstancePtr;
/* Verify arguments. */
Xil_AssertVoid(XDpTxSsPtr != NULL);
Xil_AssertVoid(XDpTxSsPtr->IsReady == XIL_COMPONENT_IS_READY);
/* DisplayPort TX interrupt handler */
XDp_InterruptHandler(XDpTxSsPtr->DpPtr);
}
#if (XPAR_XHDCP_NUM_INSTANCES > 0)
/*****************************************************************************/
/**
*
* This function is the interrupt handler for the HDCP Cipher core.
*
* The application is responsible for connecting this function to the interrupt
* system.
*
* @param InstancePtr is a pointer to the XDpTxSs core instance that
* just interrupted.
*
* @return None.
*
* @note None.
*
******************************************************************************/
void XDpTxSs_HdcpIntrHandler(void *InstancePtr)
{
XDpTxSs *XDpTxSsPtr = (XDpTxSs *)InstancePtr;
/* Verify arguments. */
Xil_AssertVoid(XDpTxSsPtr != NULL);
Xil_AssertVoid(XDpTxSsPtr->IsReady == XIL_COMPONENT_IS_READY);
/* HDCP Cipher interrupt handler */
XHdcp1x_CipherIntrHandler(XDpTxSsPtr->Hdcp1xPtr);
}
/*****************************************************************************/
/**
*
* This function is the interrupt handler for the Timer Counter core.
*
* The application is responsible for connecting this function to the interrupt
* system.
*
* @param InstancePtr is a pointer to the XDpTxSs core instance that
* just interrupted.
*
* @return None.
*
* @note None.
*
******************************************************************************/
void XDpTxSs_TmrCtrIntrHandler(void *InstancePtr)
{
XDpTxSs *XDpTxSsPtr = (XDpTxSs *)InstancePtr;
/* Verify arguments. */
Xil_AssertVoid(XDpTxSsPtr != NULL);
Xil_AssertVoid(XDpTxSsPtr->IsReady == XIL_COMPONENT_IS_READY);
/* Timer Counter interrupt handler */
XTmrCtr_InterruptHandler(XDpTxSsPtr->TmrCtrPtr);
}
#endif
/*****************************************************************************/
/**
*
* This function is process some DP driver read as per DP spec on HPD EVENT.
*
* @param InstancePtr is a pointer to the XDpTxSs core instance that
* just interrupted.
*
* @return None.
*
* @note None.
*
******************************************************************************/
void XDpTxSs_HpdEventProcess(void *InstancePtr)
{
u32 Status = XST_SUCCESS;
XDpTxSs *XDpTxSsPtr = (XDpTxSs *)InstancePtr;
/* Verify arguments. */
Xil_AssertVoid(XDpTxSsPtr != NULL);
Xil_AssertVoid(XDpTxSsPtr->IsReady == XIL_COMPONENT_IS_READY);
XDpTxSs_UsrHpdEventData *UsrHpdEventData = &XDpTxSsPtr->UsrHpdEventData;
if (XDp_TxIsConnected(XDpTxSsPtr->DpPtr)) {
/* From here is the requirement per DP spec */
Status = XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_MAX_LINK_RATE, 1,
&UsrHpdEventData->MaxCapNew);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_MAX_LANE_COUNT, 1,
&UsrHpdEventData->MaxCapLanesNew);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr, XDP_DPCD_REV, 12,
UsrHpdEventData->Tmp);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_SINK_COUNT, 6, UsrHpdEventData->Tmp);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr, XDP_DPCD_REV, 11,
&UsrHpdEventData->Dpcd);
Status |= XDp_TxGetEdidBlock(XDpTxSsPtr->DpPtr,
UsrHpdEventData->EdidOrg, 0);
if (UsrHpdEventData->EdidOrg[XDP_EDID_EXT_BLOCK_COUNT] > 0)
Status |= XDp_TxGetEdidBlock(XDpTxSsPtr->DpPtr,
UsrHpdEventData->EdidOrg_1,
1);
if (UsrHpdEventData->EdidOrg_1[XDP_EDID_EXT_BLOCK_COUNT] > 1)
Status |= XDp_TxGetEdidBlock(XDpTxSsPtr->DpPtr,
UsrHpdEventData->EdidOrg_2,
2);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr, XDP_DPCD_SINK_COUNT,
1, &UsrHpdEventData->Rd200);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_STATUS_LANE_0_1, 1,
&UsrHpdEventData->Lane0Sts);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_STATUS_LANE_2_3, 1,
&UsrHpdEventData->Lane2Sts);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_MAX_LINK_RATE, 1,
&UsrHpdEventData->MaxCapNew);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_MAX_LANE_COUNT, 1,
&UsrHpdEventData->MaxCapLanesNew);
}
if(Status != XST_SUCCESS){
xdbg_printf(XDBG_DEBUG_GENERAL, "AUX access had trouble!\r\n");
}
}
/*****************************************************************************/
/**
*
* This function is process some DP driver read as per DP spec on HPD Pulse.
*
* @param InstancePtr is a pointer to the XDpTxSs core instance that
* just interrupted.
*
* @return None.
*
* @note None.
*
******************************************************************************/
void XDpTxSs_HpdPulseProcess(void *InstancePtr)
{
u32 Status = XST_SUCCESS;
XDpTxSs *XDpTxSsPtr = (XDpTxSs *)InstancePtr;
/* Verify arguments. */
Xil_AssertVoid(XDpTxSsPtr != NULL);
Xil_AssertVoid(XDpTxSsPtr->IsReady == XIL_COMPONENT_IS_READY);
XDpTxSs_UsrHpdPulseData *UsrHpdPulseData = &XDpTxSsPtr->UsrHpdPulseData;
//reading the first block of EDID
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_SINK_COUNT, 6, UsrHpdPulseData->AuxValues);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_STATUS_LANE_0_1, 1,
&UsrHpdPulseData->Lane0Sts);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_STATUS_LANE_2_3, 1,
&UsrHpdPulseData->Lane2Sts);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_LANE_ALIGN_STATUS_UPDATED, 1,
&UsrHpdPulseData->LaneAlignStatus);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_LANE_COUNT_SET, 1,
&UsrHpdPulseData->LaneSet);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_LINK_BW_SET, 1, &UsrHpdPulseData->BwSet);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_LINK_BW_SET, 1, &UsrHpdPulseData->BwSet);
Status |= XDp_TxAuxRead(XDpTxSsPtr->DpPtr,
XDP_DPCD_LANE_COUNT_SET, 1, &UsrHpdPulseData->LaneSet);
Status |= XDp_TxGetEdidBlock(XDpTxSsPtr->DpPtr, UsrHpdPulseData->Edid,
0);
if(Status != XST_SUCCESS){
xdbg_printf(XDBG_DEBUG_GENERAL, "AUX access had trouble!\r\n");
}
}
/*****************************************************************************/
/**
*
* This function installs an asynchronous callback function for the given
* HandlerType:
*
* <pre>
* HandlerType Callback Function HandlerType
* ---------------------------------------- ------------------------------------
* (XDPTXSS_HANDLER_DP_HPD_EVENT) XDP_TX_HANDLER_HPDEVENT
* (XDPTXSS_HANDLER_DP_HPD_PULSE) XDP_TX_HANDLER_HPDPULSE
* (XDPTXSS_HANDLER_DP_LANE_COUNT_CHG) XDP_TX_HANDLER_LANECNTCHANGE
* (XDPTXSS_HANDLER_DP_LINK_RATE_CHG) XDP_TX_HANDLER_LINKRATECHANGE
* (XDPTXSS_HANDLER_DP_PE_VS_ADJUST) XDP_TX_HANDLER_PEVSADJUST
* (XDPTXSS_HANDLER_HDCP_RPTR_EXCHG) XHdcp1x_SetCallBack
* (XDPTXSS_HANDLER_DP_SET_MSA) XDP_TX_HANDLER_SETMSA
* </pre>
*
* @param InstancePtr is a pointer to the XDpTxSs core instance.
* @param HandlerType specifies the type of handler.
* @param CallbackFunc is the address of the callback function.
* @param CallbackRef is a user data item that will be passed to the
* callback function when it is invoked.
*
* @return
* - XST_SUCCESS if callback function installed successfully.
* - XST_INVALID_PARAM when HandlerType is invalid.
*
* @note Invoking this function for a handler that already has been
* installed replaces it with the new handler.
*
******************************************************************************/
u32 XDpTxSs_SetCallBack(XDpTxSs *InstancePtr, u32 HandlerType,
void *CallbackFunc, void *CallbackRef)
{
u32 Status;
/* Verify arguments. */
Xil_AssertNonvoid(InstancePtr != NULL);
Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
Xil_AssertNonvoid(HandlerType >= XDPTXSS_HANDLER_DP_HPD_EVENT);
Xil_AssertNonvoid(CallbackFunc != NULL);
Xil_AssertNonvoid(CallbackRef != NULL);
/* Assign callback based on handler type */
switch (HandlerType) {
case XDPTXSS_HANDLER_DP_HPD_EVENT:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_HPDEVENT,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
case XDPTXSS_DRV_HANDLER_DP_HPD_EVENT:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_DRV_HPDEVENT,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
case XDPTXSS_HANDLER_DP_HPD_PULSE:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_HPDPULSE,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
case XDPTXSS_DRV_HANDLER_DP_HPD_PULSE:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_DRV_HPDPULSE,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
case XDPTXSS_HANDLER_DP_LANE_COUNT_CHG:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_LANECNTCHANGE,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
case XDPTXSS_HANDLER_DP_LINK_RATE_CHG:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_LINKRATECHANGE,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
case XDPTXSS_HANDLER_DP_PE_VS_ADJUST:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_PEVSADJUST,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
#if (XPAR_XHDCP_NUM_INSTANCES > 0)
case XDPTXSS_HANDLER_HDCP_RPTR_EXCHG:
XHdcp1x_SetCallBack(InstancePtr->Hdcp1xPtr,
XHDCP1X_RPTR_HDLR_REPEATER_EXCHANGE,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
#endif
case XDPTXSS_HANDLER_DP_SET_MSA:
XDp_TxSetCallback(InstancePtr->DpPtr,
XDP_TX_HANDLER_SETMSA,
CallbackFunc, CallbackRef);
Status = XST_SUCCESS;
break;
default:
Status = XST_INVALID_PARAM;
break;
}
return Status;
}
/*****************************************************************************/
/**
*
* This function installs a custom delay/sleep function to be used by the
* DisplayPort TX Subsystem.
*
* @param InstancePtr is a pointer to the XDpTxSs instance.
* @param CallbackFunc is the address to the callback function.
* @param CallbackRef is the user data item (microseconds to delay) that
* will be passed to the custom sleep/delay function when it is
* invoked.
*
* @return None.
*
* @note None.
*
******************************************************************************/
void XDpTxSs_SetUserTimerHandler(XDpTxSs *InstancePtr,
XDpTxSs_TimerHandler CallbackFunc, void *CallbackRef)
{
/* Verify arguments. */
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(CallbackFunc != NULL);
Xil_AssertVoid(CallbackRef != NULL);
/* Set custom timer wait handler */
XDp_SetUserTimerHandler(InstancePtr->DpPtr, CallbackFunc, CallbackRef);
}
/** @} */
|
479e1ad5f96d3b659cd41ba148cb7435fcb00ced
|
737617ebe87a5f53edbf1334532a53dcd070b09b
|
/Shared/SocketShared.h
|
a00712d0d44879baf9b8e6b8bab3af5d49b76e4e
|
[] |
no_license
|
tomerperetz/EX4
|
92de87f3292bbe8f9fa17de3e0300c7e1624a41c
|
093ed8b77fa8fa679a2b77185e0a58b571728274
|
refs/heads/master
| 2020-12-09T05:36:35.809478 | 2020-01-25T14:57:29 | 2020-01-25T14:57:29 | 233,207,884 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,727 |
h
|
SocketShared.h
|
#pragma once
/*
=================================================================================
Description
=================================================================================
Socket shared functions and defines
=================================================================================
*/
#ifndef SOCKET_EXAMPLE_SHARED_H
#define SOCKET_EXAMPLE_SHARED_H
/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/
#define SERVER_ADDRESS_STR "127.0.0.1"
#define IP_MAX_LEN 20
#define PORT_MAX_LEN 33
#define WAITING_TIME_MILLI_SEC 1500
#define WAIT_FOR_ALL_RESOURCE_TO_CLOSE 60000
#define STRINGS_ARE_EQUAL( Str1, Str2 ) ( strcmp( (Str1), (Str2) ) == 0 )
#define CLIENT_REQUEST "CLIENT_REQUEST"
#define CLIENT_MAIN_MENU "CLIENT_MAIN_MENU"
#define CLIENT_CPU "CLIENT_CPU"
#define CLIENT_VERSUS "CLIENT_VERSUS"
#define CLIENT_PLAYER_MOVE "CLIENT_PLAYER_MOVE"
#define CLIENT_REPLAY "CLIENT_REPLAY"
#define CLIENT_REFRESH "CLIENT_REFRESH"
#define CLIENT_DISCONNECT "CLIENT_DISCONNECT"
#define SERVER_MAIN_MENU "SERVER_MAIN_MENU"
#define SERVER_APPROVED "SERVER_APPROVED"
#define SERVER_DENIED "SERVER_DENIED"
#define SERVER_INVITE "SERVER_INVITE"
#define SERVER_PLAYER_MOVE_REQUEST "SERVER_PLAYER_MOVE_REQUEST"
#define SERVER_GAME_RESULTS "SERVER_GAME_RESULTS"
#define SERVER_GAME_OVER_MENU "SERVER_GAME_OVER_MENU"
#define SERVER_OPPONENT_QUIT "SERVER_OPPONENT_QUIT"
#define SERVER_NO_OPPONENT "SERVER_NO_OPPONENT"
typedef struct _Socket_info
{
SOCKET socket;
char ip_addres[IP_MAX_LEN];
char port_num_char[PORT_MAX_LEN];
SOCKADDR_IN sock_adrr;
BOOL server_not_client;
} Socket_info;
/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/
#endif
|
de3a8c4c96ccbf7330cb0150262a70ed2769974a
|
3b97a778d0923042a3d9736d201e5f18998047f4
|
/581.ShortestUnorderedContiguousSubarray/581.ShortestUnorderedContiguousSubarray.c
|
79897b12c1c91928d62c6a947a6208507c82e39f
|
[] |
no_license
|
18291622484/lc-
|
9b96beec9f933af31dc0248daaf27df0905d7b28
|
93b77ced3eb68eba71abe8ace3fee2a66e36eacb
|
refs/heads/master
| 2023-04-05T05:04:53.308147 | 2021-04-08T00:52:46 | 2021-04-08T00:52:46 | 319,203,421 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,256 |
c
|
581.ShortestUnorderedContiguousSubarray.c
|
int main() {
//int findUnsortedSubarray(int* nums, int numsSize) {
// int begin = 0;
// int end = numsSize - 1;
// int flag = 0;
// while (begin < end) {
// if (nums[begin] < nums[begin + 1])
// flag = ++begin;
// else if (nums[begin] == nums[begin + 1])
// ++begin;
// else {
// begin = flag;
// flag = end;
// break;
// }
// }
// while (begin < end) {
// if (nums[end] > nums[end - 1])
// flag = --end;
// else if (nums[end] == nums[end - 1])
// --end;
// else {
// end = flag;
// break;
// }
// }
// if (begin >= end)
// return 0;
// int max = begin;
// int min = begin;
// for (int i = begin; i <= end; i++) {
// if (nums[i] < nums[min])
// min = i;
// if (nums[i] > nums[max])
// max = i;
// }
// while (--begin >= 0 && nums[begin] > nums[min]) {}
// while (++end <= numsSize - 1 && nums[end] < nums[max]) {}
// return end - begin - 1;
//}
return 0;
}
|
4bc631c6bd60a39f00fe58b54e9982660b827e2e
|
a2b703a6cedb4f2e34c0f10ddf783632548855e5
|
/adm/daemons/history_d.c
|
c6b395ab6aa388e3f5fec5ebed645483193671b8
|
[] |
no_license
|
flyingstupid/gblib
|
a284b2769bb5eabce6222c892cf716958cb3c6a2
|
6c00afae0ab36709e50823622aee1e99645fe78b
|
refs/heads/master
| 2021-04-27T05:34:28.518374 | 2018-04-20T15:51:28 | 2018-04-20T15:51:28 | 122,598,484 | 1 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 10,596 |
c
|
history_d.c
|
/* history_d.c
*
* Tricky
* 8-OCT-2007
* History daemon
*
*/
#define DEFAULT_HISTORY_DIR "/data/daemons/history_d"
#define HISTORY_DATA_FILE "/data/daemons/history_d/history"
#define DEFAULT_HISTORY_SIZE 500
/* Private vars */
privatev mapping History, FileHistory;
/* Public vars */
mapping HistoryDir, HistorySize, ChannelIndex;
/* Private funcs */
privatef int save_daemon();
privatef int restore_daemon();
/* Public funcs */
mapping fix_chan_index();
/*
* Function name: create
* Description: Initialise the object data.
*/
void create()
{
History = ([ ]);
FileHistory = ([ ]);
restore_daemon();
if (!HistoryDir) HistoryDir = ([ ]);
if (!HistorySize) HistorySize = ([ ]);
if (!ChannelIndex) ChannelIndex = ([ ]);
fix_chan_index();
save_daemon();
}
/*
* Function name: remove
* Description: Saves the object data and destructs itself.
*/
void remove()
{
save_daemon();
destruct();
}
/*
* Function name: set_history_dir
* Description: Set the history directory of the specified channel.
* Arguments: channel - Channel name.
*
* Optional arguments:-
* dir - Directory path.
*/
varargs void set_history_dir(string channel, string dir)
{
if (undefinedp(dir) || !stringp(dir) || dir == "")
HistoryDir[channel] = DEFAULT_HISTORY_DIR;
else HistoryDir[channel] = dir;
}
/*
* Function name: query_history_dir
* Description: Queries the history directory of the specified channel.
* Arguments: channel - Channel name.
* Return: History directory path.
*/
string query_history_dir(string channel)
{
if (member_array(channel, keys(HistoryDir)) == -1)
return DEFAULT_HISTORY_DIR;
return HistoryDir[channel];
}
/*
* Function name: set_history_size
* Description: Set the history size of the specified channel.
* Arguments: channel - Channel name.
*
* Optional arguments:-
* size - Size of history buffer.
*/
varargs void set_history_size(string channel, int size)
{
if (undefinedp(size) || !intp(size) || size == 0)
HistorySize[channel] = DEFAULT_HISTORY_SIZE;
else HistorySize[channel] = size;
}
/*
* Function name: query_history_size
* Description: Queries the history size of the specified channel.
* Arguments: channel - Channel name.
* Return: History buffer size.
*/
int query_history_size(string channel)
{
if (member_array(channel, keys(HistorySize)) == -1)
return DEFAULT_HISTORY_SIZE;
return HistorySize[channel];
}
/*
* Function name: set_chan_index
* Description: Set the index number of the specified channel.
* Arguments: channel - Channel name.
* index - Channel index.
*/
void set_chan_index(string channel, int index)
{
ChannelIndex[channel] = index;
save_daemon();
}
/*
* Function name: remove_chan_index
* Description: Removes the index number of the specified channel.
* Arguments: channel - Channel name.
*/
void remove_chan_index(string channel)
{
map_delete(ChannelIndex, channel);
save_daemon();
}
/*
* Function name: query_chan_index
* Description: Queries the index number of the specified channel.
* Arguments: channel - Channel name.
* Return: Channel index or -1 if it doesn't exist.
*/
int query_chan_index(string channel)
{
if (ChannelIndex && member_array(channel, keys(ChannelIndex)) != -1)
return ChannelIndex[channel];
return -1;
}
/*
* Function name: set_chan_indexes
* Description: Set the index number of all channels.
* Arguments: index - Channel index.
*/
void set_chan_indexes(int index)
{
foreach (string channel in keys(ChannelIndex))
set_chan_index(channel, index);
}
/*
* Function name: fix_chan_index
* Description: Fix the channel index mapping.
* Return: Fixed channel index mapping.
*/
mapping fix_chan_index()
{
mapping new_channel_index = ([ ]);
if (!mapp(ChannelIndex) || sizeof(ChannelIndex) < 1) return 0;
foreach (string channel, int index in ChannelIndex)
{
mixed array files;
string basedir;
int tmp;
basedir = query_history_dir(channel) + "/" + channel + "-";
files = get_dir(basedir + "*");
if (!arrayp(files) || sizeof(files) < 1) continue;
files = sort_array(files, 1);
if (sizeof(files) < 1) continue;
tmp = to_int(files[<1][strsrch(files[<1], "-", -1) + 1..<1]);
new_channel_index[channel] = index;
if (tmp == index) continue;
new_channel_index[channel] = tmp;
}
ChannelIndex = copy(new_channel_index);
save_daemon();
return copy(ChannelIndex);
}
/*
* Function name: set_history
* Description: Initialises the history buffers.
* Arguments: channel - History channel.
* message - Array of text messages.
*
* Optional arguments:-
* append - If set then append the messages to the end of the buffer.
*/
varargs void set_history(string channel, string array message, int append)
{
int size;
if (member_array(channel, keys(History)) == -1)
History[channel] = ({ });
if (member_array(channel, keys(FileHistory)) == -1)
FileHistory[channel] = ({ });
if (!undefinedp(append))
{
History[channel] += message;
FileHistory[channel] += message;
}
else
{
History[channel] = message;
FileHistory[channel] = message;
}
if (member_array(channel, keys(HistorySize)) == -1)
size = DEFAULT_HISTORY_SIZE;
else size = HistorySize[channel];
if (sizeof(History[channel]) > size)
History[channel] = History[channel][sizeof(History[channel]) - size..<1];
if (sizeof(FileHistory[channel]) > size)
FileHistory[channel] = FileHistory[channel][size..<1];
save_daemon();
}
/*
* Function name: add_history
* Description: Add messages to the history buffer.
* Arguments: channel - History channel.
* message - Array of text messages.
*/
void add_history(string channel, string array message)
{
string array msg = ({ });
string saveVar = "", dir;
int size;
if (member_array(channel, keys(History)) == -1)
History[channel] = ({ });
if (member_array(channel, keys(FileHistory)) == -1)
FileHistory[channel] = ({ });
foreach (string line in message)
msg += ({ sprintf("%s %s", ctime(time()), line) });
History[channel] += msg;
FileHistory[channel] += msg;
if (member_array(channel, keys(HistoryDir)) == -1)
dir = DEFAULT_HISTORY_DIR;
else dir = HistoryDir[channel];
if (member_array(channel, keys(HistorySize)) == -1)
size = DEFAULT_HISTORY_SIZE;
else size = HistorySize[channel];
if (sizeof(History[channel]) > size)
History[channel] = History[channel][sizeof(History[channel]) - size..<1];
if (sizeof(FileHistory[channel]) > size)
{
foreach (string line in FileHistory[channel][0..size - 1])
saveVar += line;
write_file(dir + "/" + channel + "-" + sprintf("%08i", ChannelIndex[channel]), saveVar, 1);
ChannelIndex[channel]++;
saveVar = "";
FileHistory[channel] = FileHistory[channel][size..<1];
foreach (string line in FileHistory[channel]) saveVar += line;
}
else foreach (string line in msg) saveVar += line;
write_file(dir + "/" + channel + "-" + sprintf("%08i", ChannelIndex[channel]), saveVar);
save_daemon();
}
/*
* Function name: rem_history
* Description: Remove a history buffer from the mapping.
* Arguments: channel - History channel.
*/
void rem_history(string channel)
{
if (member_array(channel, keys(History)) != -1)
map_delete(History, channel);
}
/*
* Function name: rem_file_history
* Description: Remove a file history buffer from the mapping.
* Arguments: channel - History channel.
*/
void rem_file_history(string channel)
{
if (member_array(channel, keys(FileHistory)) != -1)
map_delete(FileHistory, channel);
}
/*
* Function name: get_history
* Description: Gets the history mapping.
* Return: A copy of the history mapping.
*/
mapping get_history()
{
return copy(History);
}
/*
* Function name: get_file_history
* Description: Gets the file history mapping.
* Return: A copy of the file history mapping.
*/
mapping get_file_history()
{
return copy(FileHistory);
}
/*
* Function name: load_channel_history
* Description: Loads a channel's history and initializes the mappings.
* Arguments: channel - History channel.
*/
void load_channel_history(string channel)
{
string indexStr;
int index;
if (!ChannelIndex) ChannelIndex = ([ channel: 0 ]);
else if (member_array(channel, keys(ChannelIndex)) == -1)
ChannelIndex[channel] = 0;
index = ChannelIndex[channel];
if (index > 0)
{
indexStr = sprintf("%08i", index - 1);
if (file_exists(query_history_dir(channel) + "/" + channel + "-" + indexStr))
{
string array arr_lines = ({ });
string lines = read_file(query_history_dir(channel) + "/" + channel + "-" + indexStr);
foreach (string line in explode(lines, "\n"))
arr_lines += ({ line + "\n" });
set_history(channel, arr_lines);
}
else
set_history(channel, ({ }) );
}
indexStr = sprintf("%08i", index);
if (file_exists(query_history_dir(channel) + "/" + channel + "-" + indexStr))
{
string array arr_lines = ({ });
string lines = read_file(query_history_dir(channel) + "/" + channel + "-" + indexStr);
foreach (string line in explode(lines, "\n"))
arr_lines += ({ line + "\n" });
set_history(channel, arr_lines, 1);
}
else
set_history(channel, ({ }), 1);
save_daemon();
}
/*
* Function name: save_daemon
* Description: Saves the object data.
* Return: Success or failure.
*/
privatef int save_daemon()
{
if (!directory_exists(implode(explode(HISTORY_DATA_FILE, "/")[0..<2], "/")))
mkdir(implode(explode(HISTORY_DATA_FILE, "/")[0..<2], "/"));
return save_object(HISTORY_DATA_FILE);
}
/*
* Function name: restore_daemon
* Description: Restores the object data.
* Return: Success or failure.
*/
privatef int restore_daemon()
{
if (file_exists(HISTORY_DATA_FILE + ".o"))
return restore_object(HISTORY_DATA_FILE);
return 0;
}
|
803fa2aa0a0d4f2db1e44bdb06a44f71597c0526
|
93a014bbe7e5cdd15465d8b959b91489b301aed1
|
/components/service/uai/function/convolution/uai_conv.c
|
96ae224365f46054dc75d9f727fcd5bde1374a94
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
HelloAllen8893/AliOS-Things
|
5fee7e24a721d0c8d5524ffa35d3680581ef7576
|
f3a2904860c3bf87b64d634e6900d980931fac88
|
refs/heads/master
| 2021-07-14T15:59:36.425493 | 2020-05-19T06:31:58 | 2020-05-21T05:51:59 | 141,670,680 | 0 | 0 |
Apache-2.0
| 2020-06-05T07:38:13 | 2018-07-20T06:08:08 |
C
|
UTF-8
|
C
| false | false | 17,068 |
c
|
uai_conv.c
|
/*
* Copyright (C) 2015-2019 Alibaba Group Holding Limited
*/
#include "uai_function.h"
#ifdef UAI_USE_CMSIS_NN
#include "arm_math.h"
#include "arm_nnfunctions.h"
#endif
#ifdef UAI_ODLA_SUPPORT
#ifdef UAI_USE_CMSIS_NN
#define CONV_SQUARE_PARM input->buffer, \
input->dim_height, \
input->dim_channels, \
kernel->buffer, \
kernel->dim_kel_out_ch, \
kernel->dim_kel_height, \
padding_x, \
strides[0], \
bias->buffer, \
kernel_scale, \
bias_scale, \
act_scale, \
shift, \
(int32_t *)output->buffer, \
output->dim_height, \
buffer_input, \
NULL
#define CONV_NON_SQUARE_PARM input->buffer, \
input->dim_height, \
input->dim_width, \
input->dim_channels, \
kernel->buffer, \
kernel->dim_kel_out_ch, \
kernel->dim_height, \
kernel->dim_width, \
padding_x, \
padding_y, \
strides[0], \
strides[1], \
bias->buffer, \
kernel_scale, \
bias_scale, \
act_scale, \
shift, \
(int32_t *)output->buffer, \
output->dim_height, \
output->dim_width, \
buffer_input, \
NULL
extern arm_status arm_convolve_HWC_q7_basic_uai(const q7_t * Im_in,
const uint16_t dim_im_in,
const uint16_t ch_im_in,
const q7_t * wt,
const uint16_t ch_im_out,
const uint16_t dim_kernel,
const uint16_t padding,
const uint16_t stride,
const q7_t *bias,
const uint32_t *kernel_scale,
const uint32_t *bias_scale,
const uint32_t act_scale,
const int8_t shift,
q7_t * Im_out,
const uint16_t dim_im_out,
q15_t * bufferA,
q7_t * bufferB);
extern arm_status arm_convolve_HWC_q7_fast_uai(const q7_t * Im_in,
const uint16_t dim_im_in,
const uint16_t ch_im_in,
const q7_t * wt,
const uint16_t ch_im_out,
const uint16_t dim_kernel,
const uint16_t padding,
const uint16_t stride,
const q7_t *bias,
const uint32_t *kernel_scale,
const uint32_t *bias_scale,
const uint32_t act_scale,
const int8_t shift,
q7_t * Im_out,
const uint16_t dim_im_out,
q15_t * bufferA,
q7_t * bufferB);
extern arm_status arm_convolve_HWC_q7_RGB_uai(const q7_t * Im_in,
const uint16_t dim_im_in,
const uint16_t ch_im_in,
const q7_t * wt,
const uint16_t ch_im_out,
const uint16_t dim_kernel,
const uint16_t padding,
const uint16_t stride,
const q7_t *bias,
const uint32_t *kernel_scale,
const uint32_t *bias_scale,
const uint32_t act_scale,
const int8_t shift,
q7_t * Im_out,
const uint16_t dim_im_out,
q15_t * bufferA, q7_t * bufferB);
extern arm_status arm_convolve_HWC_q7_basic_nonsquare_uai(const q7_t * Im_in,
const uint16_t dim_im_in_x,
const uint16_t dim_im_in_y,
const uint16_t ch_im_in,
const q7_t * wt,
const uint16_t ch_im_out,
const uint16_t dim_kernel_x,
const uint16_t dim_kernel_y,
const uint16_t padding_x,
const uint16_t padding_y,
const uint16_t stride_x,
const uint16_t stride_y,
const q7_t *bias,
const uint32_t *kernel_scale,
const uint32_t *bias_scale,
const uint32_t act_scale,
const int8_t shift,
q7_t * Im_out,
const uint16_t dim_im_out_x,
const uint16_t dim_im_out_y,
q15_t * bufferA,
q7_t * bufferB);
extern arm_status arm_convolve_HWC_q7_fast_nonsquare_uai(const q7_t * Im_in,
const uint16_t dim_im_in_x,
const uint16_t dim_im_in_y,
const uint16_t ch_im_in,
const q7_t * wt,
const uint16_t ch_im_out,
const uint16_t dim_kernel_x,
const uint16_t dim_kernel_y,
const uint16_t padding_x,
const uint16_t padding_y,
const uint16_t stride_x,
const uint16_t stride_y,
const q7_t *bias,
const uint32_t *kernel_scale,
const uint32_t *bias_scale,
const uint32_t act_scale,
const int8_t shift,
q7_t * Im_out,
const uint16_t dim_im_out_x,
const uint16_t dim_im_out_y,
q15_t * bufferA,
q7_t * bufferB);
extern arm_status arm_convolve_1x1_HWC_q7_fast_nonsquare_uai(const q7_t * Im_in,
const uint16_t dim_im_in_x,
const uint16_t dim_im_in_y,
const uint16_t ch_im_in,
const q7_t * wt,
const uint16_t ch_im_out,
const uint16_t dim_kernel_x,
const uint16_t dim_kernel_y,
const uint16_t padding_x,
const uint16_t padding_y,
const uint16_t stride_x,
const uint16_t stride_y,
const q7_t *bias,
const uint32_t *kernel_scale,
const uint32_t *bias_scale,
const uint32_t act_scale,
const int8_t shift,
q7_t * Im_out,
const uint16_t dim_im_out_x,
const uint16_t dim_im_out_y,
q15_t * bufferA,
q7_t * bufferB);
#endif
int uai_conv_2d(uai_tensor_s *input, uai_tensor_s *kernel, uint16_t *strides, const unsigned* paddings_front,
const unsigned* paddings_back, uai_tensor_s *bias, const uint32_t *kernel_scale,
const uint32_t *bias_scale, const uint32_t act_scale, const uint32_t shift, uai_tensor_s *output)
{
int8_t *buffer_input = NULL;
uint16_t padding_x = (paddings_front[0] + paddings_back[0])/2;
uint16_t padding_y = (paddings_front[1] + paddings_back[1])/2;
int32_t ret = -1;
#if defined(UAI_USE_CMSIS_NN)
arm_status arm_ret = ARM_MATH_SUCCESS;
if(input->dim_batch != 1) {
return UAI_FAIL;
}
#if defined (ARM_MATH_DSP)
#ifdef UAI_MEM_STATIC
buffer_input = UAI_CONV_TEMP_MEM;
#else
buffer_input = uai_malloc(sizeof(uint16_t) * input->size);
#endif
#endif
if(input->dim_height == input->dim_width) {
if((input->dim_channels % 4 == 0)&&(output->dim_channels % 2 == 0)) {
arm_ret = arm_convolve_HWC_q7_fast_uai(CONV_SQUARE_PARM);
} else if (input->dim_channels % 3 == 0) {
arm_ret = arm_convolve_HWC_q7_RGB_uai(CONV_SQUARE_PARM);
} else {
arm_ret = arm_convolve_HWC_q7_basic_uai(CONV_SQUARE_PARM);
}
} else {
if((input->dim_channels % 4 == 0)&&(output->dim_channels % 2 == 0)) {
if((kernel->dim_kel_height == 1) && (kernel->dim_kel_width == 1) &&
(strides[0] == 1) && (strides[1] == 1) &&
(padding_x == 0) && (padding_y == 0)){
arm_ret = (int32_t)arm_convolve_1x1_HWC_q7_fast_nonsquare_uai(CONV_NON_SQUARE_PARM);
} else {
arm_ret = (int32_t)arm_convolve_HWC_q7_fast_nonsquare_uai(CONV_NON_SQUARE_PARM);
}
}
else {
arm_ret = (int32_t)arm_convolve_HWC_q7_basic_nonsquare_uai(CONV_NON_SQUARE_PARM);
}
}
#if defined (ARM_MATH_DSP)
#ifndef UAI_MEM_STATIC
uai_free(buffer_input);
#endif
#endif
ret = (arm_ret == ARM_MATH_SUCCESS) ? UAI_SUCCESS : UAI_FAIL;
#else
#endif
return ret;
}
int uai_conv(uai_tensor_s *input, uai_tensor_s *kernel, uint16_t *strides, const unsigned* paddings_front,
const unsigned* paddings_back, uai_tensor_s *bias, const uint32_t *kernel_scale,
const uint32_t *bias_scale, const uint32_t act_scale, const uint32_t shift, uai_tensor_s *output)
{
if((input->dim_height != 0) && (input->dim_width != 0)){
return uai_conv_2d(input, kernel, strides, paddings_front, paddings_back, bias, kernel_scale,
bias_scale, act_scale, shift, output);
}
return UAI_FAIL;
}
#else
#define CONV_SQUARE_PARM input->buffer, \
input->height, \
input->channels, \
weight->buffer, \
weight->out_channels, \
weight->height, \
padding_x, \
strides[0], \
bias->buffer, \
bias->shift, \
output->shift, \
output->buffer, \
output->height, \
buffer_input, \
NULL
#define CONV_NON_SQUARE_PARM input->buffer, \
input->height, \
input->width, \
input->channels, \
weight->buffer, \
weight->out_channels, \
weight->height, \
weight->width, \
padding_x, \
padding_y, \
strides[0], \
strides[1], \
bias->buffer, \
bias->shift, \
output->shift, \
output->buffer, \
output->height, \
output->width, \
buffer_input, \
NULL
int uai_conv_2d(uai_input_s *input, uai_weight_s *weight, uint16_t *strides, uai_pad_type_e pad_type, uai_bias_s *bias, uai_output_s *output)
{
int8_t *buffer_input = NULL;
uint16_t padding_x = 0;
uint16_t padding_y = 0;
int16_t temp = 0;
int32_t ret = -1;
#if defined(UAI_USE_CMSIS_NN)
#if defined (ARM_MATH_DSP)
#ifdef UAI_MEM_STATIC
buffer_input = UAI_CONV_TEMP_MEM;
#else
buffer_input = uai_malloc(sizeof(uint16_t) * input->size);
#endif
#endif
if(pad_type == UAI_PAD_SAME) {
output->height = (input->height + input->height % strides[0]) / strides[0] ;
output->width = (input->width + input->width % strides[1]) / strides[1] ;
temp = (output->height - 1) * strides[0] + weight->height - input->height;
padding_x = (uint16_t)UAI_MAX(temp/2, 0);
temp = (output->width - 1) * strides[1] + weight->width - input->width;
padding_y = (uint16_t)UAI_MAX(temp/2, 0);
} else {
output->height = (input->height - weight->height) / strides[0];
output->width = (input->width - weight->width) / strides[1];
}
if(input->height == input->width) {
if((input->channels % 4 == 0)&&(weight->out_channels % 2 == 0)) {
ret = arm_convolve_HWC_q7_fast(CONV_SQUARE_PARM);
} else if (input->channels % 3 == 0) {
ret = arm_convolve_HWC_q7_RGB(CONV_SQUARE_PARM);
} else {
ret = arm_convolve_HWC_q7_basic(CONV_SQUARE_PARM);
}
} else {
if((input->channels % 4 == 0)&&(weight->out_channels % 2 == 0)) {
if((weight->height == 1) && (weight->width == 1) &&
(strides[0] == 1) && (strides[1] == 1) &&
(padding_x == 0) && (padding_y == 0)){
ret = arm_convolve_1x1_HWC_q7_fast_nonsquare(CONV_NON_SQUARE_PARM);
} else {
ret = arm_convolve_HWC_q7_fast_nonsquare(CONV_NON_SQUARE_PARM);
}
}
else {
ret = arm_convolve_HWC_q7_basic_nonsquare(CONV_NON_SQUARE_PARM);
}
}
#if defined (ARM_MATH_DSP)
#ifndef UAI_MEM_STATIC
uai_free(buffer_input);
#endif
#endif
#else
#endif
return ret;
}
int uai_conv(uai_input_s *input, uai_weight_s *weight, uint16_t *strides, uai_pad_type_e pad_type, uai_bias_s *bias, uai_output_s *output)
{
if((input->height != 0) && (input->width != 0) && (input->depth == 0)){
return uai_conv_2d(input, weight, strides, pad_type, bias, output);
}
return -1;
}
#endif
|
34310d151970c906733f7c1a5e31d0f63e0e03d4
|
ccf500b6aed04bc397c267595154e0452ce7d656
|
/FrontEndStore_classes.h
|
c2c3d77a18a30c1cf6a004903487eeb6a055f1a7
|
[
"MIT"
] |
permissive
|
NotDiscordOfficial/Fortnite_SDK
|
775361ea044a22f508c0a8b42eb9ffdf12662aca
|
58f8da148256f99cb35518003306fffee33c4a21
|
refs/heads/main
| 2023-05-25T23:47:11.201029 | 2021-06-09T03:55:35 | 2021-06-09T03:55:35 | 375,217,755 | 0 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 145 |
h
|
FrontEndStore_classes.h
|
// BlueprintGeneratedClass FrontEndStore.FrontEndStore_C
// Size: 0x238 (Inherited: 0x238)
struct AFrontEndStore_C : AFortLevelScriptActor {
};
|
94720b322227b18dba01d565056441e112ebeac7
|
0a73d713ef49cf29f92ad377bf6922a2cf386950
|
/targets/C.source/unicc4c/main.c
|
967694ff945727e6e10527c89a5dab82b74d34fd
|
[
"BSD-3-Clause",
"MIT"
] |
permissive
|
phorward/unicc
|
425f366fb10707ae0ffbb5c61eb77e0b04107838
|
98df1146d530317f556521cb80cc1a1f182031f5
|
refs/heads/main
| 2023-08-01T04:04:14.876117 | 2023-07-18T12:11:49 | 2023-07-18T12:13:57 | 83,437,767 | 58 | 10 |
MIT
| 2022-07-22T13:09:50 | 2017-02-28T13:49:54 |
C
|
UTF-8
|
C
| false | false | 3,800 |
c
|
main.c
|
/* -MODULE----------------------------------------------------------------------
UniCC4C
Copyright (C) 2010 by Phorward Software Technologies, Jan Max Meyer
http://www.phorward-software.com ++ contact<AT>phorward<DASH>software<DOT>com
File: main.c
Author: Jan Max Meyer
Usage: Program entry and parameter parsing.
----------------------------------------------------------------------------- */
/*
* Includes
*/
#include "unicc4c.h"
/*
* Global variables
*/
char* prefix;
XML_T parser;
/*
* Defines
*/
/*
* Functions
*/
/* -FUNCTION--------------------------------------------------------------------
Function: copyright()
Author: Jan Max Meyer
Usage: Prints a program copyright info message.
Parameters: void
Returns: void
~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Date: Author: Note:
----------------------------------------------------------------------------- */
void copyright( void )
{
fprintf( stderr, "UniCC4C v%s [build %s %s]\n",
UNICC4C_VERSION, __DATE__, __TIME__ );
fprintf( stderr, "Copyright (C) 2010 by "
"Phorward Software Technologies, Jan Max Meyer\n" );
fprintf( stderr, "http://www.phorward-software.com ++ "
"contact<at>phorward<dash>software<dot>com\n\n" );
}
/* -FUNCTION--------------------------------------------------------------------
Function: usage()
Author: Jan Max Meyer
Usage: Prints the program usage message.
Parameters: uchar* progname Name of the executable.
Returns: void
~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Date: Author: Note:
----------------------------------------------------------------------------- */
void usage( uchar* progname )
{
fprintf( stderr, "usage: %s [options]\n\n"
"\t-h --help Print this help\n"
"\t-V --version Print version and copyright\n",
progname );
}
/* -FUNCTION--------------------------------------------------------------------
Function: get_command_line()
Author: Jan Max Meyer
Usage: Analyzes the command line parameters passed to this program.
Parameters: int argc Argument count from main()
uchar** argv Argument values from main()
Returns: BOOLEAN TRUE, if command-line parameters
are correct, FALSE else.
~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Date: Author: Note:
----------------------------------------------------------------------------- */
BOOLEAN get_command_line( int argc, char** argv )
{
int i;
uchar* opt;
for( i = 1; i < argc; i++ )
{
if( *(argv[i]) == '-' )
{
opt = argv[i] + 1;
if( *opt == '-' )
opt++;
if( !strcmp( opt, "version" ) || !strcmp( opt, "V" ) )
{
copyright();
exit( EXIT_SUCCESS );
}
else if( !strcmp( opt, "help" ) || !strcmp( opt, "h" ) )
{
usage( *argv );
exit( EXIT_SUCCESS );
}
}
}
return TRUE;
}
/* -FUNCTION--------------------------------------------------------------------
Function: main()
Author: Jan Max Meyer
Usage: Program entry
Parameters: int argc Argument count
char** argv Argument values
Returns: int Program return code
~~~ CHANGES & NOTES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Date: Author: Note:
----------------------------------------------------------------------------- */
int main( int argc, char** argv )
{
uchar* code;
PROC( "main" );
if( !get_command_line( argc, argv ) )
RETURN( EXIT_FAILURE );
if( !( parser = xml_parse_file( argv[1] ) ) )
RETURN( EXIT_FAILURE );
if( !( prefix = xml_attr( parser, "prefix" ) ) )
prefix = "";
code = gen();
printf( "%s\n", code );
pfree( code );
RETURN( EXIT_SUCCESS );
}
|
30e8d51f910b543349fba603feab1b41e7451e61
|
6f28614db5f03e343ff2d3e648ce6a5d7bea6f4a
|
/03_basic_C/teach/13_loop4.c
|
a450e1a0a63c45732f30bbf2d346228056d8774d
|
[] |
no_license
|
SothanaV/Tutor
|
6a2d2f42eb467387125dacf9835dc2aef095ae89
|
24a5f2cf977262e9f386bacbb84dc3f64ddb7701
|
refs/heads/master
| 2022-11-24T07:21:06.786139 | 2020-12-29T15:36:36 | 2020-12-29T15:36:36 | 213,535,140 | 0 | 0 | null | 2022-11-22T03:36:41 | 2019-10-08T02:52:10 |
Jupyter Notebook
|
UTF-8
|
C
| false | false | 276 |
c
|
13_loop4.c
|
#include <stdio.h>
int main(int argc, char const *argv[])
{
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
printf("%d %d \n",i,j);
if(j==2)
{
break;
}
}
}
return 0;
}
|
38c08dd66f4df88582791c8bc8e651c21f724423
|
50da90ea117266cf294e15ec6731a39721bbcb58
|
/src/wiss/wiss/2/record/st_insertfrm.c
|
2781e99a1f64db9760b47498832dcfd68d17bfb1
|
[] |
no_license
|
anthony0727/graduation-project
|
5c8a1e6c9416f95276e7cda5aae6cdaa060ffa36
|
b4120e38454101d43c468cca53679dfc25eb5f3e
|
refs/heads/master
| 2021-12-12T18:02:00.054276 | 2021-11-08T06:21:50 | 2021-11-08T06:21:50 | 130,290,284 | 1 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 14,896 |
c
|
st_insertfrm.c
|
/********************************************************/
/* */
/* WiSS Storage System */
/* Version SystemV-4.0, September 1990 */
/* */
/* COPYRIGHT (C) 1990 */
/* David J. DeWitt */
/* Madison, WI U.S.A. */
/* */
/* ALL RIGHTS RESERVED */
/* */
/********************************************************/
#
/* Module st_insertframe : insert a string of bytes into a long data item
IMPORTS :
io_allocpages(fid, nearpid, numpages, pidarray)
bf_freebuf(filenum, pageid, pageptr)
bf_setdirty(filenum, pageid, pageptr)
r_initslice(filenum, pageid, returnpage, trans_id)
r_getslot(filenum, ridptr, page, recptr, trans_id, lockup, mode, cond)
r_shrinkslice(filenum, ridptr, length, trans_id, lockup, cond)
r_expandcrumb(filenum, ridptr, length, trans_id, lockup, cond)
st_readrecord(filenum, ridptr, recaddr, len, trans_id, lockup,
mode, cond)
st_writerecord(filenum, ridptr, recaddr, len, trans_id, lockup, cond)
EXPORTS :
st_insertframe(filenum, ridptr, offset, recaddr, length, trans_id,
lockup, cond)
*/
#include <wiss.h>
#include <st.h>
#include <lockquiz.h>
static make_room(trans_id, filenum, dp, start, len, pff)
int trans_id;
int filenum; /* file number */
register LONGDIR *dp; /* pointer to directory */
TWO start; /* which slice to start */
int len; /* # of bytes to insert */
int pff; /* page fill factor in bytes */
/* This routine makes room for a long data item to grow.
Slice "start" is the first slice affected by the insertion.
If all the new stuff can fit into slice "start", the routine simply
returns; otherwise it allocates new slices (pages) and add the corresponding
RID-count pair into the directory. No actual data movement is done here.
Returns:
index of the last new slice
Side Effects:
pages may be allocated for the new slices
Errors:
e2NOMORESLICES: long item grows too long
*/
{
int e; /* for returned errors */
register int i, j; /* slice indices */
register int count; /* # of new slices needed */
DATAPAGE *sp; /* page buffer for a slice */
FID fid; /* level 0 file ID */
PID pids[MAXRECORDSIZE / ((int) sizeof(SLICEPTR))]; /* for new pids */
#ifdef TRACE
if (checkset(&Trace2, tFRAME))
printf("make_room(filenum=%d,dp=0x%x,start=%d,len=%d,pff=%d)\n",
filenum, dp, start, len, pff);
#endif
if (dp->slice_count == 0) start = -1; /* a bran new item */
else if (dp->sptr[start].len + len <= pff)
return(start); /* all the new bytes fit */
else if (pff > dp->sptr[start].len)
len -= pff - dp->sptr[start].len; /* use up the space */
/* determine the number of new slices needed */
count = (len % pff) ? len / pff + 1 : len / pff;
if (DIRLEN(dp) + ((int) sizeof(SLICEPTR)) * count > MAXRECORDSIZE)
return(e2NOMORESLICES); /* directory too big */
j = start + count; /* postion of the last empty slice */
/* reuse existing empty slices and allocates new disk pages */
for (i = start + 1; i<dp->slice_count && dp->sptr[i].len == 0; i++)
if (--count == 0) return(j); /* enough empty slices */
fid = F_FILEID(filenum); /* get internal file ID */
e = io_allocpages(&fid, (PID *)NULL, count, &pids[start + 1]);
CHECKERROR(e);
/* make room in the directory for the new entries */
for (i = dp->slice_count - 1; i>start; i--) dp->sptr[i + count] = dp->sptr[i];
/* set up control information on slice pages: the length of each slice
is set to SLICESIZE to ensure that it is the only record on that page */
for (i = start + 1; i <= start + count; i++) {
e = r_initslice(filenum, &pids[i], &sp, trans_id);
CHECKERROR(e);
(void)bf_freebuf(filenum, &(pids[i]), sp);
MAKERID(&(dp->sptr[i].rid), &(pids[i]), 0);
dp->sptr[i].len = 0;
}
dp->slice_count += count; /* the new slice count */
return(j); /* return index of the last empty slice */
} /* make_room */
st_insertframe(filenum, ridptr, offset, recaddr, length, trans_id, lockup, cond)
int filenum; /* file that contains the long data item */
RID *ridptr; /* rid of the directory */
int offset; /* where to start */
char *recaddr; /* from where */
int length; /* how much to insert */
int trans_id;
short lockup;
short cond;
/*
Inserts "length" of bytes into a long data item.
This routine attempts to reduce total data movement to the minimum and
keep each slice as full as possible at the same time.
Returns:
actual number of bytes inserted
Side Effects:
new pages may be allocated
Errors:
e2NULLRIDPTR: null RID pointer for the directory
*/
{
int e; /* for returned errors */
register int i, j; /* slice indices */
int pff; /* page fill factor in bytes */
int left; /* # of bytes left to insert */
int last_slice; /* last slice of insertion */
int high_mark; /* rear end of insertion */
int moves; /* # of bytes to be moved */
char *sptr, *sptr1; /* slice buffer pointers */
RECORD *recptr; /* record pointer */
char buf[PAGESIZE]; /* local directory buffer */
register LONGDIR *dp=(LONGDIR *)buf; /* directory pointer */
DATAPAGE *spi, *spj; /* buffer pointers */
#ifdef TRACE
if (checkset(&Trace2,tINTERFACE)) {
printf("st_insertframe(filenum=%d,RID=",filenum);
PRINTRIDPTR(ridptr);
printf(",offset=%d,length=%d)\n",offset,length);
}
#endif
/* check file number and file permission */
CHECKOFN(filenum);
CHECKWP(filenum);
if (ridptr == NULL) return(e2NULLRIDPTR);
/* read the directory into a local buffer */
e = st_readrecord(filenum, ridptr, (char *) dp, PAGESIZE, trans_id,
lockup, l_X, cond);
CHECKERROR(e);
/* check length info and get page fill factor */
left = length;
if (offset < 0 || length <= 0) return(0); /* do nothing */
if (offset > dp->total_length) return(0); /* bad offset */
pff = F_PFF(filenum); /* page fill factor in % */
pff = SLICESIZE * pff / 100; /* page fill factor in bytes */
/* If this is a new long item which can fit into a crumb, then
create a new record (a crumb) for the new bytes and return.
*/
if (dp->slice_count == 0 && left <= CRUMBSIZE)
{
/* put the new bytes into a new crumb */
e = st_appendrecord(filenum, recaddr, left, &(dp->sptr[0].rid),
trans_id, lockup, cond);
CHECKERROR(e);
e = r_getslot(filenum, &(dp->sptr[0].rid),&spi,&recptr,
trans_id, lockup, l_X, cond);;
CHECKERROR(e);
recptr->kind = CRUMB; /* mark the record as a crumb */
(void) bf_setdirty(filenum, &(spi->thispage), spi);
(void) bf_freebuf(filenum, &(spi->thispage), spi);
/* update the directory and return */
dp->slice_count = 1;
dp->sptr[0].len = dp->total_length = left;
/* lockup is set to FALSE as r_getslot left it locked in X mode */
e = st_writerecord(filenum,ridptr,(char *)dp,DIRLEN(dp),
trans_id, FALSE, cond);
CHECKERROR(e);
return(length); /* return actual # of bytes inserted */
}
/* locate the start of insertion - (slice i, offset) */
for (i = 0; offset > dp->sptr[i].len && i < dp->slice_count;
offset -= dp->sptr[i++].len);
/* If the new bytes are to be inserted into a trailing crumb ... */
if (i == dp->slice_count-1 && dp->sptr[i].len + left <= CRUMBSIZE)
{
RID rid; /* rid of the crumb */
/* update the directory and write it out */
moves = dp->sptr[i].len;
dp->sptr[i].len += length, dp->total_length += length;
/* lockup is set to FALSE as st_readrecord locked in X mode */
e = st_writerecord(filenum, ridptr, (char *) dp, DIRLEN(dp),
trans_id, FALSE, cond);
CHECKERROR(e);
/* get the crumb and insert new bytes (reuse directory buffer) */
rid = dp->sptr[i].rid;
e = st_readrecord(filenum, &rid, buf, moves,
trans_id, lockup, l_X, cond);
CHECKERROR(e);
movebytes(buf+offset+length, buf+offset, moves-offset);
movebytes(buf+offset, recaddr, length); /* new bytes */
/* lockup is set to FALSE as st_readrecord locked in X mode */
e = st_writerecord(filenum, &rid, buf, moves+length,
trans_id, FALSE, cond);
CHECKERROR(e);
return(length); /* return actual # of bytes inserted */
}
/* If the trailing crumb is affected by the insertion, expand it into
a slice for the ease of further precessing.
*/
if (dp->slice_count > 0 && i >= dp->slice_count - 2) {
e = r_expandcrumb(filenum, &(dp->sptr[dp->slice_count-1].rid),
dp->sptr[dp->slice_count-1].len, trans_id, lockup, cond);
CHECKERROR(e);
}
/* allocate pages for the new slices */
j = last_slice = make_room(trans_id, filenum, dp, i, left, pff);
CHECKERROR(j);
/* get the first slice involved and start the processing */
e = r_getslot(filenum, &(dp->sptr[i].rid), &spi, &recptr,
trans_id, lockup, l_X, cond);
CHECKERROR(e);
sptr = recptr->data;
if (i == j) { /* can handle insertion in slice i */
movebytes(sptr+offset+left, sptr+offset,
dp->sptr[i].len-offset); /* make room for new bytes */
movebytes(sptr+offset, recaddr, left); /* insert */
dp->sptr[i].len += left;
(void) bf_setdirty(filenum, &(spi->thispage), spi);
(void) bf_freebuf(filenum, &(spi->thispage), spi);
}
else if (j == i + 1) { /* Only slices i and i+1 are affected. */
/* If pff<offset, leave the part before "offset" in slice i alone */
/* get slice j & move bottom half of slice i to j */
e = r_getslot(filenum, &(dp->sptr[j].rid), &spj, &recptr,
trans_id, lockup, l_X, cond);
if (e < eNOERROR) goto error;
sptr1 = recptr->data;
moves = dp->sptr[i].len - offset;
dp->sptr[j].len = (offset > pff) ? left+moves :
(left < pff-offset) ? moves : left+moves - (pff-offset);
movebytes(sptr1+dp->sptr[j].len-moves, sptr+offset,moves);
/* if there is still room on slice i, put some new bytes there &
put the rest of the new bytes on slice j */
if ((moves = MIN(pff-offset, left)) > 0) {
movebytes(sptr+offset, recaddr, moves);
left -= moves, recaddr += moves;
}
movebytes(sptr1, recaddr, left);
dp->sptr[i].len = (pff > offset) ? offset + moves : offset;
/* mark the buffers dirty and unfix them */
(void) bf_setdirty(filenum, &(spi->thispage), spi);
(void) bf_setdirty(filenum, &(spj->thispage), spj);
(void) bf_freebuf(filenum, &(spi->thispage), spi);
(void) bf_freebuf(filenum, &(spj->thispage), spj);
}
else { /* more slices are involved */
/* In the following, insertion is done backward, slice by slice.
At any time, <slice i, offset> is the (fixed) front end of insertion,
and <slice j, high_mark> is the running rear end.
After the insertion, the last newly added slice and its neighbor will
be checked for possible merging.
Every new slice, except the last, will contain exactly "pff" bytes.
Slice i may contain more if offset > pff.
*/
/* locate the rear end <slice j, high_mark> */
moves = (offset > pff) ? left+dp->sptr[i].len-offset
: left-(pff-dp->sptr[i].len);
high_mark = moves % pff;
if (i + moves / pff >= j) high_mark+=pff; /* fold back to j */
dp->sptr[j].len = high_mark;
/* move the bottom part of slice i to j as much as possible */
e = r_getslot(filenum, &(dp->sptr[j].rid), &spj, &recptr,
trans_id, lockup, l_X, cond);;
if (e < eNOERROR) goto error;
sptr1 = recptr->data;
moves = MIN(high_mark, dp->sptr[i].len - offset);
dp->sptr[i].len -= moves; /* what left in i */
movebytes(sptr1+high_mark-moves, sptr+dp->sptr[i].len, moves);
/* if more stuff in slice i need to be moved (to j-1) ... */
if ((high_mark -= moves) == 0) {
(void) bf_setdirty(filenum, &(spj->thispage), spj);
(void) bf_freebuf(filenum, &(spj->thispage), spj);
moves = dp->sptr[i].len - offset;
j--; /* back up one slice */
dp->sptr[j].len = pff;
e = r_getslot(filenum, &(dp->sptr[j].rid),&spj,&recptr,
trans_id, lockup, l_X, cond);;
if (e < eNOERROR) goto error;
sptr1 = recptr->data;
dp->sptr[i].len -= moves;
high_mark = pff - moves;
movebytes(sptr1+high_mark, sptr+offset, moves);
}
/* main loop for backward insertion */
for (recaddr += left-high_mark; i < j ; recaddr -= high_mark) {
/* copy data into slice j */
movebytes(sptr1, recaddr, high_mark);
(void) bf_setdirty(filenum, &(spj->thispage), spj);
(void) bf_freebuf(filenum, &(spj->thispage), spj);
high_mark = pff ;/* every slice is full from now on */
if (--j > i) { /* get the previous slice */
dp->sptr[j].len = pff;
e = r_getslot(filenum, &(dp->sptr[j].rid), &spj,
&recptr, trans_id, lockup, l_X, cond);;
if (e < eNOERROR) goto error;
sptr1 = recptr->data;
}
else { /* alas! the last slice */
if (offset < pff) {
moves = high_mark - offset;
movebytes(sptr+offset,
recaddr-moves,moves);
dp->sptr[i].len = pff;
}
(void) bf_setdirty(filenum,&spi->thispage, spi);
(void) bf_freebuf(filenum,&spi->thispage, spi);
}
}
/* check if slices at the rear end of insertion mergable */
i = last_slice;
j = i+1;
if (j<dp->slice_count &&
dp->sptr[i].len+dp->sptr[j].len<=SLICESIZE) {
e = r_getslot(filenum, &(dp->sptr[i].rid),&spi,&recptr,
trans_id, lockup, l_X, cond);
CHECKERROR(e);
sptr = recptr->data;
e = r_getslot(filenum, &(dp->sptr[j].rid),&spj,&recptr,
trans_id, lockup, l_X, cond);
if (e < eNOERROR) goto error;
sptr1 = recptr->data;
movebytes(sptr+dp->sptr[i].len, sptr1, dp->sptr[j].len);
dp->sptr[i].len += dp->sptr[j].len;
dp->sptr[j].len = 0; /* leave it in place */
(void) bf_setdirty(filenum, &(spi->thispage), spi);
(void) bf_freebuf(filenum, &(spi->thispage), spi);
(void) bf_freebuf(filenum, &(spj->thispage), spj);
}
}
/* trailing slice is too small to be a slice, turn it into a crumb */
while ((i=dp->slice_count-1) >= 0 && dp->sptr[i].len <= CRUMBSIZE) {
e = r_shrinkslice(filenum, &(dp->sptr[i].rid), dp->sptr[i].len,
trans_id, lockup, cond);
CHECKERROR(e);
if (dp->sptr[i].len == 0) dp->slice_count--;
else break;
}
dp->total_length += length;
/* lockup is set to false as st_readrecord alreaded locked the directory */
/* in X mode */
e = st_writerecord(filenum, ridptr, (char *) dp, DIRLEN(dp),
trans_id, FALSE, cond);
CHECKERROR(e);
return(length); /* return actual # of bytes inserted */
error:
(void) bf_freebuf(filenum, &(spi->thispage), spi); /* unfix the buffer */
return(e); /* return the error code */
} /* st_insertframe */
#ifdef DEBUG
static print_dir(dp)
LONGDIR *dp;
{
int i;
RID r;
printf("Diretory of the long data item: \n");
for (i = 0; i < dp->slice_count; i++) {
r = dp->sptr[i].rid;
printf("slice[%2d]=<%d:%d>,len=%2d; ",
i, r.Rpage, r.Rslot, dp->sptr[i].len);
if (i % 3 == 2) printf("\n");
}
printf("\n");
}
#endif
|
26cc9de8975d72b13e96066e481f28d57ad62365
|
b7c94b734137f28b6aab05c701cd799b4996b363
|
/thirdparty/microsoft_craziness/microsoft_craziness.c
|
68d41288fb8185c559436104b6393c5363e12e11
|
[
"MIT"
] |
permissive
|
ikvm/v
|
be73934ec0512338a9dc36a7e86f4f09063e5913
|
c28a490c17e392a1b75fc969717c713f62e80676
|
refs/heads/master
| 2020-06-23T06:17:42.773391 | 2019-07-24T00:22:34 | 2019-07-24T00:28:29 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 487 |
c
|
microsoft_craziness.c
|
#define MICROSOFT_CRAZINESS_IMPLEMENTATION
#include "microsoft_craziness.h"
#ifdef _WIN32
// Never hang around to a pointer from this function
// This is not thread safe
char *wide_string_to_narrow_temp(wchar_t *wc) {
static char buffer[10000][10];
static int counter = 0;
char *cur_buffer = buffer[counter++];
int len = wcslen(wc);
int c = wcstombs(cur_buffer, wc, len);
cur_buffer[c] = 0;
// something assert len == c
return cur_buffer;
}
#endif
|
4cc90f079e2b4bd58912857dfa7d08df878c59fa
|
f3dc9e30791c412d2a974363fc60257f957c95d8
|
/list.c
|
9fa0c8399d5b1c3d5c85949fb67b7e3321d10253
|
[] |
no_license
|
BrandonDG/NetworkSimulator
|
e48b7e5f91e20ee1df71c4184789c9f8d688f12c
|
21502f07004195272e9a598cf25e38707c9d3970
|
refs/heads/master
| 2021-09-03T02:19:42.445139 | 2018-01-04T21:16:41 | 2018-01-04T21:16:41 | 112,780,032 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,936 |
c
|
list.c
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PAYLOAD 1024
typedef struct packet packet;
struct packet {
int PacketType;
int SeqNum;
char data[PAYLOAD];
int WindowSize;
int AckNum;
int Ackd;
};
typedef struct node node;
struct node {
packet data;
node *next;
};
void fillValues(node *n, packet pck) {
n->data.PacketType = pck.PacketType;
n->data.AckNum = pck.AckNum;
n->data.SeqNum = pck.SeqNum;
n->data.WindowSize = pck.WindowSize;
strcpy(n->data.data, pck.data);
}
void print(node *lst) {
node *p;
for (p = lst; p != 0; p = p->next) {
printf("%d %d %d \n", p->data.SeqNum, p->data.AckNum, p->data.Ackd);
}
}
void ack(node *lst, int acknum) {
node *p;
for (p = lst; p != 0; p = p->next) {
if ((p->data.SeqNum + sizeof(p->data.data)) == acknum) {
p->data.Ackd = 1;
}
}
}
node *find(node *lst, const char *name) {
node *p;
for (p = lst; p != 0; p = p->next) {
// Return here
}
return 0;
}
void destroy(node *lst) {
node *p, *q;
for (p = lst; p != 0; p = q) {
q = p->next;
free(p);
}
}
int insert(node **plst, const char *name, int score) {
node *newNode = malloc(sizeof(node));
if (newNode == 0) {
return 0;
}
*plst = newNode;
return 1;
}
int insert_at_end(node **plst, packet pck) {
node *newNode = malloc(sizeof(node));
node **tracer;
if (newNode == 0) {
return 0;
}
fillValues(newNode, pck);
for (tracer = plst; (*tracer)->next != 0; tracer = &(*tracer)->next) {
}
(*tracer)->next = newNode;
return 1;
}
int delete_all(node **plst, packet *pck) {
node **tracer;
int counter = 0;
for (tracer = plst; (*tracer) != 0; ) {
if (((*tracer)->data.SeqNum + sizeof((*tracer)->data.data)) == pck->AckNum) {
node *p = *tracer;
*tracer = p->next;
free(p);
counter++;
} else {
tracer = &(*tracer)->next;
}
}
return counter;
}
|
69a90161bf470391f641479578e73ef311b4fb38
|
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
|
/source/freebsd/contrib/gcc/config/arm/extr_arm.c_arm_gen_compare_reg.c
|
469bc829e2f38e3fcb3576ddbdeebcaf5292b258
|
[] |
no_license
|
isabella232/AnghaBench
|
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
|
9a5f60cdc907a0475090eef45e5be43392c25132
|
refs/heads/master
| 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,134 |
c
|
extr_arm.c_arm_gen_compare_reg.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ rtx ;
typedef enum rtx_code { ____Placeholder_rtx_code } rtx_code ;
typedef enum machine_mode { ____Placeholder_machine_mode } machine_mode ;
/* Variables and functions */
int /*<<< orphan*/ CC_REGNUM ;
int SELECT_CC_MODE (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ emit_set_insn (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ gen_rtx_COMPARE (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ gen_rtx_REG (int,int /*<<< orphan*/ ) ;
rtx
arm_gen_compare_reg (enum rtx_code code, rtx x, rtx y)
{
enum machine_mode mode = SELECT_CC_MODE (code, x, y);
rtx cc_reg = gen_rtx_REG (mode, CC_REGNUM);
emit_set_insn (cc_reg, gen_rtx_COMPARE (mode, x, y));
return cc_reg;
}
|
32cd383c0fe4ec2e013b2c138301fecf6b64ea28
|
beafd9251c1c69c8126ff5344acb8163d5291dd1
|
/Fundamentos de Programação/Lista 7/exe4.c
|
0e19278ed195f79d02d42f2d47d9993997c7815c
|
[] |
no_license
|
DanielBrito/ufc
|
18f5a1b6b3542b27ec465d966dd6b48a8cb2f8ac
|
32004cdc6b708ffda24a0aae24525c6e423dd18e
|
refs/heads/master
| 2023-07-19T17:27:11.150306 | 2022-02-12T03:15:43 | 2022-02-12T03:15:43 | 101,405,465 | 20 | 6 | null | 2023-07-16T04:22:11 | 2017-08-25T13:15:44 |
C
|
UTF-8
|
C
| false | false | 701 |
c
|
exe4.c
|
#include<stdio.h>
#define TAM 5
int maiores(int vet[]);
int main()
{
int num[TAM]={0};
int i, qtd=0;
for(i=0; i<TAM; i++)
{
printf("Digite o %do valor: ", i+1);
scanf("%d", &num[i]);
}
qtd = maiores(num);
printf("\n\nA quantidade de valores maiores que a media e %d.\n\n", qtd);
return 0;
}
int maiores(int vet[])
{
int i, maior=0;
int soma=0, cont=0;
float media=0;
for(i=0; i<TAM; i++)
{
soma = soma+vet[i];
}
media = (float)soma/TAM;
for(i=0; i<TAM; i++)
{
if(vet[i]>media)
{
cont++;
}
}
return cont;
}
|
8b660c29ef531317babe73d73169a94e8e8167f6
|
c111ee2226dbd38c939de00284775d999183561b
|
/06_ascii_characters.c
|
15a4b01773a8dc09f59335abc540f13a3ab6ff26
|
[] |
no_license
|
girish-gaude/basicC-example
|
741a99157fdb9487d9cb1ece574bf69ab387f2ee
|
b84e2d61f6158f0cb45ca43eddd3d5ea316a5c3b
|
refs/heads/master
| 2020-12-22T13:08:59.764094 | 2020-01-28T17:29:25 | 2020-01-28T17:29:25 | 236,793,162 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 665 |
c
|
06_ascii_characters.c
|
/*Author: Girish Gaude
* Date: 18/Nov/2019
* Desciption: Program to display all ascii values
* Input: All ascii value
* Output: Display output.
*/
#include<stdio.h>
int main()
{
printf("Dec Oct Hec Ascii\n" );
printf("___________________________________________________________\n" );
for ( int i=0; i<=127; i++ ) //Take all possible range
{
if ( i <= 32 )
{
printf(" %d %0.3o %x Non Printable\n", i,i,i);//Display dec,octal,hex and ascii values
}
else if ( i>32 && i <127 )
{
printf(" %d %o %x %c\n", i,i,i,i);
}
else
printf(" %d %o %x Non Printable\n", i,i,i);
}
return 0;
}
|
fdd8b7c3cfe8e72d8825b9fac337f2f150ed7462
|
246562ed42a19fcb0a9ff3a96f2cdc1e4095966f
|
/NEW_battery_drain_analysis/main.c
|
df6857336261f65d4430c29ff9e5b20bafacc44c
|
[] |
no_license
|
bug-er404/robotics
|
aa5a959945725095c6434e6c7afa5555be6cfd81
|
c54929ba9cb0b83da676eb2cf750225207edf232
|
refs/heads/master
| 2022-11-04T22:37:58.977681 | 2020-06-16T01:54:11 | 2020-06-16T01:54:11 | 272,585,094 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 7,879 |
c
|
main.c
|
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
#include "elisa3-lib.h"
#include <stdlib.h>
#include <signal.h>
#ifdef _WIN32
#include "windows.h"
#endif
#define OBSTACLE_THR 50
#define NUM_ROBOTS 8 //be a multiple of 4 (might be a library issue)
int robotAddress[NUM_ROBOTS];
unsigned int robProx[NUM_ROBOTS][8];
unsigned char exitProg=0;
// received from robot
// sent to robot
char robLSpeed[NUM_ROBOTS], robRSpeed[NUM_ROBOTS];
char robRedLed, robGreenLed, robBlueLed;
// sent to robot
// various
unsigned int delayCounter=1000;
//experiment types
void drain_min(int threshold, char* trial_name);
void drain_std(int threshold);
void drain_max(int threshold);
static volatile int keepRunning = 1;
void intHandler(int dummy)
{
keepRunning = 0;
}
unsigned char updateRGB(char *red, char *green, char *blue) {
static unsigned int i=0;
unsigned int rndNum;
i = (i+1)%65000; // use to change the rgb leds
if(i==0) {
rndNum = rand()%400;
if(rndNum < 100) {
*red = rand()%100;
*green = rand()%100;
*blue = 0;
} else if(rndNum < 200) {
*red = rand()%100;
*green = 0;
*blue = rand()%100;
} else if(rndNum < 300) {
*red = 0;
*green = rand()%100;
*blue = rand()%100;
} else {
*red = rand()%100;
*green = rand()%100;
*blue = rand()%100;
}
return 1;
}
return 0;
}
void avoidObstacles(unsigned int *prox, char *left, char *right) {
int rightProxSum=0, leftProxSum=0; // sum of proximity values on right or left
// obstacle avoidance using the 3 front proximity sensors
rightProxSum = prox[0]/2 + prox[1];
leftProxSum = prox[0]/2 + prox[7];
rightProxSum /= 5; // scale the sum to have a moderate impact on the velocity
leftProxSum /= 5;
if(rightProxSum > 60) { // velocity of the motors set to be from -30 to +30
rightProxSum = 60;
}
if(leftProxSum > 60) {
leftProxSum = 60;
}
*right = 30-leftProxSum; // set the speed to the motors
*left = 30-rightProxSum;
}
int main(int argc, char *argv[])
{
//check for cmd line input
// op_code: the experiment type
// robot list: txt file of number of robots and list of robot ids
if (argc != 5)
{
fprintf(stderr, "usage: sudo ./main [op_code] [threshold] [trial name] [robot list]\n");
exit(EXIT_FAILURE);
}
srand(time(NULL));
signal(SIGINT, intHandler);
unsigned int k=0;
//try to open the robot list file
FILE * r_ids;
int err_num;
r_ids = fopen(argv[4], "r");
if (r_ids == NULL)
{
//fprintf(stderr, "error: opening robot list - %s\n", strerror(errno));
printf("error: opening robot list");
exit(EXIT_FAILURE);
}
//input the robot ids
int i, trash;
for (i = 0; i < NUM_ROBOTS; i++)
{
trash = fscanf(r_ids, "%d", &robotAddress[i]);
}
fclose(r_ids);
// for(k=0; k<NUM_ROBOTS; k++)
// {
// printf("\r\nInsert the robot address %d: ", k);
// scanf("%d", &robotAddress[k]);
// }
// init the communication with the robots; set the addresses and number of the robots to control
startCommunication(robotAddress, NUM_ROBOTS);
for (i = 0; i < 50; transferData(), i++);
/* switch (atoi(argv[1]))
{
case 0:
drain_min(atoi(argv[2]), argv[3]);
break;
case 1:
//drain_std(atoi(argv[2]));
break;
case 2:
//drain_max(atoi(argv[2]));
break;
default:
fprintf(stderr, "error: invlaid op_code (%d)\n", atoi(argv[1]));
exit(EXIT_FAILURE);
}
*/
//FILE* test = fopen("TEST.txt", "w");
FILE* battery_files[NUM_ROBOTS];
FILE* file = fopen("battery_drain_analysis_max_all_08042017_trial_01.txt", "w");
unsigned int raw = 0, percent = 0;
//open file for each robot and add header
/* for (i = 0; i < NUM_ROBOTS; i++)
{
char file[80];
sprintf(file, "%s_r%d.txt",argv[3],robotAddress[i]);
battery_files[i] = fopen(file, "w");
fprintf(battery_files[i],"Percent Raw\n");
}
*/
//turn on the green prox led so we know when batteries have depleated
/// for (i = 0; i < NUM_ROBOTS; i++)
// {
// turnOnSmallLeds(robotAddress[i]);
// }
unsigned int robProx[NUM_ROBOTS][8];
unsigned int robGround[NUM_ROBOTS][4];
for (i = 0; i < NUM_ROBOTS; i++)
{
turnOnSmallLeds(robotAddress[i]);
turnOnFrontIRs(robotAddress[i]);
turnOnBackIR(robotAddress[i]);
}
int j = 0;
while(keepRunning)
{
//j++;
transferData();
getAllGroundFromAll(robGround);
getAllProximityFromAll(robProx);
getAllProximityAmbientFromAll(robProx);
getAllGroundAmbientFromAll(robGround);
//if(j > delayCounter)
{
//printf("HERE\n\n");
for(k = 0; k < NUM_ROBOTS; k++)
{
transferData();
//get the battery data from the robots
raw = getBatteryAdc(robotAddress[k]);
percent = getBatteryPercent(robotAddress[k]);
trash = getAccX(robotAddress[i]);
trash = getAccY(robotAddress[i]);
trash = getAccZ(robotAddress[i]);
trash = (int) getSelector(robotAddress[i]);
trash = getOdomTheta(robotAddress[i]);
trash = getOdomXpos(robotAddress[i]);
fprintf(file, "%4d %2d %3d\n", robotAddress[k], percent, raw);
//fprintf(battery_files[k],"%2d %3d\n\r", percent, raw);
}
//j = 0;
}
sleep(3);
#ifndef DISABLE_MOTORS
for(k = 0; k < NUM_ROBOTS; k++)
{
setLeftSpeed(robotAddress[k], 30);
setRightSpeed(robotAddress[k], -30);
}
#endif
if(updateRGB(&robRedLed, &robGreenLed, &robBlueLed)) {
for(k=0; k<NUM_ROBOTS; k++) {
setRed(robotAddress[k], robRedLed);
setGreen(robotAddress[k], robGreenLed);
setBlue(robotAddress[k], robBlueLed);
}
}
}
fclose(file);
stopCommunication();
return 0;
}
void drain_min(int threshold, char* trial_name)
{
FILE* battery_files[NUM_ROBOTS];
FILE* t;
int robots_active = NUM_ROBOTS;
int active[NUM_ROBOTS];
unsigned int raw = -1, percent = -1;
int i;
//a dead read
for (i = 0; i < NUM_ROBOTS; raw = getBatteryAdc(robotAddress[i]),percent = getBatteryPercent(robotAddress[i]), i++);
//sleep(3);
//for (i = 0; i < NUM_ROBOTS; raw = getBatteryAdc(robotAddress[i]),percent = getBatteryPercent(robotAddress[i]), i++);
//set all robots to active (1)
for (i = 0; i < NUM_ROBOTS; active[i] = 1, i++);
//open a battery file for each robot
for (i = 0; i < NUM_ROBOTS; i++)
{
char file[80];
sprintf(file, "%s_r%d.txt",trial_name,robotAddress[i]);
battery_files[i] = fopen(file, "w");
}
//loop while atleast one robot's charge is above the percentage threshold
//int j = 0;
//while (j < 10)
while (robots_active > 0)
{
// j++;
for (i = 0; i < NUM_ROBOTS; i++)
{
if (active[i])
{
raw = getBatteryAdc(robotAddress[i]);
percent = getBatteryPercent(robotAddress[i]);
if (percent <= threshold)
{
robots_active--;
active[i] = 0;
}
// fprintf(battery_files[i],"Percent: %2d Raw: %3d\n",percent,raw);
// fprintf(test,"Percent: %2d Raw: %3d\n",percent,raw);
}
else
{
// fprintf(battery_files[i],"Percent: -42 Raw: -42\n");
}
}
//reducing the data
//sleep(3);
//printf("\n\r");
}
//close the battery files
for (i = 0; i < NUM_ROBOTS; fclose(battery_files[i]), i++);
//printf("\n\nLeaving drain()\n\n");
return;
}
void drain_std(int threshold)
{
return;
}
void drain_max(int threshold)
{
return;
}
|
a1bffe4bf28718dab59d92afe8f0fbfc19b4878a
|
5c77462e02d4d3947ab11bec1c41be99b4f6f0c7
|
/Lab05/text.c
|
cc7d0787fbdea7baa714d1412329971e01606091
|
[] |
no_license
|
Joseph1337/CS2261
|
dc5b4bc41535015bd89c1ceea05861435ecd65aa
|
4065d3634a38c6aebfdf2b26a06953af552f8fbf
|
refs/heads/master
| 2023-01-31T20:05:33.915115 | 2020-12-20T17:58:31 | 2020-12-20T17:58:31 | 321,110,851 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 638 |
c
|
text.c
|
#include "myLib.h"
#include "text.h"
#include "font.h"
// Draws the specified character at the specified location
void drawChar(int col, int row, char ch, unsigned short color) {
for(int i=0; i<8; i++) {
for(int j=0; j<6; j++) {
if(fontdata_6x8[48*ch+j+6*i]) {
setPixel(col+j, row+i, color);
}
}
}
}
// Draws the specified string at the specified location
void drawString(int col, int row, char *str, unsigned short color) {
// TODO 2.0: Complete this function
while(*str != '\0') {
drawChar(col, row, *str, color);
col += 6;
str++;
}
}
|
4d53d0609984945dd85677e6d28bff45bb7bb7ab
|
8876a66dd13f947ca93189c3d25bd83ef6e0686b
|
/includes/fractol.h
|
f8a87e6c80a9ba67ea2b23cf97c02eeef45982c7
|
[] |
no_license
|
Gutierezz/21-Fractol
|
b8ee37b18c1fed3dc914f44645f76dca4051d8f0
|
7318fb1f1b9c6a9995d5f7019b4ca06a277f47aa
|
refs/heads/master
| 2020-08-11T06:08:02.471989 | 2019-11-07T22:58:55 | 2019-11-07T22:58:55 | 214,507,143 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 5,130 |
h
|
fractol.h
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ttroll <ttroll@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/17 15:42:48 by ttroll #+# #+# */
/* Updated: 2019/10/25 18:22:46 by ttroll ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FRACTOL_H
# define FRACTOL_H
# include <math.h>
# include <pthread.h>
# include "libft.h"
# include "ft_printf.h"
# include "mlx.h"
# include "keys.h"
# define WIN_W 800
# define WIN_H 800
# define THREADS_NUM 8
# define MAX_WINDOWS 4
# define MOVE_STEP 0.05
# define PI 3.14159265359
# define INDEX(x, y, size) (y * size + x)
typedef unsigned char t_uchar;
typedef enum e_err
{
MLX_INIT_ERR = 1,
WINDOW_INIT_ERR,
IMAGE_INIT_ERR,
DATA_ADDR_ERR,
MEM_ALLOC_ERR,
} t_err;
typedef enum e_type
{
MANDELBROT,
BURN_SHIP,
CELTIC,
SPIDER,
JULIA,
PHOENIX,
MANOWAR,
NEWTON,
NOVA,
MULTIBROT,
MULTIJULIA,
INVALID
} t_type;
typedef struct s_complex
{
double re;
double im;
} t_complex;
typedef struct s_colp
{
double iter;
t_complex z;
} t_colp;
typedef union u_color
{
int color;
t_uchar ch[4];
} t_color;
typedef struct s_range
{
double min;
double max;
} t_range;
typedef struct s_fract
{
t_type type;
void *mlx;
void *win;
void *img;
char *data;
int *win_cnt;
int bpp;
int line_size;
int endian;
int thread_min_y;
int thread_max_y;
int color_mode;
int inside_mode;
int multi_pow;
int coldiv_flag;
t_colp (*func)(t_complex, struct s_fract *);
int max_iter;
int static_mouse;
t_complex scale;
t_range re_range;
t_range im_range;
double scale_num;
int c1;
int c2;
int c3;
t_complex julia_seed;
} t_fract;
/*
** hook_commands
*/
int mouse_zoom(int key, int x, int y, t_fract *fract);
int set_julia_seed(int x, int y, t_fract *fract);
int key_press(int key, t_fract *fract);
void key_press_helper(int key, t_fract *fract);
void hook_commands(t_fract *fract);
/*
** key_press_utils
*/
void move_image(int key, t_fract *fract);
void change_color_mode(int key, t_fract *fract);
void maxiter_change(int key, t_fract *fract);
void shift_colors(t_fract *fract);
void reset_fractal(t_fract *fract);
/*
** fill_image
*/
double lerp(double norm, double min, double max);
double norm(double value, double min, double max);
double map(double value, t_range pixel, t_range comp);
void *fill_area(t_fract *fract);
void fill_image(t_fract *fract);
/*
** structs_init
*/
t_fract *fract_init(char *name, t_type type, void *mlx, int *win_cnt);
t_complex complex(double re, double im);
void fract_init_helper(t_fract *fract);
/*
** structs_clear
*/
void fract_clear(t_fract **fract, int err_msg);
void error_exit(int err);
/*
** image_funcs
*/
int in_circle(t_complex c);
void set_pixel(t_fract *fract, int x, int y, int color);
void clear_image(t_fract *fract);
void put_image(t_fract *fract);
t_range range(double min, double max);
/*
** complex_ops
*/
void comp_print(t_complex c);
t_complex pow_two(t_complex c);
t_complex comppow(t_complex c, int power);
t_complex reverse_comp(t_complex c);
double comp_abs(t_complex c);
/*
** complex_arithmetics
*/
t_complex comp_mult(t_complex c1, t_complex c2);
t_complex comp_div(t_complex c1, t_complex c2);
t_complex add_comp(t_complex c1, t_complex c2);
t_complex sub_comp(t_complex c1, t_complex c2);
t_complex real_mult(t_complex c, double num);
/*
** get_color
*/
t_colp color_init(double iter, t_complex last_z);
t_color inside_coloring(t_colp colp, t_fract *fract);
t_color get_color(t_colp color, t_fract *fract);
int close_window(t_fract *fract);
/*
** color_funcs
*/
t_color default_color(t_colp colp, t_fract *fract);
t_color trippy_color(t_colp colp, t_fract *fract);
t_color cookbook_color(t_colp colp, t_fract *fract);
t_color sin_color(t_colp colp, t_fract *fract);
/*
** julia_group
*/
t_colp julia(t_complex c, t_fract *fract);
t_colp manowar(t_complex c, t_fract *fract);
t_colp phoenix(t_complex c, t_fract *fract);
t_colp multi_julia(t_complex c, t_fract *fract);
/*
** newton_group
*/
t_colp newton(t_complex c, t_fract *fract);
t_colp nova(t_complex c, t_fract *fract);
/*
** mandel_group
*/
t_colp mandelbrot(t_complex c, t_fract *fract);
t_colp burning_ship(t_complex c, t_fract *fract);
t_colp multi_mandel(t_complex c, t_fract *fract);
t_colp spider(t_complex c, t_fract *fract);
t_colp celtic(t_complex c, t_fract *fract);
#endif
|
32baa11ea39a555851a0655c8cd01a926d59ad1e
|
891b187056f4083974a5050203783f9b03de5f1b
|
/reader.c
|
9a8724982d4dfba96705dc19cf6faf9b42ea6892
|
[] |
no_license
|
evanbarba/swiperead
|
1ec21250070c5317acfc0363a326c2d54461f859
|
d8004c46e06b2a4d37fc83f744e53d5ac68b4356
|
refs/heads/master
| 2020-12-28T22:53:06.688315 | 2013-03-08T04:05:41 | 2013-03-08T04:05:41 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,235 |
c
|
reader.c
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "hidapi.h"
#include <stdio.h>
#define MAX_BUF 300
typedef unsigned long idt;
int handle_swipes(void (*onSwipe)(idt uid), void (*onError)())
{
unsigned char buf[MAX_BUF];
unsigned char *bufp;
unsigned char userid[12];
hid_device *handle;
int i, n, res;
// open magtek reader magtekID
handle = hid_open(0x0801, 0x0002, NULL);
if (!handle){
return -1;
}
while(1){
// Read requested state
res = hid_read(handle, buf, MAX_BUF);
if (res < 0){
onError();
break;
}
printf("Data read:\n");
res = 0;
bufp = buf;
i = 0; n = 0;
buf[MAX_BUF-1] = '\0';
while((++i < MAX_BUF) && ';' != *bufp) bufp++;
bufp++;
while((++i < MAX_BUF) && ';' != *bufp) bufp++;
while(*bufp != '=' && ++i < MAX_BUF){
bufp++;
if (*bufp >= '0' && *bufp <= '9' && n < 11){
userid[n++] = *bufp;
}
}
userid[n++] = '\0';
if (n > 1){
onSwipe(atol(userid));
} else {
onError();
}
}
return 0;
}
|
1d1788f54de2d4ab37b26dae83047902061b14e5
|
68d0c26aa0a8d16248a2e19925229cea9c29da23
|
/ft_putendl.c
|
7a6178b9637f43943a493acbf88d20a8dad03727
|
[] |
no_license
|
SunnyKellman/libft
|
e7d56bb2b5c6c346a15bf5868a4436b2dbe09dd6
|
1523d39f1140cc7bc43ecc13cdd8524798f2cee8
|
refs/heads/master
| 2022-12-15T10:40:24.675749 | 2020-09-09T07:59:52 | 2020-09-09T07:59:52 | 294,042,271 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,040 |
c
|
ft_putendl.c
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putendl.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: skellman <skellman@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/29 20:16:40 by skellman #+# #+# */
/* Updated: 2019/10/31 13:05:30 by skellman ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putendl(char const *s)
{
int c;
c = 0;
if (s)
{
while (s[c])
c++;
write(1, s, c);
write(1, "\n", 1);
}
}
|
d12550b44465f0eb646f0e5e380b495ee4d2066e
|
18e7edc3027c0ae769c3a82488f2141010366271
|
/lib/Kernel.h
|
309a7e117efdcee68fc7ea5deaffda7c47348740
|
[
"MIT"
] |
permissive
|
felixr/magic-kernel-sharp
|
74983ca58047c693e5cd4a3028a7aac332f7d7fc
|
c8024a92b70c1a610a8e7a8cecea73db9d081e21
|
refs/heads/main
| 2023-03-22T16:23:45.668312 | 2021-03-13T17:34:55 | 2021-03-13T17:34:55 | 347,430,385 | 1 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 5,171 |
h
|
Kernel.h
|
/* A general n_out x n_in normalized linear matrix kernel mapping linearly the
* n_in elements of an input signal to the n_out elements of the desired output
* signal, optimized for the case when this matrix is sparse, but still close
* to as efficient as possible even for dense matrices. Automatically handles
* boundary conditions, either periodic or extension. Application to a
* particular signal makes use of parallel execution if the number of threads
* specified is not 1.
*/
#ifndef KERNEL_H
#define KERNEL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "qsortx.h"
#include "parallel.h"
typedef struct {
bool periodic;
ulong n_in;
ulong n_out;
ulong num_elements;
ulong *ns;
ulong **ins;
double **weights;
} Kernel;
typedef struct {
long first;
long last;
} KernelPossible;
/* Create a kernel. The callback function possible(out, x) should return the
* first and last *possible* input indexes for the given output index 'out' for
* which the weight of the theoretical kernel *might*, in general, be nonzero.
* If it turns out at construction time that some matrix elements within this
* range are *actually* zero, the class does not physically store those matrix
* elements. The first and last indexes specified by this 'possible' callback
* function can in general be *outside* the bounds [0, n_in) of the input index
* (which is why they are signed longs rather than ulongs). Boundary conditions
* are handled by this class automatically: if 'periodic' is true, periodic
* boundary conditions are applied, and any contributions for 'in' outside [0,
* n_in) are added to the kernel for 'in mod n_in'; otherwise, extension
* boundary conditions are applied, and such contributions are added to the
* kernel for in = 0 if in < 0, or in = n_in - 1 if in >= n_in. The function
* weight(in, out, x) should return the weight (which does *not* need to be
* normalized; this class will automatically do that) from 'in' to 'out',
* ignoring the fact that 'in' might be outside the input array, i.e., this
* function can return a "pure" formula that ignores boundary conditions, which
* this class will apply automatically according to the above rules (and the
* class will also normalize the weights for any given value of 'out' to
* unity).
*/
Kernel *kernel_new(
Kernel **pthis,
ulong n_in,
ulong n_out,
bool periodic,
KernelPossible (*possible)(ulong out, void *x),
double (*weight)(ulong out, long in, void *x),
void *x);
/* Create a kernel that is the composition of two other kernels, i.e., k1 is
* intended to be applied to the input signal, and then k2 is applied to the
* output of k1. Note that this constructor constructs a *single* kernel that
* is the composition of the two individual kernels, which may not in general
* be as efficient as keeping the two separate instantiated kernels and
* actually applying them consecutively.
*/
Kernel *kernel_new_compose(Kernel **pthis, Kernel *k1, Kernel *k2);
/* Create an identity kernel, for testing purposes.
*/
Kernel *kernel_new_identity(Kernel **pthis, ulong n);
void kernel_delete(Kernel **pthis);
void kernel_print(Kernel *this, FILE *f, byte n);
/* Apply a kernel. The callback function read(in, x) should return the input
* value at index 'in', and the function write(out, v, x) should write value
* 'v' to output element 'out'. See parallel.h for num_threads: 1 means
* single-threaded, and 0 means use the default number of threads.
*/
void kernel_apply(
Kernel *this,
double (*read)(ulong in, void *x),
void (*write)(ulong out, double v, void *x),
void *x,
ulong num_threads);
/* Test whether two kernels are equal, where corresponding elements are
* considered equal if they are within the given tolerance.
*/
bool kernel_equals(Kernel *this, Kernel *other, double tolerance);
/* Transform from an input index to an output index for resizing by a factor of
* k, with the assumption that the left edge of the first output tile aligns
* with the left edge of the first input tile, as is appropriate for image
* data. If we measure the input space by the real value x, where x = 0 is the
* left edge of the first input tile and x = 1 is the right edge of it, and
* likewise y for the output space, where y = 0 and y = 1 are the left and
* right edges of the first output tile, then clearly for these continuous
* variables y = k x. If the zero-offset integer indexes 'in' and 'out' are
* then assumed to refer to the *center* positions of their respective tiles,
* then clearly x(in) = in + 1/2 and y(out) = out + 1/2, so out + 1/2 = k(in +
* 1/2).
*/
double kernel_resize_out_from_in(double in, double k);
double kernel_resize_in_from_out(double out, double k);
/* Get a matrix element from the kernel. Should not need to be used, since
* kernel_apply() or kernel_apply_multiple() are the efficient ways to apply
* the kernel, but this is here for unit testing purposes. (This function has
* to do a binary search on the nonzero matrix elements.)
*/
double kernel_get(Kernel *this, ulong out, ulong in);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _H */
|
22931be474ef2e71c359c5352ade698216b9f1ed
|
5f390ad87fdc199e3dcea718ec66c8a024f39774
|
/Master/PixelEtherMega-master/Visual Micro/.PixelEtherMega.vsarduino.h
|
b4ebdea1263e4b24b6d4baf63be29df059e7bb94
|
[] |
no_license
|
ERGO-Telescope/PixelEtherMega
|
ada25b602b649bbcbed77c956d29832d9cbc030c
|
e971a1844cd0b88ed6001d661093611142ca3741
|
refs/heads/master
| 2021-01-01T19:43:16.992242 | 2013-11-21T17:10:46 | 2013-11-21T17:10:46 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,297 |
h
|
.PixelEtherMega.vsarduino.h
|
#ifndef _VSARDUINO_H_
#define _VSARDUINO_H_
//Board = Arduino Mega 2560 or Mega ADK
#define __AVR_ATmega2560__
#define _VMDEBUG 1
#define ARDUINO 104
#define __AVR__
#define F_CPU 16000000L
#define __cplusplus
#define __attribute__(x)
#define __inline__
#define __asm__(x)
#define __extension__
#define __ATTR_PURE__
#define __ATTR_CONST__
#define __inline__
#define __asm__
#define __volatile__
#define __builtin_va_list
#define __builtin_va_start
#define __builtin_va_end
#define __DOXYGEN__
#define prog_void
#define PGM_VOID_P int
#define NOINLINE __attribute__((noinline))
typedef unsigned char byte;
extern "C" void __cxa_pure_virtual() {;}
//
void TimeOut();
void ledState(byte state);
//
void CFG (byte * cmd,int size);
void ShieldInit();
int MessageReceived( );
long join_4_bytes(unsigned char Buffer[]);
long join_2_bytes(unsigned char Buffer[]);
long done_byte(unsigned char Buffer[]);
void Shieldubx_checksum(byte ubx_data);
#include "C:\Program Files\arduino\arduino-1.0.4\hardware\arduino\variants\mega\pins_arduino.h"
#include "C:\Program Files\arduino\arduino-1.0.4\hardware\arduino\cores\arduino\arduino.h"
#include "C:\Users\James Brown\Documents\Arduino\PixelEtherMega\PixelEtherMega.ino"
#include "C:\Users\James Brown\Documents\Arduino\PixelEtherMega\Shield.ino"
#endif
|
71613dbdc10da021e76f4ea4de9002bbf5f909ce
|
6fb5a203699a4a2a232019f6f895a370e1f40a62
|
/Sample07_02/Sample07_02.c
|
2330584e1f3a1c1aca693f8c28bc1f7f1e72ab05
|
[] |
no_license
|
quockhanh29/Practice-C-programming
|
16243c60a8d3339bae9a426add2f4370331e7f02
|
5d6c0a3df5a59df487d283eb02e2c351eebf74e8
|
refs/heads/master
| 2023-05-31T11:22:55.901905 | 2021-06-14T08:00:42 | 2021-06-14T08:00:42 | 376,746,762 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 485 |
c
|
Sample07_02.c
|
/*
* Sample07_02.c
*
* Created on: 2019/11/25
* Author: sannomiya
*/
#include <stdio.h>
int main(void){
int sum = 0;
int eng[5];
int i,j;
setvbuf(stdout, NULL, _IONBF, 0);
for(i =0; i< 5; i++){
printf("%d番目の人の点数を入力!", i + 1);
scanf("%d", &eng[i]);
sum += eng[i];
}
for( j = 0; j< 5; j++){
printf("%d番目の人の点数は%d点です。\n", j + 1, eng[j]);
}
printf("平均点は%f点です。\n", (double)sum/5);
return 0;
}
|
d4042567c0cf598884528ddf7a8428195127cea7
|
639dcc48a4339f41f49f6d9743c848b8ade0cc57
|
/launchpad/amos_stellaris_base/src/main.c
|
eaa9126393c010b41a7c8837c267b9fd76e5575d
|
[] |
no_license
|
AliRezaeeProjects/micro
|
852b80a721c79da6c50f2818b0ef191a1e8705b9
|
2b99bdd3c374f4095865cba834b44fd4043aabf9
|
refs/heads/master
| 2022-09-25T09:30:56.023657 | 2017-06-04T03:02:05 | 2017-06-04T03:02:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,763 |
c
|
main.c
|
#include <stdio.h>
#include "inc/lm4f120h5qr.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/systick.h"
#include "driverlib/watchdog.h"
#include "jaguar.h"
#include "cpu_interface.h"
#include "pwm.h"
#define WAIT_1MS ((SysCtlClockGet()/3)/1000)
#define LED_RED 0x2
#define LED_BLUE 0x4
#define LED_GREEN 0x8
volatile uint8_t clear_watchdog = 0;
void watchdog_int(void)
{
if( clear_watchdog )
{
WatchdogIntClear( WATCHDOG0_BASE );
}
else
{
GPIO_PORTF_DATA_R |= LED_GREEN|LED_BLUE|LED_RED;
}
clear_watchdog = 0;
}
int main(void)
{
// enable PORT F GPIO peripheral
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
// set LED PORT F pins as outputs
GPIO_PORTF_DIR_R = LED_RED|LED_BLUE|LED_GREEN;
// enable digital for LED PORT F pins
GPIO_PORTF_DEN_R = LED_RED|LED_BLUE|LED_GREEN;
// clear all PORT F pins
GPIO_PORTF_DATA_R = 0;
SysCtlDelay( 1000 * WAIT_1MS );
// Init lines go here...
SysCtlDelay( 10 * WAIT_1MS );
// cpu_message_init();
/*
// sys tick setup - overflow every 2 seconds
SysTickPeriodSet( 2 * SysCtlClockGet() );
SysTickEnable();
// Watchdog setup
WatchdogReloadSet( WATCHDOG0_BASE, SysCtlClockGet() / 2 );
WatchdogResetEnable( WATCHDOG0_BASE );
WatchdogIntEnable( WATCHDOG0_BASE );
WatchdogIntRegister( WATCHDOG0_BASE, watchdog_int );
// Lock and start it
WatchdogEnable( WATCHDOG0_BASE );
WatchdogLock( WATCHDOG0_BASE );
*/
SysCtlDelay( 10 * WAIT_1MS );
//jaguar_control_mode_set( SPEED_CONTROL, RIGHT_MOTOR, 20<<16 );
//jaguar_control_mode_set( SPEED_CONTROL, LEFT_MOTOR, 20<<16 );
pwm_init();
// loop forever
for(;;)
{
GPIO_PORTF_DATA_R |= LED_GREEN|LED_BLUE|LED_RED;
}
}
|
e37dce2398d6160623b20e131bea2c6b9799ddff
|
aa29a4ec0154e7863f65e98ddeefa4c93b89c23d
|
/Z80/Apps/Lib/utils3d.h
|
3b61f950f8139068ef13eca86383c23267878db6
|
[] |
no_license
|
svpetry/homebrewcomp
|
310ceb311740d51c75a47422b90146b27c01d727
|
6a1082227aed6ec8a4b3641071034ca285e39594
|
refs/heads/master
| 2022-03-15T22:38:27.148591 | 2022-02-25T10:24:57 | 2022-02-25T10:24:57 | 38,029,161 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 374 |
h
|
utils3d.h
|
#ifndef UTILS3D_H_
#define UTILS3D_H_
#include "defs.h"
struct vector {
int x;
int y;
int z;
};
struct point {
int x;
int y;
};
int sinus(int angle);
int cosinus(int angle);
void init_rotation(int alpha, int beta, int gamma);
void rotate(struct vector *v);
void vec2point(struct vector *v, struct point *p);
void setpoint(struct point *p);
#endif /* UTILS3D_H_ */
|
5e9253587fc06dee9b028077ec0213f72e78c534
|
931a72c74ce59dccde0bdc3e31a9e9d20c289112
|
/example/heapSort.c
|
5065c75c7672ab6c21c522018af342cde4c22c66
|
[] |
no_license
|
vking34/c-advanced
|
4b014172c0fc10d95ec8a3992932651217790014
|
47ad89ead48995f0acce0998a0e4bc229f9c7ffc
|
refs/heads/master
| 2018-09-18T11:41:03.543630 | 2018-06-06T02:18:36 | 2018-06-06T02:18:36 | 105,341,022 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 792 |
c
|
heapSort.c
|
#include<stdio.h>
#include<stdlib.h>
void heapify(int *arr, int n, int i)
{
int largest = i;
int l = 2*i + 1;
int r = 2*i + 2;
if(l < n && arr[l] > arr[largest])
largest = l;
if(r < n && arr[r] > arr[largest])
largest = r;
if(largest != i)
{
int temp = arr[i];
arr[i] = arr[largest];
arr[largest] = temp;
heapify(arr,n,largest);
}
}
void heapSort(int *arr, int n)
{
int i;
for(i = n/2 -1; i>= 0; i--)
{
heapify(arr,n,i);
}
for (i = n-1; i >= 0; i--) {
int temp = arr[0];
arr[0] = arr[i];
arr[i] = temp;
heapify(arr, i,0);
}
}
void main()
{
int list[5] = {23,1,12,73,22};
int i;
for(i = 0; i<5; i++)
{
printf("%d \t",list[i]);
}
printf("\n");
heapSort(list,5);
for(i = 0; i<5; i++)
{
printf("%d \t",list[i]);
}
printf("\n");
}
|
a17ec9807479366f50dbd66d47d5024348b2cf57
|
a5998e4734fb0a23dcf6d30d44aaaba432e1f0f6
|
/data/mfmodell/0/393.3.c
|
88c1044f51fa20b6545c6661db87ccf38fb4cefe
|
[] |
no_license
|
sanni85/Mod-l-galois-representations
|
79265c586475b8e8e6554720e8b7b7c43a9e87e8
|
3f005defe4f91023744a65900662f07a11711da2
|
refs/heads/master
| 2023-06-22T21:25:55.676082 | 2023-06-13T10:11:03 | 2023-06-13T10:11:03 | 58,478,734 | 0 | 5 | null | 2016-05-14T00:12:18 | 2016-05-10T16:57:14 | null |
UTF-8
|
C
| false | false | 232,016 |
c
|
393.3.c
|
393:3:3:71.170:[44]:[[44,0,0,-88,-4,0,4,0,132,0,36,0,4,0,-12,176,0,0,0,96,0,0,0,0,180,0,0,-44,0,0,0,0,36,-32,232,-264,0,-12,48,0,-200,0,76,-396,-12,-356,0,-144,216,0,0,-188,-76,0,-380,0,0,228,-188,48,8,488,12,-784,396,0,0,0,0,0,0,0,0,-188,-144,0,184,0,0,-264,396,0,0,-24,0,0,0,0,-552,0,244,0,0,204,0,0,0,0,108,-772,184,336,0,0,-108,0,248,0,204,0,0,928,8,-12,0,0,12,0,0,0,-252,0,-432,0,496,0,0,0,0,0,136,60,0,-824,-36,700,0,840,0,-128,0,1152,-668,528,0,1288,96,0,0,0,532,-736,0,0,0,-24,0,212,-396,0,0,0,0,228,240,-76,148,0,656,-400,0,-1604,0,-288,-1416,820,-1032,0,1956,288,0,0,-336,868,0,-1260,0,0,0,-1992,-68,576,532,-352,-432,48,0,0,0,0,0,0,0,0,-1360,1544,0,1544,0,0,-728,412,0,0,740,0,0,0,0,888,0,936,0,0,540,0,0,0,0,196,876,-436,24,0,0,-480,0,-4372,-2864,-552,0,0,0,1664,-3036,0,0,-4792,0,0,0,-132,0,1944,0,1744,0,0,0,-5724,0,28,-1084,0,-2028,2544,12,0,-188,0,-140,0,336,788,1640,0,-896,1880,0,0,0,-1224,-1216,0,0,0,228,0,916,-384,0,0,0,0,-72,592,108,3568,0,1920,1892,0,-528,0,2664,-96,904,-2348,0,-1548,-724,0,0,1516,696,0,-932,0,0,2568,-1164,2376,-1820,-792,2200,4792,408,0,0,0,0,0,0,0,0,-1656,1120,0,576,0,0,-36,-844,0,0,2648,0,0,0,0,144,0,-912,0,0,4764,0,0,0,0,-676,2020,840,196,0,0,3064,0,-600,-3040,220,0,0,732,-372,-4820,0,0,-1504,0,0,0,1640,0,2608,0,228,0,0,0,-676,0,96,608,0,-1188,-4176,-216,0,-2752,0,3672,0,2720,-36,2648,0,-1680,348,0,0,0,352,-1068,0,0,0,2364,0,-36,-1880,0,0,0,0,-984,3676,-3816,36,0,784,-432,0,-5908,0,224,-3096,-1620,-3572,0,648,2424,0,0,-952,-284,0,-6548,0,0,3844,-4156,768,980,1916,1428,-392,5004,0,0,0,0,0,0,0,0,-1672,-564,0,-4100,0,0,-6044,2004,0,0,-228,0,0,0,0,2420,0,-424,0,0,1264,0,0,0,0,2964,3116,-9540,-1140,0,0,1296,0,-3932,-1764,-4704,0,0,3120,2340,-960,0,0,-120,0,0,0,3472,0,168,0,-2720,0,0,0,684,0,288,600,0,-3104,480,-4132,0,-564,0,588,0,1224,6356,-720,0,-2096,144,0,0,0,-1892,-1676,0,0,0,24,0,2504,-2664,0,0,0,0,5288,1464,7136,3452,0,8312,4932,0,-3388,0,36,-7620,5632,-4200,0,-168,1524,0,0,-2352,2392,0,-1512,0,0,-204,-5840,-10652,1188,-656,4484,672,2272,0,0,0,0,0,0,0,0,-9840,5316,0,2912,0,0,-4972,5428,0,0,4284,0,0,0,0,5452,0,1872,0,0,-1284,0,0,0,0,-6344,3768,-3324,108,0,0,3480,0,-3232,-8552,-2808,0,0,5760,-1212,-2048,0,0,-7036,0,0,0,1020,0,4044,0,4180,0,0,0,-3056,0,1420,10856,0,-7264,2992,-6120,0,4108,0,10344,0,-564,6672,7200,0,-7012,2376,0,0,0,-432,-11908,0,0,0,11468,0,-2712,-4940,0,0,0,0,8412,-532,2040,3196,0,552,1624,0,-1728,0,2452,420,6396,-4836,0,-5364,8660,0,0,-6452,2892,0,-5296,0,0,6328,-2016,-184,-15932,-1740,3988,2452,-792,0,0,0,0,0,0,0,0,1188,4052,0,6480,0,0,2592,6936,0,0,28,0,0,0,0,2856,0,-14792,0,0,1692,0,0,0,0,4604,-848,-72,-5500,0,0,12388,0,-3852,-5096,-504,0,0,-3452,-6336,-2472,0,0,-8308,0,0,0,11384,0,4160,0,6564,0,0,0,-9844,0,4392,-312,0,-4140,15440,-600,0,-5400,0,-984,0,6448,-1800,1776,0,-1656,11612,0,0,0,1972,-4248,0,0,0,2304,0,-4056,-10628,0,0,0,0,732,9364,6700,5808,0,-5712,1920,0,-6912,0,-1904,-14584,2976,-7648,0,-3900,3676,0,0,-11700,6952,0,-9896,0,0,-3796,-6168,612,-3712,1700,2232,7420,3496,0,0,0,0,0,0,0,0,-10388,2028,0,-4704,0,0,-12264,-432,0,0,-1680,0,0,0,0,6164,0,-1636,0,0,-232,0,0,0,0,5184,5404,-9692,-7080,0,0,324,0,-3360,456,-12248,0,0,-692,4312,-2316,0,0,-1272,0,0,0,2076,0,552,0,-10968,0,0,0,-1356,0,2764,1008,0,2612,2472,-8864,0,-7668,0,11828,0,-10420,1924,3672,0,-6272,2748,0,0,0,-2724,-2792,0,0,0,732,0,8100,-324,0,0,0,0,8756,2616,17300,3576,0,-1632,14352,0,-4832,0,-1140,-1916,8124,744,0,-3968,4248,0,0,-1380,3724,0,0,0,0,-4656,-1340,-8832,1296,-7644,9812,612,-2684,0,0,0,0,0,0,0,0,4844,11988,0,740,0,0,-3472,5824,0,0]]:[]:[[421674979869,0,7279113197754,0,52147804278015,0,205730327719062,0,504997879401159,0,831776118933456,0,967714700307034,0,824575465176970,0,528176025714601,0,259205374025324,0,98814745280711,0,29549028937810,0,6975102651065,0,1303805928052,0,192978247561,0,22535622726,0,2059934278,0,145389586,0,7751510,0,301384,0,8052,0,132,0,1]]:[]:[<[421674979869,0,7279113197754,0,52147804278015,0,205730327719062,0,504997879401159,0,831776118933456,0,967714700307034,0,824575465176970,0,528176025714601,0,259205374025324,0,98814745280711,0,29549028937810,0,6975102651065,0,1303805928052,0,192978247561,0,22535622726,0,2059934278,0,145389586,0,7751510,0,301384,0,8052,0,132,0,1],[[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,10,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,-1016233579731951125699921224807449859072987987/31813924643485768818649693074404122352517120,0,-80590431737440525980966269196228422835816071873/69990634215668691401029324763689069175537664,0,-377658753875818240145346968362107177740498312849/34995317107834345700514662381844534587768832,0,-108369160539105381504818402577754718505173443163153/2362183904778818334784739710774506084674396160,0,-1026902742667395690815484467795169994555218912149597/9448735619115273339138958843098024338697584640,0,-4583186962949335105598960378552592508478447781667717/28346206857345820017416876529294073016092753920,0,-923343081770682140230253723787884563850252920567133/5669241371469164003483375305858814603218550784,0,-662222152855735669309826812727471332971781125190961/5669241371469164003483375305858814603218550784,0,-437743011676762929920870211012263070764763758007287/7086551714336455004354219132323518254023188480,0,-652908465211394165771315617079269859847092844737/26442357143046473896844101240013127813519360,0,-215241758205164819568294165250114729257060553545379/28346206857345820017416876529294073016092753920,0,-51537851383622301633376351096382195856594698935091/28346206857345820017416876529294073016092753920,0,-4839202651525953904811338773659517531408276521267/14173103428672910008708438264647036508046376960,0,-714830871791252276077969118199843841018634064971/14173103428672910008708438264647036508046376960,0,-55292091024835760695737568146164499425070619477/9448735619115273339138958843098024338697584640,0,-15020617905047300770986090202416385341813896587/28346206857345820017416876529294073016092753920,0,-1048336014594384916742623452048800797998569407/28346206857345820017416876529294073016092753920,0,-55213277754951063630822719100749916437139911/28346206857345820017416876529294073016092753920,0,-2119669633116156542755126724333504824584259/28346206857345820017416876529294073016092753920,0,-18637712335767056752275780390483131279531/9448735619115273339138958843098024338697584640,0,-301726851699377655340351288411714994221/9448735619115273339138958843098024338697584640,0,-6774558287476498932297336512356800793/28346206857345820017416876529294073016092753920],[-252699388288292674052328591021750922612577107/31813924643485768818649693074404122352517120,0,-79610562858421164301351858649536775867358544577/69990634215668691401029324763689069175537664,0,-377623758558710405799646453699725333205910544017/34995317107834345700514662381844534587768832,0,-108369160539105381504818402577754718505173443163153/2362183904778818334784739710774506084674396160,0,-1026902742667395690815484467795169994555218912149597/9448735619115273339138958843098024338697584640,0,-4583186962949335105598960378552592508478447781667717/28346206857345820017416876529294073016092753920,0,-923343081770682140230253723787884563850252920567133/5669241371469164003483375305858814603218550784,0,-662222152855735669309826812727471332971781125190961/5669241371469164003483375305858814603218550784,0,-437743011676762929920870211012263070764763758007287/7086551714336455004354219132323518254023188480,0,-652908465211394165771315617079269859847092844737/26442357143046473896844101240013127813519360,0,-215241758205164819568294165250114729257060553545379/28346206857345820017416876529294073016092753920,0,-51537851383622301633376351096382195856594698935091/28346206857345820017416876529294073016092753920,0,-4839202651525953904811338773659517531408276521267/14173103428672910008708438264647036508046376960,0,-714830871791252276077969118199843841018634064971/14173103428672910008708438264647036508046376960,0,-55292091024835760695737568146164499425070619477/9448735619115273339138958843098024338697584640,0,-15020617905047300770986090202416385341813896587/28346206857345820017416876529294073016092753920,0,-1048336014594384916742623452048800797998569407/28346206857345820017416876529294073016092753920,0,-55213277754951063630822719100749916437139911/28346206857345820017416876529294073016092753920,0,-2119669633116156542755126724333504824584259/28346206857345820017416876529294073016092753920,0,-18637712335767056752275780390483131279531/9448735619115273339138958843098024338697584640,0,-301726851699377655340351288411714994221/9448735619115273339138958843098024338697584640,0,-6774558287476498932297336512356800793/28346206857345820017416876529294073016092753920,0],[-1016233579731951125699921224807449859072987987/31813924643485768818649693074404122352517120,0,-80590431737440525980966269196228422835816071873/69990634215668691401029324763689069175537664,0,-377658753875818240145346968362107177740498312849/34995317107834345700514662381844534587768832,0,-108369160539105381504818402577754718505173443163153/2362183904778818334784739710774506084674396160,0,-1026902742667395690815484467795169994555218912149597/9448735619115273339138958843098024338697584640,0,-4583186962949335105598960378552592508478447781667717/28346206857345820017416876529294073016092753920,0,-923343081770682140230253723787884563850252920567133/5669241371469164003483375305858814603218550784,0,-662222152855735669309826812727471332971781125190961/5669241371469164003483375305858814603218550784,0,-437743011676762929920870211012263070764763758007287/7086551714336455004354219132323518254023188480,0,-652908465211394165771315617079269859847092844737/26442357143046473896844101240013127813519360,0,-215241758205164819568294165250114729257060553545379/28346206857345820017416876529294073016092753920,0,-51537851383622301633376351096382195856594698935091/28346206857345820017416876529294073016092753920,0,-4839202651525953904811338773659517531408276521267/14173103428672910008708438264647036508046376960,0,-714830871791252276077969118199843841018634064971/14173103428672910008708438264647036508046376960,0,-55292091024835760695737568146164499425070619477/9448735619115273339138958843098024338697584640,0,-15020617905047300770986090202416385341813896587/28346206857345820017416876529294073016092753920,0,-1048336014594384916742623452048800797998569407/28346206857345820017416876529294073016092753920,0,-55213277754951063630822719100749916437139911/28346206857345820017416876529294073016092753920,0,-2119669633116156542755126724333504824584259/28346206857345820017416876529294073016092753920,0,-18637712335767056752275780390483131279531/9448735619115273339138958843098024338697584640,0,-301726851699377655340351288411714994221/9448735619115273339138958843098024338697584640,0,-6774558287476498932297336512356800793/28346206857345820017416876529294073016092753920,0],[4666735751189872484750307248221428838617733102647760778896226153402143/98386208313140681755174766470265300233092912199564432875178650992640,0,570978983153745412678904069957615410172824438094232318399928797041521349/216449658288909499861384486234583660512804406839041752325393032183808,0,8282369019868781996384107835608693516016943483791624051315382442082117479/324674487433364249792076729351875490769206610258562628488089548275712,0,780246076926067561836936068254347853946576148527396787510130170686615302337/7305175967250695620321726410417198542307148730817659140982014836203520,0,7319185740931505999223842972427983852031483722898183265209929928025512865793/29220703869002782481286905641668794169228594923270636563928059344814080,0,32476187042813045521028784856268591730602794078803438992115533255249870751913/87662111607008347443860716925006382507685784769811909691784178034442240,0,175796349768360215289462987563824920188383738151393014245187257637794302045/473849251929774851047895767162196662203706944701685998333968529915904,0,4627951279497610627235858538595677329721794390275484889669129821875482379157/17532422321401669488772143385001276501537156953962381938356835606888448,0,81815377771163602831857261767545927839386742056868349954586648384682649019/592311564912218563809869708952745827754633680877107497917460662394880,0,2229016200550367530912358571597781358216622413630710952249066557938996319/40887178921179266531651453789648499303957922000845107132362023336960,0,1448754868202658790716382481678895349735758388634142580228558960364343741631/87662111607008347443860716925006382507685784769811909691784178034442240,0,341627960065162939893421792166112495024143129475577924445863769641049663279/87662111607008347443860716925006382507685784769811909691784178034442240,0,31578366814278517005212240362958097039881658042799411694604846995948560463/43831055803504173721930358462503191253842892384905954845892089017221120,0,4592443030796118049090346462852634720563970803927918719211248515908128199/43831055803504173721930358462503191253842892384905954845892089017221120,0,349884844495112928344200296562183905358731908801246068885718898445564393/29220703869002782481286905641668794169228594923270636563928059344814080,0,93688985064784225930693086000480500614777005210603438994529452573657783/87662111607008347443860716925006382507685784769811909691784178034442240,0,6451205925882286923764378566518377860020815223440904155055254209143883/87662111607008347443860716925006382507685784769811909691784178034442240,0,335566371149164205935625783687100479365081881053446490224457219805779/87662111607008347443860716925006382507685784769811909691784178034442240,0,12737414927813668592219989777522786984120114303518466290260949361711/87662111607008347443860716925006382507685784769811909691784178034442240,0,110860414037542446204019932802403128486615234876961443022913539639/29220703869002782481286905641668794169228594923270636563928059344814080,0,1778502034511911099545524925314177309114182678259614039604202289/29220703869002782481286905641668794169228594923270636563928059344814080,0,39613666166653115647812944762220298432561558295564552673649837/87662111607008347443860716925006382507685784769811909691784178034442240,0],[0,153246599133119585587420450971370785480202705778462408564970436221427/125173293019262953886990797035960941772382839948555258110914314240,0,1310142527696592957563953227499117457015447031078527854604161918711469/75103975811557772332194478221576565063429703969133154866548588544,0,11495521587761129019269623223398704994789204008586499619074596475147639/112655963717336658498291717332364847595144555953699732299822882816,0,276103859453699274514307240213604748657398204689776767046263463221530423/844919727880024938737187879992736356963584169652747992248671621120,0,731752301012161404153938381148267143154818996913386247194653682871315869/1126559637173366584982917173323648475951445559536997322998228828160,0,8775278899563650886025996940104638700862079103134531214231820143780174387/10139036734560299264846254559912836283563010035832975906984059453440,0,44643041724544411708289786212732679439967116474297526428427992396952331/54805603970596212242412186810339655586827081274772842740454375424,0,1139208283945350305508653478108249897569896266565825452081140323473187487/2027807346912059852969250911982567256712602007166595181396811890688,0,19968258389230679768607693445137119712659933201679359528132972502783911/68507004963245265303015233512924569483533851593466053425567969280,0,2192790429465488168070755017788818531987293786394802052641097013230069/18916113310746826986653459999837381126050391857897343110044887040,0,363063766959135690860093096230460609991015606040037230282105809648649969/10139036734560299264846254559912836283563010035832975906984059453440,0,87875628657324912156256627817644788484603725607670813586733013802672821/10139036734560299264846254559912836283563010035832975906984059453440,0,8373822460738993597308182748849573088978908131771225232896858827754537/5069518367280149632423127279956418141781505017916487953492029726720,0,1258201220157421276039400561747675462791015009522749394819842719286821/5069518367280149632423127279956418141781505017916487953492029726720,0,99101381708802209216166812681464344588723485988433525309433834602607/3379678911520099754948751519970945427854336678610991968994686484480,0,27421546919422401917080650196368538271929160662763288120430204191797/10139036734560299264846254559912836283563010035832975906984059453440,0,1948817810606907017431885014204560162381528413113624998925670955797/10139036734560299264846254559912836283563010035832975906984059453440,0,104449319247657081526306385232419396567893537829590806376616934161/10139036734560299264846254559912836283563010035832975906984059453440,0,4077102522346901729869821943748402272580894819670590935047257209/10139036734560299264846254559912836283563010035832975906984059453440,0,36414507196389807832471476080608004266108958987241109258063181/3379678911520099754948751519970945427854336678610991968994686484480,0,598200822130342999005829428506115666406102726748254313758391/3379678911520099754948751519970945427854336678610991968994686484480,0,13614870616608171060441885955989581375098075809200276602303/10139036734560299264846254559912836283563010035832975906984059453440],[0,-6994324611655964535077788141116401268864005326769667488777549919793549/9838620831314068175517476647026530023309291219956443287517865099264,0,-996984230791954737461293327862014924612152098275174939013922335849651443/108224829144454749930692243117291830256402203419520876162696516091904,0,-7842030492250942730966263292758196172388565635879045681968981483689704925/162337243716682124896038364675937745384603305129281314244044774137856,0,-103564462221439536251052340254823516577549445107019892257550065352564769693/730517596725069562032172641041719854230714873081765914098201483620352,0,-801636330008375880456442017958478316591999027559919437304004999552024850043/2922070386900278248128690564166879416922859492327063656392805934481408,0,-3321254507022944690317163435922401802916386633047374583307839378435472207883/8766211160700834744386071692500638250768578476981190969178417803444224,0,-91480984550247017117895924186504457080810504379094863825000918029767744371/236924625964887425523947883581098331101853472350842999166984264957952,0,-2583275269889141614373902209382754022288587348383641304160914855988233369363/8766211160700834744386071692500638250768578476981190969178417803444224,0,-10074487739735102226653389673251364776570338628958547715186668882100337963/59231156491221856380986970895274582775463368087710749791746066239488,0,-1225505873005702668120177238359114114771965303613867224804816625114837469/16354871568471706612660581515859399721583168800338042852944809334784,0,-222810595652563143084008465115218466658689652206151269099062506028386244725/8766211160700834744386071692500638250768578476981190969178417803444224,0,-58615520919654168215211929966181903904481088292142895099495178200635903837/8766211160700834744386071692500638250768578476981190969178417803444224,0,-6009756139552114726058941300556530151125901228217109225044326811609188981/4383105580350417372193035846250319125384289238490595484589208901722112,0,-962548521244209655544292071532709402036804099569817461614385364782963269/4383105580350417372193035846250319125384289238490595484589208901722112,0,-80150374335092658048118118896812101816153048232100956644893199936861515/2922070386900278248128690564166879416922859492327063656392805934481408,0,-23278673404993242459990158876060382903599777484279646053451954858494493/8766211160700834744386071692500638250768578476981190969178417803444224,0,-1725848587988113246310061268462163943750765745726887115358679632283961/8766211160700834744386071692500638250768578476981190969178417803444224,0,-95986988778075733088897375061181977760384276080129103345281585053801/8766211160700834744386071692500638250768578476981190969178417803444224,0,-3870566194416556642398305819801266066273807516441403654482736738029/8766211160700834744386071692500638250768578476981190969178417803444224,0,-35574119964290588042206122567870541882380675342892615516758256349/2922070386900278248128690564166879416922859492327063656392805934481408,0,-599376736103472044464633530744534997650301803309294286514219035/2922070386900278248128690564166879416922859492327063656392805934481408,0,-13951269550509821179638953904629769313169816623629656117440231/8766211160700834744386071692500638250768578476981190969178417803444224],[153246599133119585587420450971370785480202705778462408564970436221427/125173293019262953886990797035960941772382839948555258110914314240,0,1310142527696592957563953227499117457015447031078527854604161918711469/75103975811557772332194478221576565063429703969133154866548588544,0,11495521587761129019269623223398704994789204008586499619074596475147639/112655963717336658498291717332364847595144555953699732299822882816,0,276103859453699274514307240213604748657398204689776767046263463221530423/844919727880024938737187879992736356963584169652747992248671621120,0,731752301012161404153938381148267143154818996913386247194653682871315869/1126559637173366584982917173323648475951445559536997322998228828160,0,8775278899563650886025996940104638700862079103134531214231820143780174387/10139036734560299264846254559912836283563010035832975906984059453440,0,44643041724544411708289786212732679439967116474297526428427992396952331/54805603970596212242412186810339655586827081274772842740454375424,0,1139208283945350305508653478108249897569896266565825452081140323473187487/2027807346912059852969250911982567256712602007166595181396811890688,0,19968258389230679768607693445137119712659933201679359528132972502783911/68507004963245265303015233512924569483533851593466053425567969280,0,2192790429465488168070755017788818531987293786394802052641097013230069/18916113310746826986653459999837381126050391857897343110044887040,0,363063766959135690860093096230460609991015606040037230282105809648649969/10139036734560299264846254559912836283563010035832975906984059453440,0,87875628657324912156256627817644788484603725607670813586733013802672821/10139036734560299264846254559912836283563010035832975906984059453440,0,8373822460738993597308182748849573088978908131771225232896858827754537/5069518367280149632423127279956418141781505017916487953492029726720,0,1258201220157421276039400561747675462791015009522749394819842719286821/5069518367280149632423127279956418141781505017916487953492029726720,0,99101381708802209216166812681464344588723485988433525309433834602607/3379678911520099754948751519970945427854336678610991968994686484480,0,27421546919422401917080650196368538271929160662763288120430204191797/10139036734560299264846254559912836283563010035832975906984059453440,0,1948817810606907017431885014204560162381528413113624998925670955797/10139036734560299264846254559912836283563010035832975906984059453440,0,104449319247657081526306385232419396567893537829590806376616934161/10139036734560299264846254559912836283563010035832975906984059453440,0,4077102522346901729869821943748402272580894819670590935047257209/10139036734560299264846254559912836283563010035832975906984059453440,0,36414507196389807832471476080608004266108958987241109258063181/3379678911520099754948751519970945427854336678610991968994686484480,0,598200822130342999005829428506115666406102726748254313758391/3379678911520099754948751519970945427854336678610991968994686484480,0,13614870616608171060441885955989581375098075809200276602303/10139036734560299264846254559912836283563010035832975906984059453440,0],[2930691345315546895007278932294616752988364588821310953354117761333059/24596552078285170438793691617566325058273228049891108218794662748160,0,215920496433351158950977905144623083230656567411146570426088871756727997/54112414572227374965346121558645915128201101709760438081348258045952,0,3260345821732012956746718980575853231555175433767164927664946665722582123/81168621858341062448019182337968872692301652564640657122022387068928,0,338718346507037111156637070345535729897816375638281902563116452413494968731/1826293991812673905080431602604299635576787182704414785245503709050880,0,3423346715859838744063310467032437603626507977801482081626824657416899019749/7305175967250695620321726410417198542307148730817659140982014836203520,0,16045510553085287680099889077627575267656809578169939689830359150588145473889/21915527901752086860965179231251595626921446192452977422946044508610560,0,90808196068831479662105618572231490638220735198022374044807946299249365817/118462312982443712761973941790549165550926736175421499583492132478976,0,2488103141197080277172257824739242577052055455013761643362321242889019420925/4383105580350417372193035846250319125384289238490595484589208901722112,0,45699032496816172651745168024432313724519393825499557077761707036358728507/148077891228054640952467427238186456938658420219276874479365165598720,0,2585103789795378393793116736133053766307356042732875745736370209750914989/20443589460589633265825726894824249651978961000422553566181011668480,0,871632340191286195714846122312396396960864716773999896214510612400336467523/21915527901752086860965179231251595626921446192452977422946044508610560,0,213081071601864382404228823714744804967688318211985874551295111756677310007/21915527901752086860965179231251595626921446192452977422946044508610560,0,20395691941753915773157056989267127564667166871831231917400246269176034779/10957763950876043430482589615625797813460723096226488711473022254305280,0,3066966528954004356983890377171876975468856961456561748995804184178279207/10957763950876043430482589615625797813460723096226488711473022254305280,0,241181927032787930775749043757051381614659458219963532449017212577236789/7305175967250695620321726410417198542307148730817659140982014836203520,0,66529052758374864067824708334684335139701124742059915781096485769514479/21915527901752086860965179231251595626921446192452977422946044508610560,0,4709332735802503867707362806447916220408860615466693078979015270359599/21915527901752086860965179231251595626921446192452977422946044508610560,0,251280317563119672940047630728971006910333058433891031037686076423307/21915527901752086860965179231251595626921446192452977422946044508610560,0,9763094076186418110835641962536078898093760383199446819717388628883/21915527901752086860965179231251595626921446192452977422946044508610560,0,86794552599378938626746681538581240798759308995364585220897482167/7305175967250695620321726410417198542307148730817659140982014836203520,0,1419379942494977946549367906493350661159416116545696158520104757/7305175967250695620321726410417198542307148730817659140982014836203520,0,32164929771600252724020780891896926416868359935853758870325461/21915527901752086860965179231251595626921446192452977422946044508610560,0],[7004163232487278603253305617763427798887314617989623932065067784892813/9838620831314068175517476647026530023309291219956443287517865099264,0,996984230791954737461293327862014924612152098275174939013922335849651443/108224829144454749930692243117291830256402203419520876162696516091904,0,7842030492250942730966263292758196172388565635879045681968981483689704925/162337243716682124896038364675937745384603305129281314244044774137856,0,103564462221439536251052340254823516577549445107019892257550065352564769693/730517596725069562032172641041719854230714873081765914098201483620352,0,801636330008375880456442017958478316591999027559919437304004999552024850043/2922070386900278248128690564166879416922859492327063656392805934481408,0,3321254507022944690317163435922401802916386633047374583307839378435472207883/8766211160700834744386071692500638250768578476981190969178417803444224,0,91480984550247017117895924186504457080810504379094863825000918029767744371/236924625964887425523947883581098331101853472350842999166984264957952,0,2583275269889141614373902209382754022288587348383641304160914855988233369363/8766211160700834744386071692500638250768578476981190969178417803444224,0,10074487739735102226653389673251364776570338628958547715186668882100337963/59231156491221856380986970895274582775463368087710749791746066239488,0,1225505873005702668120177238359114114771965303613867224804816625114837469/16354871568471706612660581515859399721583168800338042852944809334784,0,222810595652563143084008465115218466658689652206151269099062506028386244725/8766211160700834744386071692500638250768578476981190969178417803444224,0,58615520919654168215211929966181903904481088292142895099495178200635903837/8766211160700834744386071692500638250768578476981190969178417803444224,0,6009756139552114726058941300556530151125901228217109225044326811609188981/4383105580350417372193035846250319125384289238490595484589208901722112,0,962548521244209655544292071532709402036804099569817461614385364782963269/4383105580350417372193035846250319125384289238490595484589208901722112,0,80150374335092658048118118896812101816153048232100956644893199936861515/2922070386900278248128690564166879416922859492327063656392805934481408,0,23278673404993242459990158876060382903599777484279646053451954858494493/8766211160700834744386071692500638250768578476981190969178417803444224,0,1725848587988113246310061268462163943750765745726887115358679632283961/8766211160700834744386071692500638250768578476981190969178417803444224,0,95986988778075733088897375061181977760384276080129103345281585053801/8766211160700834744386071692500638250768578476981190969178417803444224,0,3870566194416556642398305819801266066273807516441403654482736738029/8766211160700834744386071692500638250768578476981190969178417803444224,0,35574119964290588042206122567870541882380675342892615516758256349/2922070386900278248128690564166879416922859492327063656392805934481408,0,599376736103472044464633530744534997650301803309294286514219035/2922070386900278248128690564166879416922859492327063656392805934481408,0,13951269550509821179638953904629769313169816623629656117440231/8766211160700834744386071692500638250768578476981190969178417803444224,0],[-192751439412943577695824878417527445003417549/2120928309565717921243312871626941490167808,0,-121339453993578375664648092204230429102982464139/23330211405222897133676441587896356391845888,0,-1870101640796063107294133309176843652795114524801/34995317107834345700514662381844534587768832,0,-37304172515669848229991932515554749951534646324103/157478926985254555652315980718300405644959744,0,-363634260565049061367440819555004613653443596451811/629915707941018222609263922873201622579838976,0,-1662994280390167688473875300091114912570463467428299/1889747123823054667827791768619604867739516928,0,-1715175984879463044130071693677049415526221354933583/1889747123823054667827791768619604867739516928,0,-1259816362884069961109351814118454393734171438481819/1889747123823054667827791768619604867739516928,0,-170646396204495634181391236620484716159716096494185/472436780955763666956947942154901216934879232,0,-260850583344840463799489816184833215221615112195/1762823809536431593122940082667541854234624,0,-88129478158085566412871084638521427746810943895101/1889747123823054667827791768619604867739516928,0,-21619149841958333699852847146772619808034546098173/1889747123823054667827791768619604867739516928,0,-2078501457705401813318687417403935463035254096525/944873561911527333913895884309802433869758464,0,-314122216980042354099819700593868584378970242565/944873561911527333913895884309802433869758464,0,-24835044349166316172284152868625191837667203659/629915707941018222609263922873201622579838976,0,-6888739386861603745568976903723620703647307749/1889747123823054667827791768619604867739516928,0,-490365943862119466758143076320296373992468705/1889747123823054667827791768619604867739516928,0,-26311030425000942268760532147937409669511145/1889747123823054667827791768619604867739516928,0,-1027882616179403109910756833190138697979869/1889747123823054667827791768619604867739516928,0,-9186777338825475779657562309379091942629/629915707941018222609263922873201622579838976,0,-151010600158426636668789128119184527763/629915707941018222609263922873201622579838976,0,-3439080725072940036772630978545872183/1889747123823054667827791768619604867739516928,0],[0,220021022501469135323699473916632305357953930437342791733344203256733/375519879057788861660972391107882825317148519845665774332742942720,0,8116297773123529751685304042865725589060499111091179283824042672189223/826143733927135495654139260437342215697726743660464703532034473984,0,9170865987030532552859191321979975231791860226226206193651149784080213/137690622321189249275689876739557035949621123943410783922005745664,0,6791230367629947709255090415632679355525610452755526794168406298454253767/27882351020040822978327200039760299779798277598540683744206163496960,0,60742540908176941900208728564839497729255986101268115685208650351790167683/111529404080163291913308800159041199119193110394162734976824653987840,0,269420552906384762932324197240218802662356971444142849426623426527238303283/334588212240489875739926400477123597357579331182488204930473961963520,0,1502240299189221676713279148413582642565449940859246524123729516988004983/1808584931029675003999602164741208634365293682067503810434994388992,0,41553153395278206038114363213225660062401388157248500459775676117086235543/66917642448097975147985280095424719471515866236497640986094792392704,0,781698678266893123463892490971063676332758889051963842005241174873860949/2260731163787093754999502705926510792956617102584379763043742986240,0,11414201397144171274553318342868240081763992058029439526682379030674437/78028967406830661319945522499329197144957866413826540328935159040,0,15956829793479102542543807170188996939372218951482038845989593914679211501/334588212240489875739926400477123597357579331182488204930473961963520,0,4048289852949169033667470598722033893546115660078948465653621148849393109/334588212240489875739926400477123597357579331182488204930473961963520,0,401957679174432917346277059092759235493756139427147925471908399163135133/167294106120244937869963200238561798678789665591244102465236980981760,0,62608915828809670777846000522780376285021929238277361941121094937484829/167294106120244937869963200238561798678789665591244102465236980981760,0,5089680912971232687116929870846215688218894004381826176501836070460923/111529404080163291913308800159041199119193110394162734976824653987840,0,1448099185839246419742157133760035798759068701056203871787855509648173/334588212240489875739926400477123597357579331182488204930473961963520,0,105481917030535898571477543849575206283677213083109929440795493161713/334588212240489875739926400477123597357579331182488204930473961963520,0,5778495097301205874088215279928213085584699930261945070074381987009/334588212240489875739926400477123597357579331182488204930473961963520,0,230001131482807657814524296626896515840273992424844554200413848781/334588212240489875739926400477123597357579331182488204930473961963520,0,2090386480235598230935049009045604744848188960144313311483796669/111529404080163291913308800159041199119193110394162734976824653987840,0,34881314111465516765384994054999404615219688322451448055057939/111529404080163291913308800159041199119193110394162734976824653987840,0,805136908719307897300149319309535532212366775305780646699487/334588212240489875739926400477123597357579331182488204930473961963520],[0,6988019834765443937055707768567115233695732303/31813924643485768818649693074404122352517120,0,686380088930497230917809353397604978652211679909/69990634215668691401029324763689069175537664,0,1126912218766445355958507060875090787919035925399/11665105702611448566838220793948178195922944,0,993039229891469249469152598044340123293713467514157/2362183904778818334784739710774506084674396160,0,9562124879145318683773550164505749183022529595375553/9448735619115273339138958843098024338697584640,0,43277662057649855749503971015577093722470743138095353/28346206857345820017416876529294073016092753920,0,8838900281721117693311229976182686501979675747069281/5669241371469164003483375305858814603218550784,0,6428337700075152560567362693265248513089638816209301/5669241371469164003483375305858814603218550784,0,4310667989774486232404349393356323025454796479441923/7086551714336455004354219132323518254023188480,0,6524392611018183620077609711089577667712598061873/26442357143046473896844101240013127813519360,0,2182909205191942774466242930578280333230406372608031/28346206857345820017416876529294073016092753920,0,530438653163864212031298111587118080546896987212959/28346206857345820017416876529294073016092753920,0,50534332471684842819025666355697102071161917532943/14173103428672910008708438264647036508046376960,0,7571156741865644415809171981707404129759089898359/14173103428672910008708438264647036508046376960,0,593694029336837785367212565614035875265290532793/9448735619115273339138958843098024338697584640,0,163413562423113259267479014365519851921965202583/28346206857345820017416876529294073016092753920,0,11548833216309331668342639952999648801881308203/28346206857345820017416876529294073016092753920,0,615518567394818388554698858622060810791226819/28346206857345820017416876529294073016092753920,0,23896917775155672819681859395186099768035071/28346206857345820017416876529294073016092753920,0,212352509425450363703966556202618904257559/9448735619115273339138958843098024338697584640,0,3472066409173910171393242075434627893329/9448735619115273339138958843098024338697584640,0,78684444026000096280778810727615285917/28346206857345820017416876529294073016092753920],[-220021022501469135323699473916632305357953930437342791733344203256733/375519879057788861660972391107882825317148519845665774332742942720,0,-8116297773123529751685304042865725589060499111091179283824042672189223/826143733927135495654139260437342215697726743660464703532034473984,0,-9170865987030532552859191321979975231791860226226206193651149784080213/137690622321189249275689876739557035949621123943410783922005745664,0,-6791230367629947709255090415632679355525610452755526794168406298454253767/27882351020040822978327200039760299779798277598540683744206163496960,0,-60742540908176941900208728564839497729255986101268115685208650351790167683/111529404080163291913308800159041199119193110394162734976824653987840,0,-269420552906384762932324197240218802662356971444142849426623426527238303283/334588212240489875739926400477123597357579331182488204930473961963520,0,-1502240299189221676713279148413582642565449940859246524123729516988004983/1808584931029675003999602164741208634365293682067503810434994388992,0,-41553153395278206038114363213225660062401388157248500459775676117086235543/66917642448097975147985280095424719471515866236497640986094792392704,0,-781698678266893123463892490971063676332758889051963842005241174873860949/2260731163787093754999502705926510792956617102584379763043742986240,0,-11414201397144171274553318342868240081763992058029439526682379030674437/78028967406830661319945522499329197144957866413826540328935159040,0,-15956829793479102542543807170188996939372218951482038845989593914679211501/334588212240489875739926400477123597357579331182488204930473961963520,0,-4048289852949169033667470598722033893546115660078948465653621148849393109/334588212240489875739926400477123597357579331182488204930473961963520,0,-401957679174432917346277059092759235493756139427147925471908399163135133/167294106120244937869963200238561798678789665591244102465236980981760,0,-62608915828809670777846000522780376285021929238277361941121094937484829/167294106120244937869963200238561798678789665591244102465236980981760,0,-5089680912971232687116929870846215688218894004381826176501836070460923/111529404080163291913308800159041199119193110394162734976824653987840,0,-1448099185839246419742157133760035798759068701056203871787855509648173/334588212240489875739926400477123597357579331182488204930473961963520,0,-105481917030535898571477543849575206283677213083109929440795493161713/334588212240489875739926400477123597357579331182488204930473961963520,0,-5778495097301205874088215279928213085584699930261945070074381987009/334588212240489875739926400477123597357579331182488204930473961963520,0,-230001131482807657814524296626896515840273992424844554200413848781/334588212240489875739926400477123597357579331182488204930473961963520,0,-2090386480235598230935049009045604744848188960144313311483796669/111529404080163291913308800159041199119193110394162734976824653987840,0,-34881314111465516765384994054999404615219688322451448055057939/111529404080163291913308800159041199119193110394162734976824653987840,0,-805136908719307897300149319309535532212366775305780646699487/334588212240489875739926400477123597357579331182488204930473961963520,0],[0,-5241015925259822541321179599874180062267634176934243569429060927309/2933749055138975481726346805530334572790222811294263861974554240,0,-914320147210075568032496812184181042694240185816508887453947829617947/34422655580297312318922469184889258987405280985852695980501436416,0,-25183268935547064858886150351139478336011662536626121467148763272590693/154901950111337905435151111332001665443323764436337131912256463872,0,-953772531026517321111666963143113805825418145425211591246237304666553103/1742646938752551436145450002485018736237392349908792734012885218560,0,-4000277934717552741091968889436875937470290034379793454071278526936934931/3485293877505102872290900004970037472474784699817585468025770437120,0,-67515663071941672041215267597279410437397972407899016753150107739601052839/41823526530061234467490800059640449669697416397811025616309245245440,0,-45221056345931422075290454629412461639121663940110560029991245611364761/28259139547338671937493783824081384911957713782304747038046787328,0,-9686251401998972766097112430115761066634528235815252172740226458917754601/8364705306012246893498160011928089933939483279562205123261849049088,0,-354664769979008545246410768932759611379534059911938010741082850300474539/565182790946773438749875676481627698239154275646094940760935746560,0,-80976679168333747812630212454987009956772162063663663462734628083650327/312115869627322645279782089997316788579831465655306161315740636160,0,-1734460824091736801065034855262594208531975010928747570155162694051183029/20911763265030617233745400029820224834848708198905512808154622622720,0,-865394019896370386419891771456725988275710322109844361360948838136435897/41823526530061234467490800059640449669697416397811025616309245245440,0,-330817390814785843836263753096602680204569592410200837217054964326399/81686575254025848569317968866485253261127766401974659406853994620,0,-13026852491738408086481164566961172693348895044398709906644494717056927/20911763265030617233745400029820224834848708198905512808154622622720,0,-261882009887211097442950789662280425057641510502224279145407639853121/3485293877505102872290900004970037472474784699817585468025770437120,0,-295223606052338430711760950176245128518785147566374883914358432232759/41823526530061234467490800059640449669697416397811025616309245245440,0,-10663320896276648917469791234436097903257421085668029519172009756467/20911763265030617233745400029820224834848708198905512808154622622720,0,-1159814713796888830938262877765685875973563604764366829535620282977/41823526530061234467490800059640449669697416397811025616309245245440,0,-11466941017198982270693154348318777678941262511859900913452443807/10455881632515308616872700014910112417424354099452756404077311311360,0,-414504751122719892527301547245121794873633709230406667864582537/13941175510020411489163600019880149889899138799270341872103081748480,0,-860218347711873381811256848893844756479805635000848775557369/1742646938752551436145450002485018736237392349908792734012885218560,0,-158131811185724248740675143765570925141052036408868749160971/41823526530061234467490800059640449669697416397811025616309245245440],[0,-53976789727699033561942317009908658920140248166290781309430544795619865/13528103643056843741336530389661478782050275427440109520337064511488,0,-1288101516991207978333688728511171343593070213655656374686827610787452759/27056207286113687482673060779322957564100550854880219040674129022976,0,-1435647915300651070347820836458348435171093768170356632851782787195569149/6764051821528421870668265194830739391025137713720054760168532255744,0,-168218984674655128958359291200444623693982507588865819104533138764436342123/365258798362534781016086320520859927115357436540882957049100741810176,0,-5934249377988057690810676883639515264970425576570060048900546606487506495/11414337448829211906752697516276872722354919891902592407784398181568,0,-503056085704265375549509507082378874405859464740127386226922782691113412403/2191552790175208686096517923125159562692144619245297742294604450861056,0,4942370890765604748699836525182532866588895760994217177706400140727584269/29615578245610928190493485447637291387731684043855374895873033119744,0,763221051871909288626684116856374359425137111619411973939107271844553908821/2191552790175208686096517923125159562692144619245297742294604450861056,0,4262035859807809316066496071420335953984136786958286847528891858215435551/14807789122805464095246742723818645693865842021927687447936516559872,0,622406362079415705554048059463089729686038768204831986237641696878111167/4088717892117926653165145378964849930395792200084510713236202333696,0,62841540022853146882873385867246861755477912930198517727965795290988134661/1095776395087604343048258961562579781346072309622648871147302225430528,0,35264561914161825464980339872555814566399989720912418929380744333988793707/2191552790175208686096517923125159562692144619245297742294604450861056,0,235528554501529397950096289961088835322276529168637899705149023679298307/68486024692975271440516185097661236334129519351415554446706389089408,0,620428078211215430872909664592542497975439540031393124285897757722836269/1095776395087604343048258961562579781346072309622648871147302225430528,0,26322780588472339786883952173426124004466909623150048215621362808698033/365258798362534781016086320520859927115357436540882957049100741810176,0,15493703525759352013206947577211592047391407549951016480930353406984995/2191552790175208686096517923125159562692144619245297742294604450861056,0,579803523457616683279904906069048816531118316146741947626883420875283/1095776395087604343048258961562579781346072309622648871147302225430528,0,64941223149748020604300647158687141148360676378070321694389079017747/2191552790175208686096517923125159562692144619245297742294604450861056,0,119642794696672444214236928981449466682518823560406254462035711555/99616035917054940277114451051143616486006573602058988286118384130048,0,24285526553850542754895684209918101150191384479132054731373902645/730517596725069562032172641041719854230714873081765914098201483620352,0,12824698552336786773159120040321009911025867175468979984994211/22828674897658423813505395032553745444709839783805184815568796363136,0,9574284502795853207310339510460792142937790215674129528642149/2191552790175208686096517923125159562692144619245297742294604450861056],[-5241015925259822541321179599874180062267634176934243569429060927309/2933749055138975481726346805530334572790222811294263861974554240,0,-914320147210075568032496812184181042694240185816508887453947829617947/34422655580297312318922469184889258987405280985852695980501436416,0,-25183268935547064858886150351139478336011662536626121467148763272590693/154901950111337905435151111332001665443323764436337131912256463872,0,-953772531026517321111666963143113805825418145425211591246237304666553103/1742646938752551436145450002485018736237392349908792734012885218560,0,-4000277934717552741091968889436875937470290034379793454071278526936934931/3485293877505102872290900004970037472474784699817585468025770437120,0,-67515663071941672041215267597279410437397972407899016753150107739601052839/41823526530061234467490800059640449669697416397811025616309245245440,0,-45221056345931422075290454629412461639121663940110560029991245611364761/28259139547338671937493783824081384911957713782304747038046787328,0,-9686251401998972766097112430115761066634528235815252172740226458917754601/8364705306012246893498160011928089933939483279562205123261849049088,0,-354664769979008545246410768932759611379534059911938010741082850300474539/565182790946773438749875676481627698239154275646094940760935746560,0,-80976679168333747812630212454987009956772162063663663462734628083650327/312115869627322645279782089997316788579831465655306161315740636160,0,-1734460824091736801065034855262594208531975010928747570155162694051183029/20911763265030617233745400029820224834848708198905512808154622622720,0,-865394019896370386419891771456725988275710322109844361360948838136435897/41823526530061234467490800059640449669697416397811025616309245245440,0,-330817390814785843836263753096602680204569592410200837217054964326399/81686575254025848569317968866485253261127766401974659406853994620,0,-13026852491738408086481164566961172693348895044398709906644494717056927/20911763265030617233745400029820224834848708198905512808154622622720,0,-261882009887211097442950789662280425057641510502224279145407639853121/3485293877505102872290900004970037472474784699817585468025770437120,0,-295223606052338430711760950176245128518785147566374883914358432232759/41823526530061234467490800059640449669697416397811025616309245245440,0,-10663320896276648917469791234436097903257421085668029519172009756467/20911763265030617233745400029820224834848708198905512808154622622720,0,-1159814713796888830938262877765685875973563604764366829535620282977/41823526530061234467490800059640449669697416397811025616309245245440,0,-11466941017198982270693154348318777678941262511859900913452443807/10455881632515308616872700014910112417424354099452756404077311311360,0,-414504751122719892527301547245121794873633709230406667864582537/13941175510020411489163600019880149889899138799270341872103081748480,0,-860218347711873381811256848893844756479805635000848775557369/1742646938752551436145450002485018736237392349908792734012885218560,0,-158131811185724248740675143765570925141052036408868749160971/41823526530061234467490800059640449669697416397811025616309245245440,0],[0,-438657043745477525247184480953293262240497427428822322772613338657389761/90187357620378958275576869264409858547001836182934063468913763409920,0,-1204103710184398602743299063243444936661154986216983783951384207992591083/18037471524075791655115373852881971709400367236586812693782752681984,0,-10067804212488999804713898149032825989733343380937407082777655474465448387/27056207286113687482673060779322957564100550854880219040674129022976,0,-174210167392036202217674562071766503806154055779399879535487510194347482301/152191165984389492090035966883691636298065598558701232103791975754240,0,-5399851877885959562412939536071869818767958065782285522646022156315835074441/2435058655750231873440575470139066180769049576939219713660671612067840,0,-21316853362254475213148049769403879564688392858766476631593565909603291847951/7305175967250695620321726410417198542307148730817659140982014836203520,0,-108146798892610346390231168945844983063413084797091474806242946442056736193/39487437660814570920657980596849721850308912058473833194497377492992,0,-2769802361674974883310504307563870145645793319604067704020170612951374004355/1461035193450139124064345282083439708461429746163531828196402967240704,0,-48915971057159774011762075341063234167924704520391008452789128564108773753/49359297076018213650822475746062152312886140073092291493121721866240,0,-123263519961189164779497382597118223884455962931292694479615120089120133/309751355463479291906450407497337115939075166673068993426985025280,0,-907558994923599049324211202574901361356981744434400183078305248484753507987/7305175967250695620321726410417198542307148730817659140982014836203520,0,-222066367685428917875181172065473289481214799197720425094302340550107949593/7305175967250695620321726410417198542307148730817659140982014836203520,0,-21389707490510476596909783029911149477883565608238229714110491544824043591/3652587983625347810160863205208599271153574365408829570491007418101760,0,-3247468538297212864643175273662126976309917631534788396723417932734975293/3652587983625347810160863205208599271153574365408829570491007418101760,0,-258336430439006486197372017975753387772614607340882231493626776676789101/2435058655750231873440575470139066180769049576939219713660671612067840,0,-72158009359896051973794547891586417747822081787624772820974219672081921/7305175967250695620321726410417198542307148730817659140982014836203520,0,-5173922459142872229971669721163176894719115369093639389270337805857031/7305175967250695620321726410417198542307148730817659140982014836203520,0,-25420810996783025785549408736380442380444247463979564546778142939943/664106906113699601847429673674290776573377157347059921907455894200320,0,-11001049564644723633209039885069228632478855140928239383716475278467/7305175967250695620321726410417198542307148730817659140982014836203520,0,-98980490328008061334948987867102733591418416886795802194260109773/2435058655750231873440575470139066180769049576939219713660671612067840,0,-1637233816390893941084098094368278846104701887848370279282071833/2435058655750231873440575470139066180769049576939219713660671612067840,0,-37503434173337287591444534705341921184708407863780556095889379/7305175967250695620321726410417198542307148730817659140982014836203520],[-1711481680563731879628674837586099123093731168115144610524690916556725/531817342233192874352296034974407028286988714592240177703668383744,0,-6661575327982721322952172304326478367942524309857306489046676011354475/177272447411064291450765344991469009428996238197413392567889461248,0,-132256444623085165443225506674312905676502293791959818935555637128915083/797726013349789311528444052461610542430483071888360266555502575616,0,-1279621567394294503638307507319781457665367303860751832630503589963222521/3589767060074051901877998236077247440937173823497621199499761590272,0,-5472302499073471507914296714740291283485928781287280723420605641081412161/14359068240296207607511992944308989763748695293990484797999046361088,0,-4390947243198961259184778289312049513228642394783797525484705402586968193/43077204720888622822535978832926969291246085881971454393997139083264,0,11125171330291839540977224092820538867165843448550559372226569584278336235/43077204720888622822535978832926969291246085881971454393997139083264,0,17387393079034586091128586831535283662773886386720154924709399824933185775/43077204720888622822535978832926969291246085881971454393997139083264,0,3410488864319068912708852588901029492195389724098397815200499867190849469/10769301180222155705633994708231742322811521470492863598499284770816,0,6620089292826068947185437163214225112828522875340196463987962671428901/40183959627694610841917890702357247473177318919749491039176435712,0,2658184229487094773933987730114838641636956419025607084466425519630700497/43077204720888622822535978832926969291246085881971454393997139083264,0,744571958781590335009970303675623060310402465356808246666077484985335465/43077204720888622822535978832926969291246085881971454393997139083264,0,79565249855423876466583093685417456908500640960799868638603171884443185/21538602360444311411267989416463484645623042940985727196998569541632,0,13108235688712842009050071330400253153139799124601938592477959544248065/21538602360444311411267989416463484645623042940985727196998569541632,0,1113311606507592319132396940070264762587842121645906255463728490639703/14359068240296207607511992944308989763748695293990484797999046361088,0,327969562509444393885458682416603300719321724133084773186115758528785/43077204720888622822535978832926969291246085881971454393997139083264,0,24569351046205033739816860158080083200837262784776424634800485751269/43077204720888622822535978832926969291246085881971454393997139083264,0,1377121849031691153076470253744055360427657502312335424896510257477/43077204720888622822535978832926969291246085881971454393997139083264,0,55858516083066399335368762640863702909485452676022259603491907089/43077204720888622822535978832926969291246085881971454393997139083264,0,515721599759990045390468235453489973407034808022214448021425793/14359068240296207607511992944308989763748695293990484797999046361088,0,8719963525073894188307453908797249492434389902461162619063151/14359068240296207607511992944308989763748695293990484797999046361088,0,203535151413760222331602703834547131525832238347900937517659/43077204720888622822535978832926969291246085881971454393997139083264,0],[-30185481447576118618786736727321690332801950199966276158958534518906121/98386208313140681755174766470265300233092912199564432875178650992640,0,-698176021562496338759349169559422531397257414275424727698330165731669361/72149886096303166620461495411527886837601468946347250775131010727936,0,-29279132794442407603049274672544444318376350156507694873079739335644093641/324674487433364249792076729351875490769206610258562628488089548275712,0,-2824901494693393518735989532970294361333435909031625046752245334529847958459/7305175967250695620321726410417198542307148730817659140982014836203520,0,-27493051178510376887000143787696044406913609343474477042737952080474517672711/29220703869002782481286905641668794169228594923270636563928059344814080,0,-128369979908514949731324215844567965324898173592297391334843456698265736978431/87662111607008347443860716925006382507685784769811909691784178034442240,0,-742292789955129899392015432768382277514624149790877189726505853119711530491/473849251929774851047895767162196662203706944701685998333968529915904,0,-21134414250057173510624763515134305673495255326549117590808642313645413639331/17532422321401669488772143385001276501537156953962381938356835606888448,0,-407394602800981564955704565152324358062494115852718981456550494223504763633/592311564912218563809869708952745827754633680877107497917460662394880,0,-24301329631428084048680208404575122213478701929635173591320791312902270421/81774357842358533063302907579296998607915844001690214264724046673920,0,-8650094601105454328647241695206305259615659325466092901879881179842247892857/87662111607008347443860716925006382507685784769811909691784178034442240,0,-2229721189711134820342609999024897372657364999454719324047108382186923352233/87662111607008347443860716925006382507685784769811909691784178034442240,0,-224464267586182390389406263720964730120201511385528747889282729915693060041/43831055803504173721930358462503191253842892384905954845892089017221120,0,-35382808128419317988281368062078344534560742722707184023627591323716448273/43831055803504173721930358462503191253842892384905954845892089017221120,0,-2906338245173474646218985476047018442001608110338170105020481008198404911/29220703869002782481286905641668794169228594923270636563928059344814080,0,-834375782213623897614087266189805004640297067032863139001607654941456401/87662111607008347443860716925006382507685784769811909691784178034442240,0,-61255271658309951618963041441364421786519379506949782894686207790019981/87662111607008347443860716925006382507685784769811909691784178034442240,0,-3378707424110542629793736791056628217191178211326747653527975396800293/87662111607008347443860716925006382507685784769811909691784178034442240,0,-135290523853970224119317508715906862438383246241073643195715429220377/87662111607008347443860716925006382507685784769811909691784178034442240,0,-1236089133841189631493540415262683906769574726750521969995878028273/29220703869002782481286905641668794169228594923270636563928059344814080,0,-20721951496261218103010526439887262679958763611252576557847267383/29220703869002782481286905641668794169228594923270636563928059344814080,0,-480273331986319983626096383019812323459972582176736530026979579/87662111607008347443860716925006382507685784769811909691784178034442240,0],[-2631887281293495941388478220250101573124157033437031544409750104095399/819885069276172347959789720585544168609107601663036940626488758272,0,-640779117023976986351423432651745211140397187683190224688867693724000349/13528103643056843741336530389661478782050275427440109520337064511488,0,-11621126048397350898594475509454500223694091368382954846283295813531608259/40584310929170531224009591168984436346150826282320328561011193534464,0,-115721110496186138031084459439575850647608361322962647761547819820545635223/121752932787511593672028773506953309038452478846960985683033580603392,0,-17800438106015807794415761079522185383058245343598990839782624265171722857/9018735762037895827557686926440985854700183618293406346891376340992,0,-1008931065967098226819165344833332508846614023567212919387076848246672141991/365258798362534781016086320520859927115357436540882957049100741810176,0,-53974088347112494803073176300290377054782629327253990194942560695813184397/19743718830407285460328990298424860925154456029236916597248688746496,0,-722704600589971953451863568557078226170658679501517724837564849221467177773/365258798362534781016086320520859927115357436540882957049100741810176,0,-5297322396374202164671011631750274187824922204206366425329434942648802589/4935929707601821365082247574606215231288614007309229149312172186624,0,-1210782226169074543313743530627908224032297915737589307691314031631793291/2725811928078617768776763585976566620263861466723007142157468222464,0,-103834075769454205640087716906092051014310434132935591496308336176823449827/730517596725069562032172641041719854230714873081765914098201483620352,0,-12960890149802707899269791807358467629886262692960779196955615243429389577/365258798362534781016086320520859927115357436540882957049100741810176,0,-2537900651211102676271403602064421183673050949113063136648448395843185717/365258798362534781016086320520859927115357436540882957049100741810176,0,-48808107364557496679652619413813793046100120988350238521899367114587033/45657349795316847627010790065107490889419679567610369631137592726272,0,-31399430043228099356485966744425161969171358294008594262296569777917925/243505865575023187344057547013906618076904957693921971366067161206784,0,-4424106838262425746863921979072798020491031984570559459510546732566203/365258798362534781016086320520859927115357436540882957049100741810176,0,-639036560312393194452522858013632356974195451933672235029548008540635/730517596725069562032172641041719854230714873081765914098201483620352,0,-17370966604689929191722579276184030051097045733207946769986654902203/365258798362534781016086320520859927115357436540882957049100741810176,0,-1373438524918113753654051689301135734908895509416145682381661012311/730517596725069562032172641041719854230714873081765914098201483620352,0,-3101631542661445771282925700633674534194531689055507915897606615/60876466393755796836014386753476654519226239423480492841516790301696,0,-205886522992074033102414927826079425926628578008305913901919531/243505865575023187344057547013906618076904957693921971366067161206784,0,-2364404837507200865501400079549658461936462444841913102316933/365258798362534781016086320520859927115357436540882957049100741810176,0],[0,-1005725777542489466956906054789551021488179387960116263809009025109477317/360749430481515833102307477057639434188007344731736253875655053639680,0,-5195178464069393832710236238648125204694368028362509379723846881383368567/216449658288909499861384486234583660512804406839041752325393032183808,0,-15343261013885851330192550402045457719661989526779370296148301257823625773/324674487433364249792076729351875490769206610258562628488089548275712,0,295797041125994886916044004068506858087150125574411261173856312039631895247/2435058655750231873440575470139066180769049576939219713660671612067840,0,256841951736222805364589470243131230772223437878112906014976730129628248029/360749430481515833102307477057639434188007344731736253875655053639680,0,43642613215159861995604223605767902866097981956670150752974241713621572723503/29220703869002782481286905641668794169228594923270636563928059344814080,0,293519087185047662114846645797465034015339527583730278771962253926139786867/157949750643258283682631922387398887401235648233895332777989509971968,0,9120159980437664324422143580631150568411166035266538923142732614452553668403/5844140773800556496257381128333758833845718984654127312785611868962816,0,185537467827983409063244678540295113872839014649265022770905239736377866689/197437188304072854603289902984248609251544560292369165972486887464960,0,1041411471443604061071404723014590606698791400829713183236453196129234473/2478010843707834335251603259978696927512601333384551947415880202240,0,4170662430181004531585824712408075199444365142591100391856297186340702715521/29220703869002782481286905641668794169228594923270636563928059344814080,0,1091320166759422932488928459051191765807111505832482284322526044607343732729/29220703869002782481286905641668794169228594923270636563928059344814080,0,110976058645431423888385302506869637118095315809162086837723673566858001313/14610351934501391240643452820834397084614297461635318281964029672407040,0,17613066497457123000461766385029366428743235816643414361429222204800318929/14610351934501391240643452820834397084614297461635318281964029672407040,0,1453416146302835429337962472798087541054609308334102671104979437762492423/9740234623000927493762301880556264723076198307756878854642686448271360,0,418551566159998643817444492470923245443383507568938995705163523264068033/29220703869002782481286905641668794169228594923270636563928059344814080,0,30790586803759394722804337689716876205071147328873816878180932572495573/29220703869002782481286905641668794169228594923270636563928059344814080,0,154596669433020182693828319315085215020146889871679976933291449060639/2656427624454798407389718694697163106293508629388239687629823576801280,0,68147853310331151585008244806573273355461200384746977873004995613601/29220703869002782481286905641668794169228594923270636563928059344814080,0,622899456060791024854359247397473665562220199356752343915029559729/9740234623000927493762301880556264723076198307756878854642686448271360,0,10444067865566470535304262456281842743424345301171498072217329599/9740234623000927493762301880556264723076198307756878854642686448271360,0,242057933969066169976291642062348453055476242773154000869817227/29220703869002782481286905641668794169228594923270636563928059344814080],[0,-382671918052731339446480391889275267065713872338568200038811389388470513/36074943048151583310230747705763943418800734473173625387565505363968,0,-15844824983827546852859281260426906609901093219698182878338727115712515491/108224829144454749930692243117291830256402203419520876162696516091904,0,-131993120219205894195013677384983288591316719257310352194166208220849368057/162337243716682124896038364675937745384603305129281314244044774137856,0,-598008297860685963102600817063505771885992830224375930353425276692008897337/243505865575023187344057547013906618076904957693921971366067161206784,0,-1506067067218614077837826242698154711329718834094668797482466910704823655935/324674487433364249792076729351875490769206610258562628488089548275712,0,-17362943411316126853960032164796526696730533025344430112914052775791539325721/2922070386900278248128690564166879416922859492327063656392805934481408,0,-429290845230674913445065946486604972594379226646114501781475431132741585853/78974875321629141841315961193699443700617824116947666388994754985984,0,-10744612257342211587343016186979254402399600461570602247277536408066106930257/2922070386900278248128690564166879416922859492327063656392805934481408,0,-37202215493980634210507494676163673120064103490454684456283096332455732217/19743718830407285460328990298424860925154456029236916597248688746496,0,-368715989033379493609320335689262311801688603266474886390929760852960177/495602168741566867050320651995739385502520266676910389483176040448,0,-669213595963455019622373084775736085312280654934399201293600481905800026155/2922070386900278248128690564166879416922859492327063656392805934481408,0,-161850236882312514770908492013187513559530483834788059835201100470739765599/2922070386900278248128690564166879416922859492327063656392805934481408,0,-15440199581894116549234307631618482945835890964213873288237762921691152851/1461035193450139124064345282083439708461429746163531828196402967240704,0,-2325571655445593115601409626923875224386002096948516458064362384591876079/1461035193450139124064345282083439708461429746163531828196402967240704,0,-183776728428996843491079005248935492033157114345372781574634435334741573/974023462300092749376230188055626472307619830775687885464268644827136,0,-51048194056185681931705767769627826292286461242382014114071295121485407/2922070386900278248128690564166879416922859492327063656392805934481408,0,-3643230483882303648424411392425847241289713446357764673580623697400407/2922070386900278248128690564166879416922859492327063656392805934481408,0,-17829304099282939756569779815001097628348910705931195156671676250969/265642762445479840738971869469716310629350862938823968762982357680128,0,-7689662954287774759504725651093110072512755665754556599240298735027/2922070386900278248128690564166879416922859492327063656392805934481408,0,-68985141189270869405992178076722599738954275071519802915329556887/974023462300092749376230188055626472307619830775687885464268644827136,0,-1138198919287577333940706229554523221818441864356676217783026461/974023462300092749376230188055626472307619830775687885464268644827136,0,-26014788534170170014905173129373428922211386597275283104660477/2922070386900278248128690564166879416922859492327063656392805934481408],[0,-2023748689965072841179403905855196448221354219576713712562573095538294141/360749430481515833102307477057639434188007344731736253875655053639680,0,-17688843054821541758926371952865841706633736243640840566985472579900747199/216449658288909499861384486234583660512804406839041752325393032183808,0,-158983723554197427451658883540700879508076771479487108809762459697282342149/324674487433364249792076729351875490769206610258562628488089548275712,0,-438200037562102566404854368548646868630219361839777444133293974384373731721/270562072861136874826730607793229575641005508548802190406741290229760,0,-32527301663122056010766898299649393786154181965762743861668557944626315174281/9740234623000927493762301880556264723076198307756878854642686448271360,0,-44971801142355717620993876493509889980642375584617231448962337244637386148707/9740234623000927493762301880556264723076198307756878854642686448271360,0,-236861848197358970655091926755791267669018414031393789951242303174302594967/52649916881086094560877307462466295800411882744631777592663169990656,0,-2078700865621876810644626957336068900549850690571505295456993963016005302909/649348974866728499584153458703750981538413220517125256976179096551424,0,-112353386974769616531218367716082048625747610644531858713588534145972928461/65812396101357618201096634328082869750514853430789721990828962488320,0,-191458655587420715609286521111931095927332911654984289708193101613420489/275334538189759370583511473330966325279177925931616883046208911360,0,-711984184504901075252913285156143679188060495699115233582507284102818372143/3246744874333642497920767293518754907692066102585626284880895482757120,0,-175450226391285056570175454665214011292140314692931437863229537033011132727/3246744874333642497920767293518754907692066102585626284880895482757120,0,-50948628246974593558453826829832302240997608151526091249850753634551341517/4870117311500463746881150940278132361538099153878439427321343224135680,0,-7761297331738991263922975014487131681816847590682986211265883140513473981/4870117311500463746881150940278132361538099153878439427321343224135680,0,-1856418308475799440279126052963783705246855688302780006927440444082080721/9740234623000927493762301880556264723076198307756878854642686448271360,0,-173096260913581799065412231246142679856035826599134469842091994128347437/9740234623000927493762301880556264723076198307756878854642686448271360,0,-4140840595958226465399914184095080543268670822807071156942765027434139/3246744874333642497920767293518754907692066102585626284880895482757120,0,-6784942711599099769326423344294804498506975249077675109992187074619/98386208313140681755174766470265300233092912199564432875178650992640,0,-26431161729014584034516491840990989662771304183803229961860731827309/9740234623000927493762301880556264723076198307756878854642686448271360,0,-237807049116121737588171011210936868202002338762739670738760357981/3246744874333642497920767293518754907692066102585626284880895482757120,0,-11798778588984702822527605720497141520091412903653147760039231193/9740234623000927493762301880556264723076198307756878854642686448271360,0,-90066385703845109826679828430858605164063103344459449154971023/9740234623000927493762301880556264723076198307756878854642686448271360],[0,-1034278158467473652372372973796859507621800838589270036043919726967233331/120249810160505277700769159019213144729335781577245417958551684546560,0,-2227988850250752391936087672440511830838843735196196658837482637462878275/24049962032101055540153831803842628945867156315449083591710336909312,0,-40129610173030775849089465415040918672078218275888339361563010113746220763/108224829144454749930692243117291830256402203419520876162696516091904,0,-187815436462348390781712587169736333913709433149648467880206194970680976593/270562072861136874826730607793229575641005508548802190406741290229760,0,-158590028839984413813342452752678613793014084829548277738816889032601929221/295158624939422045265524299410795900699278736598693298625535952977920,0,798851863655181061011443460260208624021183671235529585035015024891180577723/3246744874333642497920767293518754907692066102585626284880895482757120,0,17805914297101999151485486013987037934270235929469975439953511120956074151/17549972293695364853625769154155431933470627581543925864221056663552,0,84453197884013902487721229380784898459514270371749295681928004278127327703/72149886096303166620461495411527886837601468946347250775131010727936,0,18013705411778729563304527363618686281312999991724923039811295433135930269/21937465367119206067032211442694289916838284476929907330276320829440,0,404953488362217500951711863332950301571578612398146921569334152625701721/1009559973362451025472875402213543192690319061749261904502766008320,0,155947817264389494665900310334355788583763350626621189737453998344870132607/1082248291444547499306922431172918302564022034195208761626965160919040,0,3852954399286133128020139894114946840834883416220787918358173381549903213/98386208313140681755174766470265300233092912199564432875178650992640,0,13279100520079538328197632653063588621545079481702362036121927174962431693/1623372437166821248960383646759377453846033051292813142440447741378560,0,2148753431469019468070410245824669410098792347000818174864175884136194069/1623372437166821248960383646759377453846033051292813142440447741378560,0,539667551464816271797860722508453700950043872052880270262087013444378049/3246744874333642497920767293518754907692066102585626284880895482757120,0,52375028713422566164377980928326111198164094499016486265585193916173493/3246744874333642497920767293518754907692066102585626284880895482757120,0,1295247617564529423124181838334636335890114629656580303469197491867851/1082248291444547499306922431172918302564022034195208761626965160919040,0,72013865747983153891068218484027002898914400817951354009739075897683/1082248291444547499306922431172918302564022034195208761626965160919040,0,8703473601277999478230024293607284167584149178564189854315039685181/3246744874333642497920767293518754907692066102585626284880895482757120,0,79892087654037489210441769335862382475942931233150153346062141589/1082248291444547499306922431172918302564022034195208761626965160919040,0,4032503564695997822329429743993205075584704747726890296949091417/3246744874333642497920767293518754907692066102585626284880895482757120,0,31241357885260686229696407060957128906224080283508715590007527/3246744874333642497920767293518754907692066102585626284880895482757120],[46274396253416712133287288049069946816050991684764251261124997554555727/19677241662628136351034953294053060046618582439912886575035730198528,0,725579356664271193720596570405329302960597559952789955074367913715204859/19677241662628136351034953294053060046618582439912886575035730198528,0,6877441573817263801186938936507447553493210749700232870026479512752335889/29515862493942204526552429941079590069927873659869329862553595297792,0,106470307173236379026534296440699013968234865686368474336277356453137271951/132821381222739920369485934734858155314675431469411984381491178840064,0,913204993498970406246383037863255788334858558717427184769269287746824643171/531285524890959681477943738939432621258701725877647937525964715360256,0,3953767711383580427370871723212902165362824719400569245211363325021014082619/1593856574672879044433831216818297863776105177632943812577894146080768,0,109021519811590989448161344532077641256050296183032380213507436725547736355/43077204720888622822535978832926969291246085881971454393997139083264,0,3008704360470812011494841594796030095908547187062104442680354338305471702795/1593856574672879044433831216818297863776105177632943812577894146080768,0,11353337645228315699867681203541452880598930369597564963045119659952328797/10769301180222155705633994708231742322811521470492863598499284770816,0,666952268734369305343592688583713181139184115565637852416402637847356071/1486806506224700601150961955987218156507560800030731168449528121344,0,234740934965596322178269040919697128310123093358753679193363945748393274141/1593856574672879044433831216818297863776105177632943812577894146080768,0,59993594116792242895140779707320571713860209509550662818550023729394117773/1593856574672879044433831216818297863776105177632943812577894146080768,0,5999466203217184033429079489423547488013955528074366444477735988827196397/796928287336439522216915608409148931888052588816471906288947073040384,0,940715856191852076591325876478401195113356306567086422931750745511809045/796928287336439522216915608409148931888052588816471906288947073040384,0,76938658532465571211333448069229053911786793562133656872984548168642507/531285524890959681477943738939432621258701725877647937525964715360256,0,22009751357998417006655555743769625331956210439372170987964828708992757/1593856574672879044433831216818297863776105177632943812577894146080768,0,1611010315513028811058379162895498499653630486232327039765143578206081/1593856574672879044433831216818297863776105177632943812577894146080768,0,88633684472766319537050627636230147065555087240442458218153335371385/1593856574672879044433831216818297863776105177632943812577894146080768,0,3541289244156516230409580681365722518083523892194004502693501665629/1593856574672879044433831216818297863776105177632943812577894146080768,0,32293333811456845947706682317760742618103218816118336181945613077/531285524890959681477943738939432621258701725877647937525964715360256,0,540460775003709913336034125540462004936846991912357207431732755/531285524890959681477943738939432621258701725877647937525964715360256,0,12507688541818254612180565098702162824501747171777338593150439/1593856574672879044433831216818297863776105177632943812577894146080768,0],[0,2398362839671093744465871489234107574080796564713453777476851061651759901/1082248291444547499306922431172918302564022034195208761626965160919040,0,3340402122807460607567513008006358595921708594220936518687065065137209303/72149886096303166620461495411527886837601468946347250775131010727936,0,110561406836623486748690494593673093815175058857925490209359469314316267743/324674487433364249792076729351875490769206610258562628488089548275712,0,845785575214538945144915172603474387682422371552772945295032828198255214799/664106906113699601847429673674290776573377157347059921907455894200320,0,83245117556942757596556186879957170521029638442615672281253952430513528808121/29220703869002782481286905641668794169228594923270636563928059344814080,0,366393481092357597795147849253588056553224861779747394451093746469522587769961/87662111607008347443860716925006382507685784769811909691784178034442240,0,2020785220382435514985395293247853937620101901011956551034287230489128616517/473849251929774851047895767162196662203706944701685998333968529915904,0,55216042972793286218052646822677707667448745945015920236666460421074376405557/17532422321401669488772143385001276501537156953962381938356835606888448,0,1025637233331805402023273794442452421770493521731885362906061760390643179803/592311564912218563809869708952745827754633680877107497917460662394880,0,7394771548965942482002144586329666390228353833304190788298327138328694047/10221794730294816632912863447412124825989480500211276783090505834240,0,1857150871134681602292876761419991916868184273567542812044152348331038967077/7969282873364395222169156084091489318880525888164719062889470730403840,0,5124870372843273139286226385429478941212476851236764092797378464273250011503/87662111607008347443860716925006382507685784769811909691784178034442240,0,503614981286758800060976841284284107469825828387043866867847542136573909111/43831055803504173721930358462503191253842892384905954845892089017221120,0,77708559580555661222749429534841768103460992251221136011048617438945404023/43831055803504173721930358462503191253842892384905954845892089017221120,0,569437437149736699468499422489373492384996076960830019127274455981388531/2656427624454798407389718694697163106293508629388239687629823576801280,0,1768650239746158976698696178506313295098350647860051587165741535328719511/87662111607008347443860716925006382507685784769811909691784178034442240,0,127958262494554701525243210717693796902737129125607185500447046370802851/87662111607008347443860716925006382507685784769811909691784178034442240,0,6967403251578575282358820754487699187173551569560160926737882023829683/87662111607008347443860716925006382507685784769811909691784178034442240,0,275828465825362104742193550208089053585289835028610055230421846744967/87662111607008347443860716925006382507685784769811909691784178034442240,0,2494852772336388295828926029289286380163402031068269711819770428903/29220703869002782481286905641668794169228594923270636563928059344814080,0,41452263619616382116933508922606366214890681943527028161438265513/29220703869002782481286905641668794169228594923270636563928059344814080,0,953156557832503894634790523396489921554093502321545860777374349/87662111607008347443860716925006382507685784769811909691784178034442240],[132109297225330165049092345921577044412215692883260271186712356452377771/32795402771046893918391588823421766744364304066521477625059550330880,0,12822421544631166002743694040715312551582515306063946237894585053418331627/216449658288909499861384486234583660512804406839041752325393032183808,0,117789656145840600615591120987250000529316303622991536607737696127891565233/324674487433364249792076729351875490769206610258562628488089548275712,0,2997442265941890789130989884352902150004255556422565244841715865689137693689/2435058655750231873440575470139066180769049576939219713660671612067840,0,8464190416737771659988712923658369990926866085029019075831631190421584459927/3246744874333642497920767293518754907692066102585626284880895482757120,0,108111945178966174780443424831319237350285922434091179147010989239982074419581/29220703869002782481286905641668794169228594923270636563928059344814080,0,583495910704466369518863057924004070825375424167415891525010184740990059617/157949750643258283682631922387398887401235648233895332777989509971968,0,15707628433991879671032528201489571097936833800261032102520931246196611217513/5844140773800556496257381128333758833845718984654127312785611868962816,0,288683832585723810975396719377474543348520402339883317990885777954113088363/197437188304072854603289902984248609251544560292369165972486887464960,0,16522134997238661488438281686542647270729032341542921454963995046845975451/27258119280786177687767635859765666202638614667230071421574682224640,0,5672471619861932159047057261345666247918083691015109156459560592186547894747/29220703869002782481286905641668794169228594923270636563928059344814080,0,1416789137924887847878648073699607401629870401645526557298570116293341397243/29220703869002782481286905641668794169228594923270636563928059344814080,0,138755534740049725116679461144053662109154116723361555100950675742614944651/14610351934501391240643452820834397084614297461635318281964029672407040,0,21353628818133789878282538367770381221653468050831234264862265999510510963/14610351934501391240643452820834397084614297461635318281964029672407040,0,1717637293537909551324373864483926254061430648736873883611643164415563261/9740234623000927493762301880556264723076198307756878854642686448271360,0,484176900467922147675084009324318346041069791821407610878690376543118131/29220703869002782481286905641668794169228594923270636563928059344814080,0,34981329270741680405815462547666206454830497273393429629587988093643031/29220703869002782481286905641668794169228594923270636563928059344814080,0,1902610793959778238778382604110490805568733587406597963530457427741103/29220703869002782481286905641668794169228594923270636563928059344814080,0,75250804881801347471417632592303915048557282213306733166114708266587/29220703869002782481286905641668794169228594923270636563928059344814080,0,680103149919099515897878687271566387644806283987468614722234526003/9740234623000927493762301880556264723076198307756878854642686448271360,0,11292435567864324676437127253521724051547647229983423990544905813/9740234623000927493762301880556264723076198307756878854642686448271360,0,259510467631946908540407125399043107671632274038484368048674929/29220703869002782481286905641668794169228594923270636563928059344814080,0],[0,24733189861089156393683602662478255599954219099471422395692991954487/16689772402568393851598772938128125569651045326474034414788575232,0,46996769658231325065685564402192294584460426024418682047899154282875313/1652287467854270991308278520874684431395453487320929407064068947968,0,540916421987994373450357069820488343418638616925125717788989852543269899/2478431201781406486962417781312026647093180230981394110596103421952,0,3278198248052176541679024013643765961495997743771564734026304548259252363/3717646802672109730443626671968039970639770346472091165894155132928,0,31612070832190257921038059202117293431687746234273764649177811158025591739/14870587210688438921774506687872159882559081385888364663576620531712,0,148456644675803066018288170724392640520132466589154405708450234477496892443/44611761632065316765323520063616479647677244157665093990729861595136,0,4325396325322614227727347451281536036669876578763220032264491208016922091/1205723287353116669333068109827472422910195788045002540289996259328,0,123833983402122342975073066525092325334802962469899098406076709406062804075/44611761632065316765323520063616479647677244157665093990729861595136,0,478694084382190453034335470466306797641275723795647912379324185251518421/301430821838279167333267027456868105727548947011250635072499064832,0,28563340733243414893423075585841641942828180018848171196373915184359387/41615449283643019370637611999642238477310862087374154842098751488,0,10153567332227530685091476040354705821646193713514313307388857692849269333/44611761632065316765323520063616479647677244157665093990729861595136,0,2611086609779789680300772356122994918128772767080309152423981669787330093/44611761632065316765323520063616479647677244157665093990729861595136,0,262087161737356254887482104302089629102822603443681932422120819751101365/22305880816032658382661760031808239823838622078832546995364930797568,0,41182203671204268619091787233635747462442162959740441920757093331717541/22305880816032658382661760031808239823838622078832546995364930797568,0,1123928751052112816240494557517066651328200373549219350703688629916017/4956862403562812973924835562624053294186360461962788221192206843904,0,964945501964907016816622940642460600053619232941175345329150160346325/44611761632065316765323520063616479647677244157665093990729861595136,0,70627309294682836371520033074974637994528477505408641750246609457977/44611761632065316765323520063616479647677244157665093990729861595136,0,3884584901946513863010617833579992956017455195856961413265239450553/44611761632065316765323520063616479647677244157665093990729861595136,0,155135040371263089633110695276992540174849079030437869973867199093/44611761632065316765323520063616479647677244157665093990729861595136,0,1413923485350351872687552523369434520480737666268280881244093829/14870587210688438921774506687872159882559081385888364663576620531712,0,7883197885485880101669287073853246893549614776981895892741497/4956862403562812973924835562624053294186360461962788221192206843904,0,546988373152276868858642692082499937317795105679698867059623/44611761632065316765323520063616479647677244157665093990729861595136],[-2033801596828110498504595846338726165837923638859752581346446989234789/751039758115577723321944782215765650634297039691331548665485885440,0,-76196071167946836150362110927459943207619098066900048289539972274090943/1652287467854270991308278520874684431395453487320929407064068947968,0,-791822859991416587665727315369798731259431411715611329820536619685285573/2478431201781406486962417781312026647093180230981394110596103421952,0,-66526061144465951515273530332567739079323448616569339637418327126765629491/55764702040081645956654400079520599559596555197081367488412326993920,0,-602940791980818993943769097925524759939387304231180569103840695014527820539/223058808160326583826617600318082398238386220788325469953649307975680,0,-2688681532318174342330569482289322179907946298967709455543861016783952823739/669176424480979751479852800954247194715158662364976409860947923927040,0,-14978090002150098473682444319390974529100138114792744619163255873385752879/3617169862059350007999204329482417268730587364135007620869988777984,0,-412080335054063254753821880628076635629317513296031362672660012890333114159/133835284896195950295970560190849438943031732472995281972189584785408,0,-7688050855386376360907809272250844502616790730946043169228437325754811077/4521462327574187509999005411853021585913234205168759526087485972480,0,-444602741151927113603332080893780051026643702798545877051171586698179669/624231739254645290559564179994633577159662931310612322631481272320,0,-153746293362829660960368168585715403198536222212934518613615980872128649813/669176424480979751479852800954247194715158662364976409860947923927040,0,-38592739180387009613995370022126084881629766878577893365091895176270207117/669176424480979751479852800954247194715158662364976409860947923927040,0,-3792752477871957493415839879651727821463838467637433961950477813527285589/334588212240489875739926400477123597357579331182488204930473961963520,0,-585083871716257498288569091500132729699810359248754948534848701825217957/334588212240489875739926400477123597357579331182488204930473961963520,0,-47140985872508183706484379403319670823768313458360010324672742891809619/223058808160326583826617600318082398238386220788325469953649307975680,0,-13303550024214623045722762774588307165700146806712963497065929665872149/669176424480979751479852800954247194715158662364976409860947923927040,0,-961920075231752740400657384856948731563353611442679012533564204027449/669176424480979751479852800954247194715158662364976409860947923927040,0,-52345788728246173145527823090720461146079995259812883810210503032857/669176424480979751479852800954247194715158662364976409860947923927040,0,-2071070380092499151092399632188656079753125962313189962184259426933/669176424480979751479852800954247194715158662364976409860947923927040,0,-18722175958031870522255666936228821932718557963637950552314705797/223058808160326583826617600318082398238386220788325469953649307975680,0,-310906058395464535583923498206920791786536562566602527007708267/223058808160326583826617600318082398238386220788325469953649307975680,0,-7145459819823507626665463670902366071852176310162734934613831/669176424480979751479852800954247194715158662364976409860947923927040,0],[0,632797531169484132534031550514242617670397619473109409051938494992132259/120249810160505277700769159019213144729335781577245417958551684546560,0,6006575441987626347209684268851326789725076438177125456337248229384845097/72149886096303166620461495411527886837601468946347250775131010727936,0,19881587971932788732361036142427749229765099238829705825971676130669360545/36074943048151583310230747705763943418800734473173625387565505363968,0,1605370533763238000559361609945713839980019959248945548274273734170883418991/811686218583410624480191823379688726923016525646406571220223870689280,0,14054884041641583060030016759992072174215655698116769973990565078499165187319/3246744874333642497920767293518754907692066102585626284880895482757120,0,60836979073762443210016734446881688445628347707682485935716901838732586771359/9740234623000927493762301880556264723076198307756878854642686448271360,0,330410410299797855105202084634869693693304442266185646897936730901587020315/52649916881086094560877307462466295800411882744631777592663169990656,0,8896496112310392788713793107017866596906774506075791285879435182540751435347/1948046924600185498752460376111252944615239661551375770928537289654272,0,162985886597908614808557490992608635635488643872743349085704129278345531597/65812396101357618201096634328082869750514853430789721990828962488320,0,4641155635420459742050848811032344055892343440138525507072799086765191047/4543019880131029614627939309960944367106435777871678570262447037440,0,3168863452656030125047545958879860185199780238852103042183491239126999822953/9740234623000927493762301880556264723076198307756878854642686448271360,0,786888922186343162428242806630323654560716963523336204917465613068146512457/9740234623000927493762301880556264723076198307756878854642686448271360,0,76633004431838698197387127297616752686511987583761020742928245307720411449/4870117311500463746881150940278132361538099153878439427321343224135680,0,11731398032721829439213968604941155580025819271892312650779432838694870417/4870117311500463746881150940278132361538099153878439427321343224135680,0,939096504453707000224650852070274655331965782327754446701221073880165039/3246744874333642497920767293518754907692066102585626284880895482757120,0,263560361113642840352814072127475136205023941784184975266614757262072769/9740234623000927493762301880556264723076198307756878854642686448271360,0,18967104937078586774663168543813416486072962390511627154262708131052989/9740234623000927493762301880556264723076198307756878854642686448271360,0,1027975459710071169261184432970437552647069777737492564359033870817797/9740234623000927493762301880556264723076198307756878854642686448271360,0,3684541798942902615105821442727643061346110417262095534316836235723/885475874818266135796572898232387702097836209796079895876607858933760,0,365275240398941452484741756463237905646174360505401704206822834657/3246744874333642497920767293518754907692066102585626284880895482757120,0,6049870663227606627251021706677238736099945989118447402035467207/3246744874333642497920767293518754907692066102585626284880895482757120,0,138721688003165736888984831147758142956744056340329498179377531/9740234623000927493762301880556264723076198307756878854642686448271360],[24733189861089156393683602662478255599954219099471422395692991954487/16689772402568393851598772938128125569651045326474034414788575232,0,46996769658231325065685564402192294584460426024418682047899154282875313/1652287467854270991308278520874684431395453487320929407064068947968,0,540916421987994373450357069820488343418638616925125717788989852543269899/2478431201781406486962417781312026647093180230981394110596103421952,0,3278198248052176541679024013643765961495997743771564734026304548259252363/3717646802672109730443626671968039970639770346472091165894155132928,0,31612070832190257921038059202117293431687746234273764649177811158025591739/14870587210688438921774506687872159882559081385888364663576620531712,0,148456644675803066018288170724392640520132466589154405708450234477496892443/44611761632065316765323520063616479647677244157665093990729861595136,0,4325396325322614227727347451281536036669876578763220032264491208016922091/1205723287353116669333068109827472422910195788045002540289996259328,0,123833983402122342975073066525092325334802962469899098406076709406062804075/44611761632065316765323520063616479647677244157665093990729861595136,0,478694084382190453034335470466306797641275723795647912379324185251518421/301430821838279167333267027456868105727548947011250635072499064832,0,28563340733243414893423075585841641942828180018848171196373915184359387/41615449283643019370637611999642238477310862087374154842098751488,0,10153567332227530685091476040354705821646193713514313307388857692849269333/44611761632065316765323520063616479647677244157665093990729861595136,0,2611086609779789680300772356122994918128772767080309152423981669787330093/44611761632065316765323520063616479647677244157665093990729861595136,0,262087161737356254887482104302089629102822603443681932422120819751101365/22305880816032658382661760031808239823838622078832546995364930797568,0,41182203671204268619091787233635747462442162959740441920757093331717541/22305880816032658382661760031808239823838622078832546995364930797568,0,1123928751052112816240494557517066651328200373549219350703688629916017/4956862403562812973924835562624053294186360461962788221192206843904,0,964945501964907016816622940642460600053619232941175345329150160346325/44611761632065316765323520063616479647677244157665093990729861595136,0,70627309294682836371520033074974637994528477505408641750246609457977/44611761632065316765323520063616479647677244157665093990729861595136,0,3884584901946513863010617833579992956017455195856961413265239450553/44611761632065316765323520063616479647677244157665093990729861595136,0,155135040371263089633110695276992540174849079030437869973867199093/44611761632065316765323520063616479647677244157665093990729861595136,0,1413923485350351872687552523369434520480737666268280881244093829/14870587210688438921774506687872159882559081385888364663576620531712,0,7883197885485880101669287073853246893549614776981895892741497/4956862403562812973924835562624053294186360461962788221192206843904,0,546988373152276868858642692082499937317795105679698867059623/44611761632065316765323520063616479647677244157665093990729861595136,0],[6267081657231017510912052668287389607673908586383030598630080514129063/10931800923682297972797196274473922248121434688840492541686516776960,0,-29879063779989149844812548071942266276119444229140293469870275525264947/24049962032101055540153831803842628945867156315449083591710336909312,0,-7909557020956877698615331201403616950978922932611129756312394058139775899/108224829144454749930692243117291830256402203419520876162696516091904,0,-379784597345959223883802774902179592358444434658021374882424725533437160363/811686218583410624480191823379688726923016525646406571220223870689280,0,-1525116588447149408446201819311394590075629295839842411771334774150610993149/1082248291444547499306922431172918302564022034195208761626965160919040,0,-24504643165214660375551430494246202314939459375486059291503974707157022954047/9740234623000927493762301880556264723076198307756878854642686448271360,0,-155657398203315688049963193675176550880328115476948813100388315335996908651/52649916881086094560877307462466295800411882744631777592663169990656,0,-4733606070113183568267519043360340712056518966271588411705853429403542628355/1948046924600185498752460376111252944615239661551375770928537289654272,0,-95603667187213002542201478287742957179480512388075969689944281458980605321/65812396101357618201096634328082869750514853430789721990828962488320,0,-5895548671527486424827749998871748817428790725715810224643871274698080847/9086039760262059229255878619921888734212871555743357140524894074880,0,-2149097225428182597377269406094960181315947747442020397229373280328461472809/9740234623000927493762301880556264723076198307756878854642686448271360,0,-563546929332762252334814702809090430480149319009595039107332918464875540201/9740234623000927493762301880556264723076198307756878854642686448271360,0,-57439030093534285322192032144240825332190405834572619422110640817477574297/4870117311500463746881150940278132361538099153878439427321343224135680,0,-9135871637579154194113920323895871729267381271839364739541846808929099121/4870117311500463746881150940278132361538099153878439427321343224135680,0,-755313772821354969296576155935789116370589328846355218166199447637234207/3246744874333642497920767293518754907692066102585626284880895482757120,0,-217861884051278359339533170200992810293960056947732747244048716139447537/9740234623000927493762301880556264723076198307756878854642686448271360,0,-16048066131876023384723724690310992699234611735478520336485131325951037/9740234623000927493762301880556264723076198307756878854642686448271360,0,-887278840968915592437289011864610446013080476765173365246624904651301/9740234623000927493762301880556264723076198307756878854642686448271360,0,-35586636518772092395231893353243298087200936398860564474878465163049/9740234623000927493762301880556264723076198307756878854642686448271360,0,-325491531557736892197801975888806555894024967938323979162505060401/3246744874333642497920767293518754907692066102585626284880895482757120,0,-5460235355126110967349891332339790985386559678257658285764072551/3246744874333642497920767293518754907692066102585626284880895482757120,0,-126597676264661572308833828983102817900901605659628466667531963/9740234623000927493762301880556264723076198307756878854642686448271360,0],[-102710717105011777787241445476808919303418615928037688259981228973356433/32795402771046893918391588823421766744364304066521477625059550330880,0,-10796909393280158077838746230170331282580242952688757976965075042511213777/216449658288909499861384486234583660512804406839041752325393032183808,0,-105965316913432996075767259069968010966185359781840425673952556682577284739/324674487433364249792076729351875490769206610258562628488089548275712,0,-949589118512175396377662111543848629788131939449421195605808224561220076649/811686218583410624480191823379688726923016525646406571220223870689280,0,-25346424732916686415948247205573752581759082450221578009656562473164836513983/9740234623000927493762301880556264723076198307756878854642686448271360,0,-37680336400205664386492375506144354050909205121116794146777217140169446486861/9740234623000927493762301880556264723076198307756878854642686448271360,0,-212578739654190467125652656164289062276877031929678814038313666802632525041/52649916881086094560877307462466295800411882744631777592663169990656,0,-5965830758103962563392242256918376266784130216708482894014451722632642211833/1948046924600185498752460376111252944615239661551375770928537289654272,0,-113918955904140429715535879088313290460199402608083345442497405437969602363/65812396101357618201096634328082869750514853430789721990828962488320,0,-6748438150271684672125616397936897042778650113038134872081781515610099011/9086039760262059229255878619921888734212871555743357140524894074880,0,-2388797985256983393503149979100395363225249518639424953151506965608976624907/9740234623000927493762301880556264723076198307756878854642686448271360,0,-612847586557189176309804718252809320866173564719178169545101584023331461803/9740234623000927493762301880556264723076198307756878854642686448271360,0,-61437931182690616628162757631599190871917858744364086134328194186139450171/4870117311500463746881150940278132361538099153878439427321343224135680,0,-3216125244031608762146975707978805586183054427148255724886171641876544481/1623372437166821248960383646759377453846033051292813142440447741378560,0,-2369480927716369965112947884977461023130471896826949477418830365073836263/9740234623000927493762301880556264723076198307756878854642686448271360,0,-226048202128098273550185737604830393157224640417107588343932036127809891/9740234623000927493762301880556264723076198307756878854642686448271360,0,-16548191688471335742132410420939662026340537756134594340068912476982151/9740234623000927493762301880556264723076198307756878854642686448271360,0,-910389983036784602023551968951817148066461969004873631634785597711903/9740234623000927493762301880556264723076198307756878854642686448271360,0,-12122301573136059104786002846698968981867883643314342990572612482649/3246744874333642497920767293518754907692066102585626284880895482757120,0,-36837678814863961289544896313022160282656236974216022519412131467/360749430481515833102307477057639434188007344731736253875655053639680,0,-16640242085927785407036736287484147667626820248364075763734897519/9740234623000927493762301880556264723076198307756878854642686448271360,0,-42772840490269642668757468388275738605015736593575319005107243/3246744874333642497920767293518754907692066102585626284880895482757120,0],[0,-204145761953106402130569230957933102292813711358524603450743947339124081/29249953822825608089376281923592386555784379302573209773701761105920,0,-68899619323472825504440313461862108042494009501109404746331043752549329/649998973840569068652806264968719701239652873390515772748928024576,0,-5928180059456367320541487322191992682911317101116395641534572147535030019/8774986146847682426812884577077715966735313790771962932110528331776,0,-470760880764223539704589485321296729856326740578770841225174090186945691989/197437188304072854603289902984248609251544560292369165972486887464960,0,-4141213214811039084438484421021078740818526758466294637100601271231875277741/789748753216291418413159611936994437006178241169476663889947549859840,0,-18284301104843139071911086140850384989605882686462760649325933392158499924701/2369246259648874255239478835810983311018534723508429991669842649579520,0,-3780750004043895560667273061142125160673421208261229010024052543527155424733/473849251929774851047895767162196662203706944701685998333968529915904,0,-2842504945473644282120885902345065442825637224507937425065485091570939212393/473849251929774851047895767162196662203706944701685998333968529915904,0,-1992302078301349937082957047676393364159278113501428352212036888474005108071/592311564912218563809869708952745827754633680877107497917460662394880,0,-3167256065052714417728885737958638800113716325805755032825530358328201561/2210117779523203596305483988629648611024752540586222007154703964160,0,-1114241479648247821972858194354310561136137059327777090807173647914909845347/2369246259648874255239478835810983311018534723508429991669842649579520,0,-284344225275878062875898873454776707141431147269162930379120319840345846683/2369246259648874255239478835810983311018534723508429991669842649579520,0,-28376114797716784519458959908616137936252559856341717321509924011861868931/1184623129824437127619739417905491655509267361754214995834921324789760,0,-4438982320611454898108426177685271028378167310009287294770836666392625123/1184623129824437127619739417905491655509267361754214995834921324789760,0,-362176277026576176501804508389978609869337948466064169000288453066168661/789748753216291418413159611936994437006178241169476663889947549859840,0,-103360750962534246531149660725577871926688761681904269434853487084521011/2369246259648874255239478835810983311018534723508429991669842649579520,0,-7548251491528697012874608544384629379039170384018664367706033655519391/2369246259648874255239478835810983311018534723508429991669842649579520,0,-414391865183707564730948159981225333170763537089747072706908776713903/2369246259648874255239478835810983311018534723508429991669842649579520,0,-16523476429238842093791204448138146700303365607361144320696437663907/2369246259648874255239478835810983311018534723508429991669842649579520,0,-150399112949872134243876653077844604449597350104779481285560614883/789748753216291418413159611936994437006178241169476663889947549859840,0,-2512768182116808497829770300936948922628192406850537439361431933/789748753216291418413159611936994437006178241169476663889947549859840,0,-5278239746827582113625813750672064527845533735335391322247859/215386023604443114112679894164634846456230429409857271969985695416320],[0,-1933936406938498018981229222964299340414570945883385484555790321340425777/135281036430568437413365303896614787820502754274401095203370645114880,0,-1398086012559532982937907566716112442349593105822095641941820810465724815/6764051821528421870668265194830739391025137713720054760168532255744,0,-16768915436437203908269617155254036614854880723731845566925682099062898015/13528103643056843741336530389661478782050275427440109520337064511488,0,-7505535549520498914353377998812992272087634350070793592247277545190225706041/1826293991812673905080431602604299635576787182704414785245503709050880,0,-31124231273527361591116788672344729666479385227719960581466127034453733096667/3652587983625347810160863205208599271153574365408829570491007418101760,0,-32561701124598272022119815596554785080328579461134815316728404426199994637803/2739440987719010857620647403906449453365180774056622177868255563576320,0,-693744512058462677529022933664873826268106796770228259109748971675132871029/59231156491221856380986970895274582775463368087710749791746066239488,0,-52538841896222705323371666528726324880376282674267612652920193669663729551/6226002244815933767319653190696476030375410850128686767882399008128,0,-337461193255974912862522953242599854747899507805823725145088855129245318321/74038945614027320476233713619093228469329210109638437239682582799360,0,-76851936218903612514058143154607804027232309366127174802551218222117151873/40887178921179266531651453789648499303957922000845107132362023336960,0,-6571045264765353406898613611079899723107028700576093735253314279123686714279/10957763950876043430482589615625797813460723096226488711473022254305280,0,-409143648203786475374143233394364477502487054311839811573504148167939252409/2739440987719010857620647403906449453365180774056622177868255563576320,0,-159941477202854376534786340566128207102793399757362460677620874947713707517/5478881975438021715241294807812898906730361548113244355736511127152640,0,-1117027824364008060678014116259811252476414006949733606061671882628145433/249040089792637350692786127627859041215016434005147470715295960325120,0,-1974296746155425012090840802811843559954705225469698107967050498298082497/3652587983625347810160863205208599271153574365408829570491007418101760,0,-34749515463845482021032891342761245321392800119933356393084651795106847/684860246929752714405161850976612363341295193514155544467063890894080,0,-40139420769653500356295034069192564749909291486748741263161494868975287/10957763950876043430482589615625797813460723096226488711473022254305280,0,-272727545429335275341141710505332158948209991562072052375824590981497/1369720493859505428810323701953224726682590387028311088934127781788160,0,-86250688539431456034057527118732622751062425902743166409663986068979/10957763950876043430482589615625797813460723096226488711473022254305280,0,-35417878708840835403736651396213496410624011913509229736162689723/166026726528424900461857418418572694143344289336764980476863973550080,0,-1175743735742126506746551956567939126824330314467704702283767241/332053453056849800923714836837145388286688578673529960953727947100160,0,-37140871362188934264774054597732152174200770616930591479112921/1369720493859505428810323701953224726682590387028311088934127781788160],[0,8418735183454660290062486142404957515357125281617675078434071989905342847/1082248291444547499306922431172918302564022034195208761626965160919040,0,28547860562149196591672779809981423442811577184165833024017074838153045119/216449658288909499861384486234583660512804406839041752325393032183808,0,289671300264865604191819597518059094177758437155299696510304130433257900157/324674487433364249792076729351875490769206610258562628488089548275712,0,23587638507218106029741951049656556219653021688799911138267274122279209162623/7305175967250695620321726410417198542307148730817659140982014836203520,0,208218744675437585686015686142393848712285768562702341434867613485591051671827/29220703869002782481286905641668794169228594923270636563928059344814080,0,911025549680403464405910753553953722618331287694290767291340837373863498348507/87662111607008347443860716925006382507685784769811909691784178034442240,0,5011568838438286164474855485206109427467304525441251619740058181827652948279/473849251929774851047895767162196662203706944701685998333968529915904,0,136814920275436443650980714686772643383456238069989205654534810457663055435471/17532422321401669488772143385001276501537156953962381938356835606888448,0,2541592856530104546536252153307126658985951423835267434990597823197896549381/592311564912218563809869708952745827754633680877107497917460662394880,0,13336313956377967933766215900173111128139677520288550835180310927798775247/7434032531123503005754809779936090782537804000153655842247640606720,0,50711148237897212183924591296479891463924261062214020709298063940260462852429/87662111607008347443860716925006382507685784769811909691784178034442240,0,12737107971933811206420634628059478192406778133980429769276042216411724686701/87662111607008347443860716925006382507685784769811909691784178034442240,0,1253244840251936154505544230617359784138147864332524982280715996934515406077/43831055803504173721930358462503191253842892384905954845892089017221120,0,193619160337956228068125022749326417722240588529301050154709652840483384661/43831055803504173721930358462503191253842892384905954845892089017221120,0,15625490007882638152569134944586873339238538849790054588942347610352846587/29220703869002782481286905641668794169228594923270636563928059344814080,0,4416872213492896223862819527027917129378618879061087726106992550176976437/87662111607008347443860716925006382507685784769811909691784178034442240,0,319872326816079908366234058934648678716724186084764077622833010678080177/87662111607008347443860716925006382507685784769811909691784178034442240,0,1584814520118474461542973567124334994956971271798892356584541053114731/7969282873364395222169156084091489318880525888164719062889470730403840,0,690698795289358561506943780266261098799076056711780053410337653572269/87662111607008347443860716925006382507685784769811909691784178034442240,0,6251786163789230971743734609469611277036378404077106967249222189301/29220703869002782481286905641668794169228594923270636563928059344814080,0,103939450096915886121311089093415179764976447947216126728889972611/29220703869002782481286905641668794169228594923270636563928059344814080,0,2391312236546085660188873345755889271761294843505800990951614343/87662111607008347443860716925006382507685784769811909691784178034442240],[33184022674850048294929321280809131118098193192564900265068185939158417/4919310415657034087758738323513265011654645609978221643758932549632,0,5919470352506695721112583754332325289356419952800882100193611587860752773/54112414572227374965346121558645915128201101709760438081348258045952,0,19707756058389936846959073297890697106313470988138884702213296386792712025/27056207286113687482673060779322957564100550854880219040674129022976,0,962451051366354232252541317657602730265133396597013308770167643797853711605/365258798362534781016086320520859927115357436540882957049100741810176,0,8530626328381652628064475225434181977674564719234757960188926162322826461959/1461035193450139124064345282083439708461429746163531828196402967240704,0,37511765007828320276878039754102250274783541357377267002804790527108883326761/4383105580350417372193035846250319125384289238490595484589208901722112,0,1036922763954557018257940242644746788212138063252609913107324996971900191103/118462312982443712761973941790549165550926736175421499583492132478976,0,28441618555960573400561410255623841482371685521111048535874484609994840890789/4383105580350417372193035846250319125384289238490595484589208901722112,0,53067204892559599224808588469335246811228739425682259598517013860199224899/14807789122805464095246742723818645693865842021927687447936516559872,0,24602399908797834838856061980660601926995469471789161113473597068291489063/16354871568471706612660581515859399721583168800338042852944809334784,0,2133865247610412502137539283524970425716887577824777768955349224328809249069/4383105580350417372193035846250319125384289238490595484589208901722112,0,537709382726608188806942593948893200300650752919708008358580425135613627263/4383105580350417372193035846250319125384289238490595484589208901722112,0,53060660549524611890237818154425303932342337187783785642066818291247558489/2191552790175208686096517923125159562692144619245297742294604450861056,0,8218700907783617571285939746964965071975325620196621799596486302671910627/2191552790175208686096517923125159562692144619245297742294604450861056,0,664780092203163088582328205738035903371972991776749321369976150019932463/1461035193450139124064345282083439708461429746163531828196402967240704,0,188292819990148611821337684935972084797715119898987945717561682655952771/4383105580350417372193035846250319125384289238490595484589208901722112,0,13660556520844634744370281258069080095583364416818686118917837067952265/4383105580350417372193035846250319125384289238490595484589208901722112,0,745669006482020749920063033494802910585470728843146536275105379153355/4383105580350417372193035846250319125384289238490595484589208901722112,0,29584781154696627688072258522916137287970018381788808863039564299033/4383105580350417372193035846250319125384289238490595484589208901722112,0,268114121124852208969364628875151507291270736044046288570002001183/1461035193450139124064345282083439708461429746163531828196402967240704,0,4462432621994541191133105823913267826853318080113719396091068847/1461035193450139124064345282083439708461429746163531828196402967240704,0,102766239317681729053725863295317889163199256973240982353633757/4383105580350417372193035846250319125384289238490595484589208901722112,0],[0,-4895636205192576792410941053938765174860128255878124045457506587881567433/541124145722273749653461215586459151282011017097604380813482580459520,0,-17473790165910973401741959595337633923398697662321876152374752058989707085/108224829144454749930692243117291830256402203419520876162696516091904,0,-183304014745292718076334288770895852426646079206413576580526533606817680307/162337243716682124896038364675937745384603305129281314244044774137856,0,-1390397287893492009401207868254882308300815402195865405727757897358335879157/332053453056849800923714836837145388286688578673529960953727947100160,0,-137229489705428887253864892687068918204209351740262268915820866041528844923133/14610351934501391240643452820834397084614297461635318281964029672407040,0,-607003438297561193719769145525118374898794790225537966699915149473963634845233/43831055803504173721930358462503191253842892384905954845892089017221120,0,-3364930313555946160573078257306667406193325736194569134695972494022304748929/236924625964887425523947883581098331101853472350842999166984264957952,0,-92400508966364448280995090650143081823525283093622258194901739416857617283053/8766211160700834744386071692500638250768578476981190969178417803444224,0,-1724650714335930502120815757954293654589567429256735413571971811039684800019/296155782456109281904934854476372913877316840438553748958730331197440,0,-99944122361696495342844993132079539059848418680488851267302854995790576923/40887178921179266531651453789648499303957922000845107132362023336960,0,-3151637837576009000198104955471131627404389973279400005279592332709043205041/3984641436682197611084578042045744659440262944082359531444735365201920,0,-8733783605214945810276887211517707472767161237713802077940124896021282619239/43831055803504173721930358462503191253842892384905954845892089017221120,0,-861612233712252960950710457314064326675789204303700582631037248383538534083/21915527901752086860965179231251595626921446192452977422946044508610560,0,-133422240751451573927529877163403825606774518534082768202598548977741162119/21915527901752086860965179231251595626921446192452977422946044508610560,0,-980848722507399862025349639554860383676241959461092019605259517279946423/1328213812227399203694859347348581553146754314694119843814911788400640,0,-3055269822084532753908727788555134898185548637405590574293155901314417343/43831055803504173721930358462503191253842892384905954845892089017221120,0,-221610885332219911492924418744494817176902559698365655176570947531895623/43831055803504173721930358462503191253842892384905954845892089017221120,0,-12094369016263479258209298554898348628345613881211028828163723110247259/43831055803504173721930358462503191253842892384905954845892089017221120,0,-479763244442634240848121015829939877413903816579816054097079105899851/43831055803504173721930358462503191253842892384905954845892089017221120,0,-4347166760358197954903489782769711278427609285897472863622778322039/14610351934501391240643452820834397084614297461635318281964029672407040,0,-72342290052668610185510390367423676062489224471477452918042442509/14610351934501391240643452820834397084614297461635318281964029672407040,0,-1665752497180728389024620821078600199414296792775892291658363397/43831055803504173721930358462503191253842892384905954845892089017221120],[0,-18439946838507250808975743921781473630632785837190517172087407758369242531/1082248291444547499306922431172918302564022034195208761626965160919040,0,-54240514162701496655360174732211439586110602537071098809272368212120247075/216449658288909499861384486234583660512804406839041752325393032183808,0,-164864222116922546192814566557837675867688699372604004330989823995094442107/108224829144454749930692243117291830256402203419520876162696516091904,0,-37450616403459158517477561934726672211269431124317066727087385198057308150079/7305175967250695620321726410417198542307148730817659140982014836203520,0,-315346425467190684241240636738116459047148984169820258025538247866431462825431/29220703869002782481286905641668794169228594923270636563928059344814080,0,-1338560636348901570721422532116313595548236053357849440757417548214689555431391/87662111607008347443860716925006382507685784769811909691784178034442240,0,-7221957019196992171407199510756154460299337273638317195458934773003909138587/473849251929774851047895767162196662203706944701685998333968529915904,0,-194729320125954104581358934736179490692751965742509325868586239395092212716883/17532422321401669488772143385001276501537156953962381938356835606888448,0,-3589071687413894499138205354892706780701661680246196658344985382478395692613/592311564912218563809869708952745827754633680877107497917460662394880,0,-103067158778363523498588864655531699586391180351457167655673501072311670503/40887178921179266531651453789648499303957922000845107132362023336960,0,-71037939725568324778795205073540665859662605128282198878290782958114995172297/87662111607008347443860716925006382507685784769811909691784178034442240,0,-17809525943787547677417117403603563166570460018325754663280073295822188312713/87662111607008347443860716925006382507685784769811909691784178034442240,0,-1750465491323528310867828897883857149610077500907106893289120828295058418041/43831055803504173721930358462503191253842892384905954845892089017221120,0,-270284691094079747543110121441069110444656618222037102954821991949258388593/43831055803504173721930358462503191253842892384905954845892089017221120,0,-21807316845492041325111075151227953601083063618114116396139931850404505711/29220703869002782481286905641668794169228594923270636563928059344814080,0,-6164064214585145388247909252072664549788674933441993465934578359451401281/87662111607008347443860716925006382507685784769811909691784178034442240,0,-446444248912686205964003960588339632769354805727879182891398494159020061/87662111607008347443860716925006382507685784769811909691784178034442240,0,-24335059578035351907896447312558091358232159358448201180469694826143173/87662111607008347443860716925006382507685784769811909691784178034442240,0,-964359186065066939004321825741806446386598123925311329759865090412857/87662111607008347443860716925006382507685784769811909691784178034442240,0,-8730756064082068216698222693978308301356402773408841923654442104673/29220703869002782481286905641668794169228594923270636563928059344814080,0,-145187270801850951791119680011678633207321976764853002446361484583/29220703869002782481286905641668794169228594923270636563928059344814080,0,-3341056082051312123657764674836140581482107352738671678669031419/87662111607008347443860716925006382507685784769811909691784178034442240],[167588385776501427359961974694153932144398627122548154189822534151344337/19677241662628136351034953294053060046618582439912886575035730198528,0,30280733263290500070062705148531968121574065303539709142813950399082531223/216449658288909499861384486234583660512804406839041752325393032183808,0,34375840784118761724858008544347646846777515711717917680872467662293360773/36074943048151583310230747705763943418800734473173625387565505363968,0,5156178091962255545212108276123084313571109701045331025784896626379491843919/1461035193450139124064345282083439708461429746163531828196402967240704,0,46634216221404049679744400533604717856544848728135148200123338065878267828431/5844140773800556496257381128333758833845718984654127312785611868962816,0,208392310672317847682947957976630032688066087535089833512645498227245615811719/17532422321401669488772143385001276501537156953962381938356835606888448,0,5832552664500399673956334502310051447105918548907349836773656036522633134655/473849251929774851047895767162196662203706944701685998333968529915904,0,161502860497456827646315996967595494798765289175349002493214415187574589413127/17532422321401669488772143385001276501537156953962381938356835606888448,0,607016752998293135329497917176779437156459709253499384147577738701581937525/118462312982443712761973941790549165550926736175421499583492132478976,0,17684564416835112312943040584325454777475840199806542546810266409999956551/8177435784235853306330290757929699860791584400169021426472404667392,0,12321615139308899887632179908903514439597863934247351322426544023377178827057/17532422321401669488772143385001276501537156953962381938356835606888448,0,3114702737418278548922779078645391331127918131739898029071337802197371424289/17532422321401669488772143385001276501537156953962381938356835606888448,0,308100327999079298676848714797966316056851981101007815195826434647595302817/8766211160700834744386071692500638250768578476981190969178417803444224,0,47811835584630262814197095128895464437626155269148138890588021112862616073/8766211160700834744386071692500638250768578476981190969178417803444224,0,3872972411265513978376598126832035851886224922636774784679516520469318055/5844140773800556496257381128333758833845718984654127312785611868962816,0,1098245586233519718112565700544564393623383517726269820765179977310309593/17532422321401669488772143385001276501537156953962381938356835606888448,0,79750037338510154485406809611097601729937625335137884823367864506216293/17532422321401669488772143385001276501537156953962381938356835606888448,0,4356391164520445943120729043529153023098310283128980411227668785424061/17532422321401669488772143385001276501537156953962381938356835606888448,0,172944509765544611910384207877198903993689299179482917120394695875009/17532422321401669488772143385001276501537156953962381938356835606888448,0,1568081169547565830322209934981436553373340252843333552423921506201/5844140773800556496257381128333758833845718984654127312785611868962816,0,26109219336437144432499241915347002406582718929777093535031427103/5844140773800556496257381128333758833845718984654127312785611868962816,0,601473765212176441779917042498641382164796224428622716713528515/17532422321401669488772143385001276501537156953962381938356835606888448,0]],4718592,<1572285141140806698348544063737016047265266598008525098584384319848317711283489786530951656649646191039765801448395440095700973922953130565264787634578086927794176,[<2,70>,<3,23>,<13,1>,<37,2>,<45131,2>,<1103171,1>,<3367669,2>,<5584987471666510633430805839516864384498703488591,2>]>,[[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,4,-5,5,0,0,0,0],[0,2,0,23,30,0,0,0,12,2,0,0,0,0,1,-13,0,-3,15,0,0,0,0,0,-9,-6,-3,-4,0,2,0,6,0,-3,0,0,0,3,-8,-3,0,3,0,0],[0,35,0,-23,34,0,0,0,10,12,0,0,0,0,31,-10,0,-1,23,0,14,0,0,0,-1,-9,-7,2,0,16,0,-2,0,8,0,0,0,-1,1,-2,0,8,-7,0],[27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[106,0,-5,0,0,-22,134,12,0,0,6,-4,3,7,0,0,48,0,0,-28,0,0,-20,3,0,0,0,0,6,0,21,0,-14,0,28,-8,22,0,0,0,-9,0,0,-12],[0,26,0,26,32,0,0,0,-2,-11,0,0,0,0,-15,-10,0,-10,-15,0,-13,0,0,0,-13,5,0,1,0,-2,0,3,0,-8,0,0,0,2,0,3,0,-3,-12,0],[136,0,-51,0,0,16,40,1,0,0,-17,8,3,-15,0,0,-34,0,0,3,0,-2,-7,0,0,0,0,0,0,0,10,0,-3,0,13,-7,10,0,0,0,-5,0,0,-14],[0,-148,0,-22,42,0,0,0,-2,7,0,0,0,0,2,1,0,-10,-8,0,-8,0,0,0,-6,12,3,6,0,4,0,-2,0,-7,0,0,0,-14,6,-8,0,-3,11,0],[0,84,0,-4,-22,0,0,0,-19,-19,0,0,0,0,22,-1,0,16,1,0,11,0,0,0,9,-1,9,-6,0,-2,0,0,0,-2,0,0,0,3,4,-3,0,1,-9,0],[54,0,-14,0,0,-4,-64,6,0,0,-18,-11,16,4,0,0,-26,0,0,-8,0,-7,-2,2,0,0,0,0,-11,0,3,0,2,0,-14,-14,2,0,0,0,-6,0,0,-1],[171,0,24,0,0,7,45,1,0,0,61,-2,12,-36,0,0,-47,0,0,20,0,9,6,15,0,0,0,0,11,0,-13,0,7,0,-15,-8,-8,0,0,0,8,0,0,4],[0,-33,0,10,-19,0,0,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[0,-21,0,-1,22,0,0,0,7,0,0,0,0,0,21,-8,0,-17,-7,0,-9,0,0,0,9,2,-16,5,0,-8,0,12,0,-8,0,0,0,7,-10,0,0,5,9,0],[0,-7,0,19,-2,0,0,0,6,2,0,0,0,0,-9,-10,0,-5,-4,0,5,0,0,0,0,-5,-3,0,0,2,0,7,0,0,0,0,0,6,0,1,0,4,-1,0],[272,0,-68,0,0,23,-30,7,0,0,-32,-23,18,30,0,0,30,0,0,21,0,-2,7,-2,0,0,0,0,0,0,-3,0,-9,0,9,-4,-17,0,0,0,4,0,0,-3],[0,-59,0,-23,-9,0,0,0,-3,1,0,0,0,0,-25,-12,0,15,20,0,1,0,0,0,-10,-5,1,6,0,-8,0,-13,0,0,0,0,0,7,10,7,0,2,-1,0],[-109,0,33,0,0,7,33,0,0,0,-14,13,12,-20,0,0,-53,0,0,28,0,-11,0,-1,0,0,0,0,-11,0,4,0,11,0,-20,-14,-8,0,0,0,6,0,0,-1],[-121,0,-31,0,0,-9,-8,0,0,0,14,-11,-24,19,0,0,-33,0,0,20,0,-8,-2,-7,0,0,0,0,-14,0,9,0,-3,0,0,0,2,0,0,0,-6,0,0,4],[-29,0,-8,0,0,-4,-39,-1,0,0,-18,-2,14,8,0,0,-21,0,0,21,0,-7,0,23,0,0,0,0,-2,0,9,0,10,0,-56,-18,-4,0,0,0,16,0,0,2],[0,0,0,-9,-3,0,0,0,-3,3,0,0,0,0,6,0,0,0,3,0,3,0,0,0,0,-3,0,-3,0,0,0,-3,0,0,0,0,0,0,0,-3,0,-3,0,0],[0,81,0,-52,48,0,0,0,8,23,0,0,0,0,35,19,0,2,-1,0,-10,0,0,0,6,4,7,-6,0,8,0,-14,0,-1,0,0,0,-14,8,0,0,6,1,0],[-71,0,87,0,0,-14,110,0,0,0,10,-36,22,-12,0,0,-40,0,0,-7,0,-1,-8,8,0,0,0,0,-8,0,18,0,7,0,-14,-7,14,0,0,0,-1,0,0,-9],[-149,0,35,0,0,-15,37,0,0,0,-20,9,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3,0,0,0,3,0,0,3],[232,0,-75,0,0,28,-234,-8,0,0,40,0,-11,65,0,0,-12,0,0,4,0,24,4,9,0,0,0,0,10,0,-17,0,-2,0,-2,16,8,0,0,0,5,0,0,6],[167,0,3,0,0,-12,77,1,0,0,-2,-10,-10,-13,0,0,36,0,0,-6,0,15,-3,-2,0,0,0,0,12,0,-13,0,5,0,11,17,5,0,0,0,2,0,0,-2],[120,0,-4,0,0,-2,30,-1,0,0,-17,-7,-26,-3,0,0,-21,0,0,-27,0,-6,-9,2,0,0,0,0,0,0,11,0,-4,0,3,-7,8,0,0,0,-5,0,0,-6],[0,36,0,26,0,0,0,0,-13,0,0,0,0,0,-15,5,0,-3,2,0,-20,0,0,0,-8,-5,3,5,0,-15,0,2,0,-8,0,0,0,0,8,8,0,0,-10,0],[-151,0,145,0,0,-33,117,-3,0,0,-59,6,27,-28,0,0,8,0,0,30,0,-15,-1,7,0,0,0,0,3,0,-7,0,27,0,-31,-25,-2,0,0,0,2,0,0,8],[50,0,-11,0,0,-7,28,-3,0,0,-3,9,7,-2,0,0,-15,0,0,-20,0,0,-1,-2,0,0,0,0,9,0,-5,0,-2,0,30,14,7,0,0,0,-5,0,0,-2],[0,123,0,-28,109,0,0,0,3,-10,0,0,0,0,-14,10,0,18,12,0,11,0,0,0,17,-7,2,-1,0,4,0,6,0,1,0,0,0,7,0,3,0,8,-20,0],[-168,0,-11,0,0,6,-28,-2,0,0,-8,-13,-7,-21,0,0,-6,0,0,11,0,-12,-5,3,0,0,0,0,-9,0,2,0,12,0,-10,-16,-7,0,0,0,1,0,0,12],[0,-36,0,3,15,0,0,0,-3,-3,0,0,0,0,0,3,0,9,3,0,3,0,0,0,0,-3,3,0,0,0,0,-6,0,0,0,0,0,3,0,-3,0,3,-9,0],[-50,0,14,0,0,16,11,1,0,0,-8,27,-11,-21,0,0,5,0,0,21,0,8,24,14,0,0,0,0,12,0,-21,0,1,0,-19,14,-24,0,0,0,22,0,0,16],[-353,0,38,0,0,-2,62,6,0,0,-47,-55,-15,-19,0,0,-47,0,0,75,0,-9,9,-10,0,0,0,0,-22,0,14,0,2,0,14,11,0,0,0,0,8,0,0,2],[68,0,1,0,0,-3,-8,-3,0,0,18,-8,-20,6,0,0,-14,0,0,29,0,7,-1,12,0,0,0,0,-5,0,-1,0,0,0,-8,0,6,0,0,0,1,0,0,0],[-153,0,5,0,0,40,-208,0,0,0,58,-19,28,54,0,0,0,0,0,30,0,16,18,16,0,0,0,0,-2,0,-14,0,-2,0,8,0,0,0,0,0,12,0,0,-2],[0,-54,0,-18,21,0,0,0,16,-4,0,0,0,0,-21,25,0,18,-2,0,-27,0,0,0,-11,1,0,2,0,-4,0,1,0,0,0,0,0,9,-2,0,0,1,1,0],[-92,0,24,0,0,-15,59,7,0,0,-11,-25,-31,23,0,0,-39,0,0,29,0,5,-1,-8,0,0,0,0,-10,0,8,0,-12,0,16,17,2,0,0,0,-6,0,0,-3],[82,0,-34,0,0,-7,57,-1,0,0,-1,-27,-24,-37,0,0,13,0,0,-5,0,3,-12,8,0,0,0,0,-7,0,20,0,-15,0,27,8,10,0,0,0,2,0,0,-8],[0,-5,0,10,-17,0,0,0,-4,0,0,0,0,0,20,-15,0,-8,-20,0,-13,0,0,0,0,4,1,-4,0,6,0,15,0,8,0,0,0,4,-2,0,0,-3,4,0],[0,15,0,0,-6,0,0,0,0,0,0,0,0,0,3,-3,0,0,3,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,-3,0,0],[-284,0,57,0,0,-17,56,-19,0,0,-25,1,-20,-40,0,0,-23,0,0,-29,0,-19,-1,-10,0,0,0,0,-7,0,-6,0,20,0,3,-10,3,0,0,0,-13,0,0,5],[155,0,22,0,0,-17,109,-11,0,0,26,36,16,-18,0,0,-28,0,0,45,0,-7,1,-5,0,0,0,0,0,0,-6,0,17,0,24,-9,-5,0,0,0,-12,0,0,-2],[0,-26,0,19,-10,0,0,0,-5,-4,0,0,0,0,-7,-2,0,-9,-11,0,6,0,0,0,0,2,0,-2,0,-5,0,4,0,-5,0,0,0,2,0,-1,0,-5,3,0],[-229,0,-42,0,0,14,83,-11,0,0,-5,12,-37,-40,0,0,-18,0,0,5,0,19,2,-11,0,0,0,0,29,0,-13,0,-12,0,27,18,-2,0,0,0,1,0,0,8],[0,-58,0,31,-59,0,0,0,-30,-28,0,0,0,0,-22,-11,0,-10,2,0,9,0,0,0,2,-8,5,6,0,-6,0,3,0,-6,0,0,0,-2,-4,-8,0,-5,-6,0],[0,-7,0,8,-37,0,0,0,8,2,0,0,0,0,-14,-4,0,-5,8,0,-18,0,0,0,-2,-4,5,-2,0,3,0,-2,0,0,0,0,0,-4,2,1,0,3,0,0],[-71,0,35,0,0,10,26,-5,0,0,45,7,-15,-4,0,0,-5,0,0,15,0,9,22,9,0,0,0,0,1,0,-23,0,-3,0,3,8,0,0,0,0,-7,0,0,4],[-145,0,-40,0,0,25,-245,3,0,0,-1,26,1,29,0,0,0,0,0,-12,0,-8,4,19,0,0,0,0,19,0,2,0,14,0,-21,-23,-15,0,0,0,-3,0,0,0],[18,0,-15,0,0,12,-27,-3,0,0,9,6,-12,3,0,0,3,0,0,-12,0,3,9,-3,0,0,0,0,3,0,-15,0,0,0,-3,6,-3,0,0,0,-3,0,0,3],[-88,0,-36,0,0,-7,36,2,0,0,3,-14,18,-12,0,0,-18,0,0,12,0,-3,-4,2,0,0,0,0,-1,0,25,0,4,0,-12,-8,-16,0,0,0,11,0,0,6],[70,0,-58,0,0,26,-365,1,0,0,69,-35,-28,112,0,0,45,0,0,-22,0,15,6,-6,0,0,0,0,-2,0,-17,0,-26,0,33,21,11,0,0,0,-3,0,0,1],[43,0,-6,0,0,-10,-20,-4,0,0,-6,-15,-5,-5,0,0,11,0,0,15,0,-12,1,-1,0,0,0,0,-12,0,3,0,4,0,-4,0,-12,0,0,0,0,0,0,7],[187,0,-2,0,0,-10,57,3,0,0,27,-23,23,-37,0,0,30,0,0,9,0,3,12,0,0,0,0,0,-5,0,-12,0,0,0,-17,4,-6,0,0,0,5,0,0,10],[83,0,13,0,0,12,-18,5,0,0,-29,-23,31,-16,0,0,-29,0,0,-28,0,3,-4,5,0,0,0,0,6,0,12,0,26,0,5,-18,21,0,0,0,4,0,0,-14],[0,-45,0,13,38,0,0,0,-6,-7,0,0,0,0,-20,11,0,15,7,0,6,0,0,0,3,-4,3,-2,0,-5,0,-1,0,1,0,0,0,-4,-3,-4,0,-2,2,0],[0,32,0,43,-60,0,0,0,2,-16,0,0,0,0,-12,2,0,-21,-14,0,4,0,0,0,10,6,-11,-3,0,0,0,20,0,0,0,0,0,13,-10,19,0,1,6,0],[0,150,0,-35,-80,0,0,0,5,13,0,0,0,0,6,6,0,-34,-8,0,-25,0,0,0,0,-2,-4,8,0,-4,0,-3,0,-8,0,0,0,-10,-3,-3,0,8,10,0],[0,30,0,0,18,0,0,0,3,-3,0,0,0,0,6,-3,0,3,3,0,3,0,0,0,3,3,-3,-6,0,0,0,6,0,6,0,0,0,9,0,3,0,-3,3,0],[0,-178,0,41,130,0,0,0,-15,13,0,0,0,0,0,34,0,-23,3,0,-9,0,0,0,-4,-11,9,6,0,-3,0,-7,0,-6,0,0,0,-9,4,-12,0,-4,0,0],[0,57,0,3,61,0,0,0,-20,-12,0,0,0,0,16,-16,0,3,6,0,14,0,0,0,7,-4,-4,-8,0,-12,0,0,0,8,0,0,0,8,-7,2,0,-4,-12,0],[0,-4,0,-10,-3,0,0,0,5,5,0,0,0,0,-16,-6,0,5,-1,0,1,0,0,0,1,3,2,-3,0,-2,0,-5,0,1,0,0,0,-1,2,12,0,1,0,0],[0,104,0,17,50,0,0,0,-13,-2,0,0,0,0,-5,-13,0,-18,-8,0,-9,0,0,0,8,-7,4,4,0,3,0,-12,0,-6,0,0,0,-13,-8,-3,0,1,12,0],[-224,0,10,0,0,15,91,-3,0,0,52,41,4,-53,0,0,15,0,0,-6,0,-1,2,-5,0,0,0,0,7,0,-14,0,13,0,28,-7,-3,0,0,0,-8,0,0,-9],[27,0,25,0,0,-16,5,11,0,0,-17,-18,-1,9,0,0,-37,0,0,-13,0,-19,1,-1,0,0,0,0,-9,0,6,0,9,0,-9,-17,-11,0,0,0,11,0,0,-3],[0,-54,0,45,0,0,0,0,5,5,0,0,0,0,14,-15,0,-28,15,0,-11,0,0,0,-9,5,1,-1,0,17,0,-12,0,6,0,0,0,3,-2,-1,0,0,5,0],[-106,0,64,0,0,7,10,10,0,0,-14,-22,-7,-31,0,0,5,0,0,-6,0,15,4,-5,0,0,0,0,12,0,-13,0,-3,0,11,-11,-16,0,0,0,1,0,0,5],[0,-24,0,0,15,0,0,0,-6,0,0,0,0,0,0,6,0,-3,-3,0,3,0,0,0,0,-3,0,3,0,-3,0,-3,0,-3,0,0,0,-3,0,-6,0,0,-3,0],[0,-125,0,-8,-109,0,0,0,10,14,0,0,0,0,23,20,0,6,23,0,8,0,0,0,3,-10,8,-8,0,5,0,-23,0,5,0,0,0,-7,8,0,0,1,-2,0],[-278,0,58,0,0,-2,-278,-6,0,0,-34,10,22,75,0,0,-11,0,0,-55,0,10,-3,-4,0,0,0,0,-8,0,0,0,-11,0,19,17,4,0,0,0,-3,0,0,-7],[-6,0,30,0,0,-3,28,4,0,0,4,-16,3,-6,0,0,26,0,0,17,0,-1,-14,-4,0,0,0,0,-6,0,-1,0,2,0,3,0,1,0,0,0,0,0,0,0],[0,-138,0,28,-66,0,0,0,1,-3,0,0,0,0,-6,-19,0,17,2,0,0,0,0,0,-10,5,1,-9,0,3,0,16,0,6,0,0,0,12,-4,4,0,-4,-8,0],[0,3,0,-25,22,0,0,0,10,3,0,0,0,0,-15,-12,0,-24,1,0,-17,0,0,0,-3,15,-2,3,0,8,0,7,0,0,0,0,0,-2,-10,-3,0,-1,6,0],[-40,0,50,0,0,-6,2,2,0,0,16,-3,-12,-11,0,0,-61,0,0,-22,0,0,-1,-1,0,0,0,0,-15,0,11,0,12,0,-31,-17,0,0,0,0,-4,0,0,0],[0,62,0,-22,-62,0,0,0,-15,-16,0,0,0,0,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,43,-43,0,0,0,22,-10,0,0,0,0,37,-14,0,32,9,0,5,0,0,0,-8,20,6,-10,0,9,0,10,0,4,0,0,0,10,8,8,0,-1,-2,0],[-83,0,-38,0,0,-44,140,19,0,0,-47,-37,-8,-1,0,0,-14,0,0,-60,0,-16,-5,-7,0,0,0,0,-26,0,24,0,-14,0,-26,4,9,0,0,0,-2,0,0,-6],[15,0,-2,0,0,-10,63,3,0,0,11,16,46,-6,0,0,-8,0,0,1,0,-4,-11,12,0,0,0,0,1,0,6,0,2,0,-9,-11,12,0,0,0,6,0,0,-4],[-298,0,11,0,0,-18,-96,7,0,0,-39,-6,-23,-7,0,0,71,0,0,46,0,-17,-4,-6,0,0,0,0,-1,0,10,0,17,0,-17,0,-16,0,0,0,15,0,0,2],[0,-125,0,-13,128,0,0,0,-11,-3,0,0,0,0,-22,21,0,-6,1,0,1,0,0,0,11,7,-5,-2,0,-6,0,2,0,-6,0,0,0,-5,2,1,0,-1,9,0],[0,-43,0,22,30,0,0,0,3,2,0,0,0,0,17,-1,0,17,15,0,-2,0,0,0,-3,-1,-3,2,0,-6,0,-1,0,0,0,0,0,1,3,3,0,1,-4,0],[-50,0,21,0,0,1,154,3,0,0,-20,28,-18,-35,0,0,-79,0,0,36,0,-20,-4,-8,0,0,0,0,4,0,7,0,25,0,-7,-22,-24,0,0,0,1,0,0,-2],[89,0,-21,0,0,43,142,-22,0,0,-9,-8,-4,-89,0,0,65,0,0,31,0,19,12,5,0,0,0,0,37,0,-17,0,-26,0,1,3,-16,0,0,0,-8,0,0,-17],[-57,0,6,0,0,3,42,-3,0,0,0,0,-3,-24,0,0,-6,0,0,18,0,0,9,0,0,0,0,0,0,0,3,0,3,0,-9,0,-9,0,0,0,3,0,0,3],[0,22,0,-41,-41,0,0,0,15,10,0,0,0,0,-11,23,0,-15,19,0,-23,0,0,0,-9,-1,10,-8,0,10,0,4,0,6,0,0,0,-8,-2,-6,0,-5,15,0],[0,107,0,3,-38,0,0,0,19,6,0,0,0,0,5,-19,0,-15,-2,0,0,0,0,0,6,-6,-9,9,0,-2,0,13,0,-4,0,0,0,3,-6,-6,0,4,-1,0],[-32,0,-24,0,0,-9,35,-3,0,0,2,-12,9,13,0,0,24,0,0,3,0,-3,3,-1,0,0,0,0,6,0,3,0,-3,0,-8,0,-12,0,0,0,12,0,0,6],[0,-24,0,-15,-164,0,0,0,12,1,0,0,0,0,18,-21,0,10,4,0,-4,0,0,0,-18,-7,1,-1,0,9,0,1,0,13,0,0,0,7,1,9,0,5,2,0],[0,106,0,-8,-34,0,0,0,-16,-2,0,0,0,0,25,11,0,-21,-15,0,0,0,0,0,-2,4,-2,2,0,-10,0,-9,0,-4,0,0,0,2,5,-2,0,-11,10,0],[0,125,0,-35,50,0,0,0,0,5,0,0,0,0,-30,-1,0,-9,-8,0,-3,0,0,0,9,3,-6,1,0,-5,0,1,0,1,0,0,0,5,-3,5,0,1,1,0],[30,0,-4,0,0,23,27,0,0,0,-16,12,-9,-25,0,0,-38,0,0,12,0,-10,6,-11,0,0,0,0,32,0,-17,0,-6,0,-8,-4,-16,0,0,0,-7,0,0,0],[0,142,0,-2,-39,0,0,0,9,-6,0,0,0,0,-13,-22,0,13,1,0,-14,0,0,0,-2,1,-2,-5,0,2,0,12,0,0,0,0,0,4,-5,16,0,1,18,0],[18,0,9,0,0,-3,-15,6,0,0,0,3,9,9,0,0,6,0,0,-12,0,3,-6,0,0,0,0,0,3,0,3,0,3,0,3,-3,3,0,0,0,0,0,0,-6],[0,192,0,-47,-86,0,0,0,2,2,0,0,0,0,-13,4,0,-19,-18,0,-2,0,0,0,8,6,-1,5,0,-10,0,10,0,-6,0,0,0,1,-8,-3,0,-1,2,0],[-240,0,80,0,0,-27,-119,8,0,0,-1,-33,-16,20,0,0,31,0,0,-48,0,-11,1,-10,0,0,0,0,-10,0,14,0,4,0,1,8,10,0,0,0,9,0,0,5],[0,75,0,-4,-23,0,0,0,12,-2,0,0,0,0,23,-11,0,8,0,0,-6,0,0,0,-3,1,0,-3,0,1,0,-2,0,0,0,0,0,8,0,5,0,3,-5,0],[0,-53,0,6,59,0,0,0,-3,-2,0,0,0,0,-3,-9,0,-3,8,0,-4,0,0,0,1,-4,6,-7,0,-5,0,1,0,8,0,0,0,5,13,19,0,-4,2,0],[0,-64,0,9,138,0,0,0,24,14,0,0,0,0,-36,24,0,-34,-6,0,-11,0,0,0,-4,-1,-6,2,0,2,0,18,0,2,0,0,0,-3,5,-4,0,0,7,0],[-26,0,-43,0,0,-7,61,-14,0,0,21,5,-17,-17,0,0,-33,0,0,2,0,7,-5,0,0,0,0,0,8,0,-9,0,0,0,23,17,19,0,0,0,-3,0,0,-3],[0,240,0,-63,-35,0,0,0,2,18,0,0,0,0,-8,-8,0,8,-23,0,-16,0,0,0,0,1,1,-6,0,8,0,-2,0,1,0,0,0,-6,11,5,0,-5,10,0],[55,-32,7,-17,-37,-11,-23,-4,5,-9,13,-4,10,34,-19,-1,-34,-17,-1,-7,-2,-8,3,10,1,13,-4,-2,9,4,-7,12,7,8,-3,-14,-15,7,-1,1,4,1,-1,0],[21,0,-6,0,0,-3,-3,0,0,0,0,3,0,3,0,0,-3,0,0,-6,0,-3,-3,-3,0,0,0,0,0,0,0,0,0,0,9,0,3,0,0,0,0,0,0,-3],[0,-128,0,-43,10,0,0,0,2,10,0,0,0,0,-15,21,0,6,4,0,0,0,0,0,1,-8,-9,0,0,8,0,-19,0,4,0,0,0,3,4,-2,0,-3,-5,0],[62,0,-85,0,0,-8,36,21,0,0,-17,24,-22,79,0,0,63,0,0,32,0,2,-25,-14,0,0,0,0,11,0,12,0,-11,0,25,-3,10,0,0,0,-18,0,0,-15],[53,0,-3,0,0,-13,31,1,0,0,-13,-2,1,22,0,0,18,0,0,4,0,-8,0,-12,0,0,0,0,-9,0,-5,0,-4,0,8,0,15,0,0,0,-9,0,0,-8],[-200,0,57,0,0,0,103,-10,0,0,-19,4,58,-30,0,0,24,0,0,-32,0,-9,-10,2,0,0,0,0,3,0,3,0,14,0,-10,-24,14,0,0,0,-5,0,0,-2],[0,9,0,-24,-78,0,0,0,11,4,0,0,0,0,-13,12,0,-10,3,0,10,0,0,0,3,-5,-2,-7,0,12,0,8,0,4,0,0,0,6,-5,-6,0,3,-12,0],[-165,0,37,0,0,0,-53,-12,0,0,9,9,-7,22,0,0,26,0,0,-19,0,8,-1,-5,0,0,0,0,13,0,-15,0,-11,0,49,20,2,0,0,0,-10,0,0,-4],[0,-100,0,-37,-108,0,0,0,-8,0,0,0,0,0,-11,25,0,8,20,0,-9,0,0,0,-25,-6,5,4,0,-6,0,-7,0,-6,0,0,0,-11,8,0,0,-1,-3,0],[257,0,-60,0,0,-23,-196,10,0,0,-49,-8,-21,49,0,0,-62,0,0,-24,0,-14,-8,5,0,0,0,0,-7,0,7,0,17,0,9,-6,-12,0,0,0,-19,0,0,0],[0,-18,0,0,3,0,0,0,-3,-3,0,0,0,0,-3,3,0,-12,-6,0,3,0,0,0,3,0,0,-3,0,3,0,0,0,3,0,0,0,3,-3,-6,0,-3,-3,0],[-229,0,62,0,0,-43,-12,7,0,0,-17,31,43,-26,0,0,145,0,0,23,0,-13,-11,-6,0,0,0,0,15,0,20,0,4,0,3,6,-15,0,0,0,16,0,0,11],[35,0,-8,0,0,5,41,-8,0,0,-18,-3,-7,40,0,0,35,0,0,-17,0,3,9,9,0,0,0,0,5,0,26,0,-17,0,-1,8,-9,0,0,0,11,0,0,-4],[82,0,35,0,0,-6,-42,1,0,0,2,-14,20,8,0,0,-44,0,0,3,0,-2,8,3,0,0,0,0,-10,0,-18,0,2,0,-11,0,-1,0,0,0,8,0,0,9],[0,164,0,27,-56,0,0,0,-4,-12,0,0,0,0,43,2,0,-11,36,0,21,0,0,0,11,5,1,-6,0,-1,0,6,0,-5,0,0,0,9,-11,6,0,-5,-5,0],[-140,0,32,0,0,8,-49,6,0,0,36,26,27,-20,0,0,-62,0,0,-28,0,-4,-4,-4,0,0,0,0,-6,0,8,0,1,0,-9,-13,0,0,0,0,3,0,0,-6],[76,0,-27,0,0,-2,1,12,0,0,2,-9,-16,20,0,0,19,0,0,-5,0,11,-1,-7,0,0,0,0,-4,0,11,0,2,0,-10,-5,17,0,0,0,-5,0,0,-2],[0,37,0,-43,155,0,0,0,10,-17,0,0,0,0,-29,13,0,-31,3,0,-9,0,0,0,7,8,-14,3,0,-13,0,9,0,0,0,0,0,4,-8,17,0,3,9,0],[0,-130,0,-24,-69,0,0,0,-11,7,0,0,0,0,40,14,0,14,13,0,4,0,0,0,1,-5,12,-6,0,-2,0,-9,0,0,0,0,0,-3,-3,-15,0,-10,3,0],[0,-27,0,15,-27,0,0,0,9,0,0,0,0,0,15,-9,0,6,9,0,3,0,0,0,-3,3,3,-3,0,6,0,-3,0,6,0,0,0,6,3,0,0,0,-6,0],[-57,0,38,0,0,-3,127,8,0,0,10,-5,-48,-14,0,0,-44,0,0,-15,0,20,-14,-4,0,0,0,0,4,0,-8,0,-6,0,8,10,12,0,0,0,0,0,0,0],[-53,0,-23,0,0,-16,-34,14,0,0,24,10,1,-19,0,0,-49,0,0,5,0,0,-1,-17,0,0,0,0,-24,0,4,0,-3,0,-37,3,1,0,0,0,-10,0,0,6],[0,-25,0,11,-5,0,0,0,-3,0,0,0,0,0,19,-5,0,3,-9,0,-4,0,0,0,-1,8,1,2,0,2,0,4,0,0,0,0,0,-5,-2,-6,0,1,7,0],[0,-199,0,79,159,0,0,0,-24,-24,0,0,0,0,2,24,0,-12,-1,0,-2,0,0,0,-1,5,8,-3,0,-6,0,14,0,7,0,0,0,8,-11,-13,0,-11,3,0],[0,-75,0,14,-64,0,0,0,-19,-14,0,0,0,0,17,17,0,11,6,0,12,0,0,0,8,-8,11,5,0,-12,0,-13,0,-4,0,0,0,7,5,4,0,-6,-11,0],[21,0,18,0,0,-20,20,-12,0,0,1,10,43,-14,0,0,-12,0,0,16,0,4,-1,-7,0,0,0,0,2,0,4,0,13,0,3,-4,19,0,0,0,3,0,0,-1],[0,113,0,12,47,0,0,0,0,0,0,0,0,0,-5,-14,0,-23,-6,0,13,0,0,0,10,-5,-2,-9,0,0,0,-12,0,-1,0,0,0,7,1,-4,0,-5,-18,0],[218,0,-72,0,0,24,68,-3,0,0,73,-49,15,75,0,0,-12,0,0,64,0,36,21,-1,0,0,0,0,2,0,-18,0,-12,0,-6,32,17,0,0,0,30,0,0,14],[-9,0,-3,0,0,0,21,0,0,0,-3,-6,-6,0,0,0,-3,0,0,3,0,0,0,0,0,0,0,0,0,0,6,0,0,0,3,0,3,0,0,0,0,0,0,-3],[0,-206,0,7,-104,0,0,0,-16,4,0,0,0,0,15,10,0,31,-2,0,26,0,0,0,-2,-8,1,-5,0,-8,0,-18,0,-4,0,0,0,-1,14,5,0,1,-14,0],[0,105,0,4,35,0,0,0,16,17,0,0,0,0,10,-17,0,16,8,0,-25,0,0,0,-2,13,-16,-1,0,-10,0,6,0,2,0,0,0,10,3,15,0,0,14,0],[0,1,0,-8,31,0,0,0,6,2,0,0,0,0,18,7,0,3,1,0,6,0,0,0,0,-4,6,1,0,4,0,-4,0,0,0,0,0,-1,0,-1,0,1,-5,0],[0,-141,0,-21,-31,0,0,0,20,-3,0,0,0,0,-2,2,0,-10,-23,0,-1,0,0,0,8,4,4,-2,0,3,0,0,0,0,0,0,0,0,4,6,0,9,-4,0],[181,0,-17,0,0,-19,203,4,0,0,-52,-68,-18,-41,0,0,-39,0,0,44,0,5,-6,6,0,0,0,0,-12,0,18,0,-25,0,17,24,4,0,0,0,18,0,0,8],[64,0,-46,0,0,10,-20,2,0,0,-2,-5,-24,3,0,0,3,0,0,-12,0,10,-1,-3,0,0,0,0,13,0,12,0,-16,0,-8,14,-6,0,0,0,-4,0,0,-1],[392,0,-85,0,0,21,15,1,0,0,-21,24,16,-56,0,0,15,0,0,22,0,1,-2,-13,0,0,0,0,-7,0,5,0,-3,0,-25,0,8,0,0,0,-10,0,0,0],[70,0,-28,0,0,-2,131,-15,0,0,8,14,1,-25,0,0,-51,0,0,20,0,11,9,37,0,0,0,0,6,0,-3,0,7,0,-39,-1,-6,0,0,0,17,0,0,-1],[0,-9,0,6,-42,0,0,0,-3,3,0,0,0,0,12,-9,0,6,6,0,0,0,0,0,-3,0,3,-6,0,6,0,3,0,6,0,0,0,0,3,0,0,-3,0,0],[-15,0,18,0,0,3,29,4,0,0,-11,6,45,-5,0,0,-13,0,0,-76,0,1,6,1,0,0,0,0,-3,0,-18,0,11,0,-4,-2,24,0,0,0,-14,0,0,-8],[324,0,-45,0,0,-18,94,26,0,0,2,-49,27,-15,0,0,-18,0,0,46,0,-15,-9,-2,0,0,0,0,-17,0,25,0,2,0,-25,-3,-13,0,0,0,22,0,0,2],[0,30,0,15,28,0,0,0,23,9,0,0,0,0,-19,-12,0,-18,-1,0,-10,0,0,0,-3,7,-6,3,0,3,0,-5,0,-1,0,0,0,5,0,15,0,7,9,0],[-136,0,5,0,0,-25,-90,-12,0,0,-33,36,39,-23,0,0,-54,0,0,-43,0,-19,-20,-9,0,0,0,0,-17,0,16,0,2,0,10,-18,-12,0,0,0,-12,0,0,-8],[0,3,0,-4,53,0,0,0,-32,-5,0,0,0,0,30,-8,0,13,17,0,36,0,0,0,5,-9,5,5,0,-8,0,3,0,-8,0,0,0,-4,-5,-5,0,-7,-14,0],[-34,0,64,0,0,-15,42,9,0,0,-25,25,23,-26,0,0,18,0,0,-31,0,-20,1,-2,0,0,0,0,-7,0,-7,0,20,0,-19,-20,-9,0,0,0,1,0,0,3],[-36,0,-85,0,0,15,-48,-8,0,0,3,24,-11,-26,0,0,-36,0,0,-8,0,25,16,20,0,0,0,0,29,0,-13,0,-4,0,18,6,16,0,0,0,-2,0,0,-6],[193,0,-26,0,0,38,22,-24,0,0,22,11,-9,-75,0,0,38,0,0,-66,0,1,17,1,0,0,0,0,9,0,4,0,3,0,18,-1,-21,0,0,0,-20,0,0,-9],[15,0,-9,0,0,6,-27,3,0,0,6,-3,0,6,0,0,3,0,0,0,0,0,0,3,0,0,0,0,3,0,-3,0,0,0,-9,-6,0,0,0,0,6,0,0,-3],[0,46,0,21,-132,0,0,0,-30,-17,0,0,0,0,-30,-5,0,-28,-32,0,14,0,0,0,3,-6,-5,-4,0,-4,0,-9,0,0,0,0,0,-5,-14,-8,0,-9,-3,0],[-82,0,-32,0,0,4,-66,13,0,0,-32,4,11,68,0,0,17,0,0,-31,0,-1,-2,-11,0,0,0,0,-6,0,-4,0,12,0,-20,5,7,0,0,0,0,0,0,4],[99,0,-67,0,0,1,63,0,0,0,4,-18,6,-34,0,0,50,0,0,62,0,-6,0,-4,0,0,0,0,7,0,23,0,-2,0,-1,-1,9,0,0,0,2,0,0,-1],[0,11,0,-37,-4,0,0,0,19,-4,0,0,0,0,-19,-15,0,-24,13,0,-1,0,0,0,2,19,4,6,0,3,0,8,0,-6,0,0,0,5,-14,1,0,-2,10,0],[0,161,0,-31,-100,0,0,0,19,15,0,0,0,0,-6,-19,0,-26,-6,0,2,0,0,0,-3,6,-13,-4,0,14,0,16,0,4,0,0,0,12,3,1,0,5,4,0],[-44,0,8,0,0,-13,-47,8,0,0,-12,-25,7,3,0,0,30,0,0,-11,0,-19,1,-6,0,0,0,0,0,0,7,0,0,0,-18,-5,-19,0,0,0,17,0,0,-2],[111,0,30,0,0,3,132,-11,0,0,70,43,-1,-45,0,0,86,0,0,-45,0,0,13,-19,0,0,0,0,10,0,-8,0,13,0,37,-8,15,0,0,0,-11,0,0,-13],[0,21,0,8,-77,0,0,0,-9,-9,0,0,0,0,30,19,0,-2,-12,0,-18,0,0,0,0,-16,1,4,0,0,0,-4,0,-8,0,0,0,-10,0,-1,0,7,-2,0],[0,0,0,0,0,0,-18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,34,0,-16,-60,0,0,0,4,-13,0,0,0,0,17,25,0,-12,-36,0,-12,0,0,0,-5,5,9,3,0,-7,0,-6,0,-8,0,0,0,2,-7,-7,0,-7,-6,0],[0,12,0,23,-27,0,0,0,-1,-8,0,0,0,0,21,-15,0,-5,12,0,4,0,0,0,-15,-6,1,3,0,-4,0,-13,0,4,0,0,0,11,2,2,0,0,3,0],[-99,0,45,0,0,11,52,-9,0,0,17,11,4,-12,0,0,31,0,0,17,0,8,17,6,0,0,0,0,3,0,-10,0,6,0,0,0,-13,0,0,0,-3,0,0,1],[-20,0,-33,0,0,7,-346,11,0,0,6,-12,-17,125,0,0,14,0,0,23,0,26,1,7,0,0,0,0,22,0,-8,0,-29,0,-17,18,5,0,0,0,9,0,0,-1],[-193,0,28,0,0,4,32,10,0,0,18,-4,-40,-47,0,0,7,0,0,-6,0,-1,-13,-13,0,0,0,0,4,0,20,0,-12,0,21,4,25,0,0,0,-19,0,0,-25],[14,0,-23,0,0,11,112,-9,0,0,-13,-15,3,-38,0,0,1,0,0,10,0,-6,3,0,0,0,0,0,-1,0,7,0,14,0,-32,-20,-11,0,0,0,7,0,0,4],[-179,0,84,0,0,-5,-194,-15,0,0,6,37,27,27,0,0,-46,0,0,25,0,2,-3,1,0,0,0,0,18,0,-4,0,3,0,49,2,-19,0,0,0,-15,0,0,-7],[230,0,9,0,0,4,-260,7,0,0,26,46,11,13,0,0,-12,0,0,-47,0,-8,-1,7,0,0,0,0,10,0,-15,0,11,0,-32,-29,-4,0,0,0,-15,0,0,0],[21,0,-9,0,0,3,15,3,0,0,12,-3,-3,0,0,0,3,0,0,-15,0,6,-3,-6,0,0,0,0,6,0,3,0,-6,0,9,0,9,0,0,0,-3,0,0,-9],[-107,0,72,0,0,-18,43,-2,0,0,-45,-22,-8,-42,0,0,-90,0,0,58,0,-19,2,-6,0,0,0,0,-23,0,33,0,8,0,-14,-22,-8,0,0,0,9,0,0,-8],[0,-114,0,4,19,0,0,0,1,5,0,0,0,0,22,-6,0,22,1,0,-12,0,0,0,-9,-1,10,-2,0,-12,0,7,0,0,0,0,0,-5,9,1,0,-14,-5,0],[0,160,0,-42,-19,0,0,0,19,5,0,0,0,0,14,-1,0,18,1,0,-16,0,0,0,-1,0,-5,3,0,0,0,0,0,0,0,0,0,0,1,11,0,11,-3,0],[0,-142,0,19,-36,0,0,0,-3,7,0,0,0,0,2,16,0,9,-19,0,2,0,0,0,3,10,-1,7,0,-6,0,1,0,-11,0,0,0,-7,11,5,0,4,-11,0],[0,156,0,-25,83,0,0,0,-6,-5,0,0,0,0,-33,9,0,12,-2,0,11,0,0,0,5,-10,3,1,0,-12,0,8,0,0,0,0,0,3,-2,1,0,-6,1,0],[0,-24,0,-33,45,0,0,0,8,-3,0,0,0,0,-16,0,0,-8,-15,0,-14,0,0,0,3,2,0,2,0,4,0,3,0,0,0,0,0,0,-3,-1,0,1,-2,0],[0,-260,0,10,86,0,0,0,4,20,0,0,0,0,-17,31,0,12,4,0,6,0,0,0,-13,3,3,7,0,-5,0,-8,0,-8,0,0,0,-18,13,-11,0,1,-4,0],[0,-125,0,-22,42,0,0,0,-18,-4,0,0,0,0,27,1,0,-6,-29,0,-9,0,0,0,-4,-9,4,2,0,-4,0,5,0,-8,0,0,0,-15,6,0,0,-7,3,0],[0,-30,0,0,27,0,0,0,0,-3,0,0,0,0,-15,9,0,9,6,0,-3,0,0,0,-3,-6,3,3,0,-6,0,0,0,0,0,0,0,-3,3,3,0,0,-3,0],[113,0,-95,0,0,-9,43,21,0,0,15,-6,-55,9,0,0,23,0,0,-28,0,11,-18,-14,0,0,0,0,3,0,-4,0,-15,0,15,2,10,0,0,0,7,0,0,-8],[261,0,-76,0,0,22,161,-14,0,0,-2,19,-24,10,0,0,-61,0,0,12,0,-8,-2,10,0,0,0,0,-11,0,1,0,-3,0,45,18,7,0,0,0,-13,0,0,-6],[0,79,0,-10,-14,0,0,0,-6,-7,0,0,0,0,-7,-4,0,9,-8,0,4,0,0,0,-5,-4,5,2,0,-4,0,-2,0,0,0,0,0,-5,-1,2,0,0,-3,0],[3,0,-50,0,0,8,57,13,0,0,-35,-11,-36,-15,0,0,0,0,0,60,0,7,2,-10,0,0,0,0,-7,0,12,0,0,0,-13,16,6,0,0,0,22,0,0,6],[0,-87,0,3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20bf870f84ae5050
|
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
|
/source/linux/drivers/net/ethernet/qlogic/qed/extr_qed_sriov.c_qed_iov_bulletin_set_mac.c
|
3a051ccf5c06896d0a53a96423042868fee84612
|
[] |
no_license
|
isabella232/AnghaBench
|
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
|
9a5f60cdc907a0475090eef45e5be43392c25132
|
refs/heads/master
| 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 2,371 |
c
|
extr_qed_sriov.c_qed_iov_bulletin_set_mac.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ u8 ;
typedef int u64 ;
typedef int /*<<< orphan*/ u16 ;
struct TYPE_6__ {scalar_t__ is_trusted_configured; } ;
struct TYPE_5__ {TYPE_1__* p_virt; } ;
struct qed_vf_info {TYPE_3__ p_vf_info; TYPE_2__ bulletin; scalar_t__ b_malicious; } ;
struct qed_hwfn {int /*<<< orphan*/ cdev; } ;
struct TYPE_4__ {int valid_bitmap; int /*<<< orphan*/ mac; } ;
/* Variables and functions */
int BIT (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ DP_NOTICE (int /*<<< orphan*/ ,char*,int) ;
int /*<<< orphan*/ DP_VERBOSE (struct qed_hwfn*,int /*<<< orphan*/ ,char*) ;
int EINVAL ;
int /*<<< orphan*/ MAC_ADDR_FORCED ;
int /*<<< orphan*/ QED_MSG_IOV ;
int /*<<< orphan*/ VFPF_BULLETIN_MAC_ADDR ;
int /*<<< orphan*/ ether_addr_copy (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ qed_iov_configure_vport_forced (struct qed_hwfn*,struct qed_vf_info*,int) ;
struct qed_vf_info* qed_iov_get_vf_info (struct qed_hwfn*,int /*<<< orphan*/ ,int) ;
__attribute__((used)) static int qed_iov_bulletin_set_mac(struct qed_hwfn *p_hwfn, u8 *mac, int vfid)
{
struct qed_vf_info *vf_info;
u64 feature;
vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true);
if (!vf_info) {
DP_NOTICE(p_hwfn->cdev, "Can not set MAC, invalid vfid [%d]\n",
vfid);
return -EINVAL;
}
if (vf_info->b_malicious) {
DP_NOTICE(p_hwfn->cdev, "Can't set MAC to malicious VF [%d]\n",
vfid);
return -EINVAL;
}
if (vf_info->bulletin.p_virt->valid_bitmap & BIT(MAC_ADDR_FORCED)) {
DP_VERBOSE(p_hwfn, QED_MSG_IOV,
"Can not set MAC, Forced MAC is configured\n");
return -EINVAL;
}
feature = BIT(VFPF_BULLETIN_MAC_ADDR);
ether_addr_copy(vf_info->bulletin.p_virt->mac, mac);
vf_info->bulletin.p_virt->valid_bitmap |= feature;
if (vf_info->p_vf_info.is_trusted_configured)
qed_iov_configure_vport_forced(p_hwfn, vf_info, feature);
return 0;
}
|
08125287a2f1dadd8daf41c8b0b6cd4e8fce1fbc
|
d03d973cb5ab177c4fbae0d03b74fa8d23928f07
|
/module/include/conversion.h
|
117fcc1cb9bf3b6066888c4af7293aba0b21e036
|
[] |
no_license
|
meyerf93/ElecRegulModule
|
9fa2263d73450ddcac992fb2e9ae0996d26e971f
|
b5e5fb5d666054d3aff2212571ae829d424d3c7f
|
refs/heads/master
| 2020-03-21T13:21:58.538831 | 2018-11-05T07:01:10 | 2018-11-05T07:01:10 | 138,602,106 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 980 |
h
|
conversion.h
|
//Fichier : conversion.h
//Projet : Pilotage-micro réseau - NeighborHub
//But : Connection and mqtt method for charger inverter
//Auteurs : Florian Meyer.
//Version : 2.1
//Date : 13.07.2018
//Status : test
#ifndef CONVERSION_H
#define CONVERSION_H
//#include "connection.h"
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <time.h>
#include <syslog.h>
#include "cJSON.h"
#include <json.h>
#include <MQTTClient.h>
#define BOOL_F 1
#define FLOAT_F 6
#define INT32_F 5
#define LONG_ENUM 10
#define SHORT_ENUM 11
#define ENUM 3
#define SPACE "\t\r\n"
void strip(char *s,const char * to_remove);
void send_json_obj(MQTTClient client,char topic[64], char data[64], char id[64]);
int parse_energy_meters(char* payload);
int parse_studer_message(char* payload,cJSON* data);
#endif
|
879ac1035f3f5be54ab1713a34f06c01f29edbc7
|
a6e6a068b872383aa8c3ea887eb74c0537aaf548
|
/avm_cpmac/switch/ifx/ar10/swi_ar10_reg.h
|
a1ec572f8b77d62ad36a3ae8d030ddc77288c1e2
|
[] |
no_license
|
kestrel1974/lantiq7portswitch
|
992ccc2268143a5a6f41c55cce440d301f5ee19c
|
de2cc12cfbe972799dd1ed74daa095594fdd74c7
|
refs/heads/master
| 2023-04-01T04:34:46.427461 | 2021-04-03T09:38:18 | 2021-04-03T09:38:18 | 354,251,326 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 19,283 |
h
|
swi_ar10_reg.h
|
/*
* swi_ar10_reg.h
*
* Created on: 02.08.2012
* Author: tklaassen
*/
#if !defined(SWI_REG_H_)
#error Do not include machine dependent register definitions directly!
#endif
#ifndef SWI_AR10_REG_H_
#define SWI_AR10_REG_H_
#define PP32_NUM_CORES 1
/*
* EMA Settings
*/
#define EMA_CMD_BUF_LEN 0x0010
#define EMA_CMD_BASE_ADDR (0x1710 << 2)
#define EMA_DATA_BUF_LEN 0x0040
#define EMA_DATA_BASE_ADDR (0x16d0 << 2)
#define EMA_WRITE_BURST 0x02
#define EMA_READ_BURST 0x02
/*
* FPI Configuration Bus Register and Memory Address Mapping
*/
#define IFX_PPE KSEG1ADDR(0x1E180000)
#define AMAZON_S_PPE KSEG1ADDR(0x1E180000)
#define PP32_DEBUG_REG_ADDR(x) ((volatile u32*)(AMAZON_S_PPE + (((x) + 0x0000) << 2)))
#define PPM_INT_REG_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x0030) << 2)))
#define PP32_INTERNAL_RES_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x0040) << 2)))
#define PPE_CLOCK_CONTROL_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x0100) << 2)))
#define CDM_CODE_MEMORY_RAM0_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x1000) << 2)))
#define CDM_CODE_MEMORY_RAM1_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x2000) << 2)))
#define CDM_CODE_MEMORY(i, x) CDM_CODE_MEMORY_RAM0_ADDR(x)
#define PPE_REG_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x4000) << 2)))
#define PP32_DATA_MEMORY_RAM1_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x5000) << 2)))
//#define CDM_DATA_MEMORY(i, x) ((volatile unsigned int*)(IFX_PPE + (((x) + 0x004000 + (i) * 0x00010000) << 2)))
#define PPM_INT_UNIT_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x6000) << 2)))
#define PPM_TIMER0_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x6100) << 2)))
#define PPM_TASK_IND_REG_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x6200) << 2)))
#define PPS_BRK_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x6300) << 2)))
#define PPM_TIMER1_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x6400) << 2)))
#define SB_RAM0_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x8000) << 2)))
#define SB_RAM1_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x8800) << 2)))
#define SB_RAM2_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x9000) << 2)))
#define SB_RAM3_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0x9800) << 2)))
#define SB_RAM4_ADDR(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0xA000) << 2)))
#define QSB_CONF_REG(x) ((volatile unsigned int *)(IFX_PPE + (((x) + 0xC000) << 2)))
/*
* DWORD-Length of Memory Blocks
*/
#define PP32_DEBUG_REG_DWLEN 0x0030
#define PPM_INT_REG_DWLEN 0x0010
#define PP32_INTERNAL_RES_DWLEN 0x00C0
#define PPE_CLOCK_CONTROL_DWLEN 0x0F00
#define CDM_CODE_MEMORY_RAM0_DWLEN 0x1000
#define CDM_CODE_MEMORY_RAM1_DWLEN 0x1000
#define PPE_REG_DWLEN 0x1000
#define PP32_DATA_MEMORY_RAM1_DWLEN CDM_CODE_MEMORY_RAM1_DWLEN
#define PPM_INT_UNIT_DWLEN 0x0100
#define PPM_TIMER0_DWLEN 0x0100
#define PPM_TASK_IND_REG_DWLEN 0x0100
#define PPS_BRK_DWLEN 0x0100
#define PPM_TIMER1_DWLEN 0x0100
#define SB_RAM0_DWLEN 0x0800
#define SB_RAM1_DWLEN 0x0800
#define SB_RAM2_DWLEN 0x0800
#define SB_RAM3_DWLEN 0x0800
#define SB_RAM4_DWLEN 0x0C00
#define QSB_CONF_REG_DWLEN 0x0100
/*
* Share Buffer Registers
*/
#define SB_MST_PRI0 PPE_REG_ADDR(0x0300)
#define SB_MST_PRI1 PPE_REG_ADDR(0x0301)
/*
* DPlus Registers
*/
#define DM_RXDB PPE_REG_ADDR(0x0612)
#define DM_RXCB PPE_REG_ADDR(0x0613)
#define DM_RXCFG PPE_REG_ADDR(0x0614)
#define DM_RXPGCNT PPE_REG_ADDR(0x0615)
#define DM_RXPKTCNT PPE_REG_ADDR(0x0616)
#define DS_RXDB PPE_REG_ADDR(0x0710)
#define DS_RXCB PPE_REG_ADDR(0x0711)
#define DS_RXCFG PPE_REG_ADDR(0x0712)
#define DS_RXPGCNT PPE_REG_ADDR(0x0713)
/*
* EMA Registers
*/
#define EMA_CMDCFG PPE_REG_ADDR(0x0A00)
#define EMA_DATACFG PPE_REG_ADDR(0x0A01)
#define EMA_CMDCNT PPE_REG_ADDR(0x0A02)
#define EMA_DATACNT PPE_REG_ADDR(0x0A03)
#define EMA_ISR PPE_REG_ADDR(0x0A04)
#define EMA_IER PPE_REG_ADDR(0x0A05)
#define EMA_CFG PPE_REG_ADDR(0x0A06)
#define EMA_SUBID PPE_REG_ADDR(0x0A07)
/*
* PP32 Debug Control Register
*/
#define PP32_DBG_CTRL PP32_DEBUG_REG_ADDR(0x0000)
#define DBG_CTRL_RESTART 0
#define DBG_CTRL_STOP 1
/*
* PP32 Debug Control Register
*/
#define PP32_FREEZE PPE_REG_ADDR(0x0000)
#define PP32_SRST PPE_REG_ADDR(0x0020)
/*
* PP32 Registers
*/
// Amazon-S
#define PP32_CTRL_CMD PP32_DEBUG_REG_ADDR(0x0B00)
#define PP32_CTRL_CMD_RESTART (1 << 0)
#define PP32_CTRL_CMD_STOP (1 << 1)
#define PP32_CTRL_CMD_STEP (1 << 2)
#define PP32_CTRL_CMD_BREAKOUT (1 << 3)
#define PP32_CTRL_OPT PP32_DEBUG_REG_ADDR(0x0C00)
#define PP32_CTRL_OPT_BREAKOUT_ON_STOP_ON (3 << 0)
#define PP32_CTRL_OPT_BREAKOUT_ON_STOP_OFF (2 << 0)
#define PP32_CTRL_OPT_BREAKOUT_ON_BREAKIN_ON (3 << 2)
#define PP32_CTRL_OPT_BREAKOUT_ON_BREAKIN_OFF (2 << 2)
#define PP32_CTRL_OPT_STOP_ON_BREAKIN_ON (3 << 4)
#define PP32_CTRL_OPT_STOP_ON_BREAKIN_OFF (2 << 4)
#define PP32_CTRL_OPT_STOP_ON_BREAKPOINT_ON (3 << 6)
#define PP32_CTRL_OPT_STOP_ON_BREAKPOINT_OFF (2 << 6)
#define PP32_CTRL_OPT_BREAKOUT_ON_STOP (*PP32_CTRL_OPT & (1 << 0))
#define PP32_CTRL_OPT_BREAKOUT_ON_BREAKIN (*PP32_CTRL_OPT & (1 << 2))
#define PP32_CTRL_OPT_STOP_ON_BREAKIN (*PP32_CTRL_OPT & (1 << 4))
#define PP32_CTRL_OPT_STOP_ON_BREAKPOINT (*PP32_CTRL_OPT & (1 << 6))
#define PP32_BRK_PC(i) PP32_DEBUG_REG_ADDR(0x0900 + (i) * 2)
#define PP32_BRK_PC_MASK(i) PP32_DEBUG_REG_ADDR(0x0901 + (i) * 2)
#define PP32_BRK_DATA_ADDR(i) PP32_DEBUG_REG_ADDR(0x0904 + (i) * 2)
#define PP32_BRK_DATA_ADDR_MASK(i) PP32_DEBUG_REG_ADDR(0x0905 + (i) * 2)
#define PP32_BRK_DATA_VALUE_RD(i) PP32_DEBUG_REG_ADDR(0x0908 + (i) * 2)
#define PP32_BRK_DATA_VALUE_RD_MASK(i) PP32_DEBUG_REG_ADDR(0x0909 + (i) * 2)
#define PP32_BRK_DATA_VALUE_WR(i) PP32_DEBUG_REG_ADDR(0x090C + (i) * 2)
#define PP32_BRK_DATA_VALUE_WR_MASK(i) PP32_DEBUG_REG_ADDR(0x090D + (i) * 2)
#define PP32_BRK_CONTEXT_MASK(i) (1 << (i))
#define PP32_BRK_CONTEXT_MASK_EN (1 << 4)
#define PP32_BRK_COMPARE_GREATER_EQUAL (1 << 5) // valid for break data value rd/wr only
#define PP32_BRK_COMPARE_LOWER_EQUAL (1 << 6)
#define PP32_BRK_COMPARE_EN (1 << 7)
#define PP32_BRK_TRIG PP32_DEBUG_REG_ADDR(0x0F00)
#define PP32_BRK_GRPi_PCn_ON(i, n) ((3 << ((n) * 2)) << ((i) * 16))
#define PP32_BRK_GRPi_PCn_OFF(i, n) ((2 << ((n) * 2)) << ((i) * 16))
#define PP32_BRK_GRPi_DATA_ADDRn_ON(i, n) ((3 << ((n) * 2 + 4)) << ((i) * 16))
#define PP32_BRK_GRPi_DATA_ADDRn_OFF(i, n) ((2 << ((n) * 2 + 4)) << ((i) * 16))
#define PP32_BRK_GRPi_DATA_VALUE_RDn_ON(i, n) ((3 << ((n) * 2 + 8)) << ((i) * 16))
#define PP32_BRK_GRPi_DATA_VALUE_RDn_OFF(i, n)((2 << ((n) * 2 + 8)) << ((i) * 16))
#define PP32_BRK_GRPi_DATA_VALUE_WRn_ON(i, n) ((3 << ((n) * 2 + 12)) << ((i) * 16))
#define PP32_BRK_GRPi_DATA_VALUE_WRn_OFF(i, n)((2 << ((n) * 2 + 12)) << ((i) * 16))
#define PP32_BRK_GRPi_PCn(i, n) (*PP32_BRK_TRIG & ((1 << ((n))) << ((i) * 8)))
#define PP32_BRK_GRPi_DATA_ADDRn(i, n) (*PP32_BRK_TRIG & ((1 << ((n) + 2)) << ((i) * 8)))
#define PP32_BRK_GRPi_DATA_VALUE_RDn(i, n) (*PP32_BRK_TRIG & ((1 << ((n) + 4)) << ((i) * 8)))
#define PP32_BRK_GRPi_DATA_VALUE_WRn(i, n) (*PP32_BRK_TRIG & ((1 << ((n) + 6)) << ((i) * 8)))
#define PP32_CPU_STATUS PP32_DEBUG_REG_ADDR(0x0D00)
#define PP32_HALT_STAT PP32_CPU_STATUS
#define PP32_DBG_CUR_PC PP32_CPU_STATUS
#define PP32_CPU_USER_STOPPED (*PP32_CPU_STATUS & (1 << 0))
#define PP32_CPU_USER_BREAKIN_RCV (*PP32_CPU_STATUS & (1 << 1))
#define PP32_CPU_USER_BREAKPOINT_MET (*PP32_CPU_STATUS & (1 << 2))
#define PP32_CPU_CUR_PC (*PP32_CPU_STATUS >> 16)
#define PP32_BREAKPOINT_REASONS PP32_DEBUG_REG_ADDR(0x0A00)
#define PP32_BRK_PC_MET(i) (*PP32_BREAKPOINT_REASONS & (1 << (i)))
#define PP32_BRK_DATA_ADDR_MET(i) (*PP32_BREAKPOINT_REASONS & (1 << ((i) + 2)))
#define PP32_BRK_DATA_VALUE_RD_MET(i) (*PP32_BREAKPOINT_REASONS & (1 << ((i) + 4)))
#define PP32_BRK_DATA_VALUE_WR_MET(i) (*PP32_BREAKPOINT_REASONS & (1 << ((i) + 6)))
#define PP32_BRK_DATA_VALUE_RD_LO_EQ(i) (*PP32_BREAKPOINT_REASONS & (1 << ((i) * 2 + 8)))
#define PP32_BRK_DATA_VALUE_RD_GT_EQ(i) (*PP32_BREAKPOINT_REASONS & (1 << ((i) * 2 + 9)))
#define PP32_BRK_DATA_VALUE_WR_LO_EQ(i) (*PP32_BREAKPOINT_REASONS & (1 << ((i) * 2 + 12)))
#define PP32_BRK_DATA_VALUE_WR_GT_EQ(i) (*PP32_BREAKPOINT_REASONS & (1 << ((i) * 2 + 13)))
#define PP32_BRK_CUR_CONTEXT ((*PP32_BREAKPOINT_REASONS >> 16) & 0x03)
#define PP32_GP_REG_BASE PP32_DEBUG_REG_ADDR(0x0E00)
#define PP32_GP_CONTEXTi_REGn(i, n) PP32_DEBUG_REG_ADDR(0x0E00 + (i) * 16 + (n))
/*
* Code/Data Memory (CDM) Interface Configuration Register
*/
#define CDM_CFG PPE_REG_ADDR(0x0100)
#define CDM_CFG_RAM1_SET(value) SET_BITS(0, 3, 2, value)
#define CDM_CFG_RAM0_SET(value) ((value) ? (1 << 1) : 0)
/*
* QSB Internal Cell Delay Variation Register
*/
#define QSB_ICDV QSB_CONF_REG(0x0007)
#define QSB_ICDV_TAU GET_BITS(*QSB_ICDV, 5, 0)
#define QSB_ICDV_TAU_SET(value) SET_BITS(0, 5, 0, value)
/*
* QSB Scheduler Burst Limit Register
*/
#define QSB_SBL QSB_CONF_REG(0x0009)
#define QSB_SBL_SBL GET_BITS(*QSB_SBL, 3, 0)
#define QSB_SBL_SBL_SET(value) SET_BITS(0, 3, 0, value)
/*
* QSB Configuration Register
*/
#define QSB_CFG QSB_CONF_REG(0x000A)
#define QSB_CFG_TSTEPC GET_BITS(*QSB_CFG, 1, 0)
#define QSB_CFG_TSTEPC_SET(value) SET_BITS(0, 1, 0, value)
/*
* QSB RAM Transfer Table Register
*/
#define QSB_RTM QSB_CONF_REG(0x000B)
#define QSB_RTM_DM (*QSB_RTM)
#define QSB_RTM_DM_SET(value) ((value) & 0xFFFFFFFF)
/*
* QSB RAM Transfer Data Register
*/
#define QSB_RTD QSB_CONF_REG(0x000C)
#define QSB_RTD_TTV (*QSB_RTD)
#define QSB_RTD_TTV_SET(value) ((value) & 0xFFFFFFFF)
/*
* QSB RAM Access Register
*/
#define QSB_RAMAC QSB_CONF_REG(0x000D)
#define QSB_RAMAC_RW (*QSB_RAMAC & (1 << 31))
#define QSB_RAMAC_TSEL GET_BITS(*QSB_RAMAC, 27, 24)
#define QSB_RAMAC_LH (*QSB_RAMAC & (1 << 16))
#define QSB_RAMAC_TESEL GET_BITS(*QSB_RAMAC, 9, 0)
#define QSB_RAMAC_RW_SET(value) ((value) ? (1 << 31) : 0)
#define QSB_RAMAC_TSEL_SET(value) SET_BITS(0, 27, 24, value)
#define QSB_RAMAC_LH_SET(value) ((value) ? (1 << 16) : 0)
#define QSB_RAMAC_TESEL_SET(value) SET_BITS(0, 9, 0, value)
/*
* Mailbox IGU0 Registers
*/
#define MBOX_IGU0_ISRS PPE_REG_ADDR(0x0200)
#define MBOX_IGU0_ISRC PPE_REG_ADDR(0x0201)
#define MBOX_IGU0_ISR PPE_REG_ADDR(0x0202)
#define MBOX_IGU0_IER PPE_REG_ADDR(0x0203)
/*
* Mailbox IGU1 Registers
*/
#define MBOX_IGU1_ISRS PPE_REG_ADDR(0x0204)
#define MBOX_IGU1_ISRC PPE_REG_ADDR(0x0205)
#define MBOX_IGU1_ISR PPE_REG_ADDR(0x0206)
#define MBOX_IGU1_IER PPE_REG_ADDR(0x0207)
/*
* DSL registers
*/
#define AT_CTRL PPE_REG_ADDR(0xD02)
#define AR_CTRL PPE_REG_ADDR(0xD08)
#define AT_IDLE0 PPE_REG_ADDR(0xD28)
#define AT_IDLE1 PPE_REG_ADDR(0xD29)
#define AR_IDLE0 PPE_REG_ADDR(0xD74)
#define AR_IDLE1 PPE_REG_ADDR(0xD75)
#define RFBI_CFG PPE_REG_ADDR(0x400)
#define SFSM_DBA0 PPE_REG_ADDR(0x412)
#define SFSM_DBA1 PPE_REG_ADDR(0x413)
#define SFSM_CBA0 PPE_REG_ADDR(0x414)
#define SFSM_CBA1 PPE_REG_ADDR(0x415)
#define SFSM_CFG0 PPE_REG_ADDR(0x416)
#define SFSM_CFG1 PPE_REG_ADDR(0x417)
#define FFSM_DBA0 PPE_REG_ADDR(0x508)
#define FFSM_DBA1 PPE_REG_ADDR(0x509)
#define FFSM_CFG0 PPE_REG_ADDR(0x50A)
#define FFSM_CFG1 PPE_REG_ADDR(0x50B)
#define FFSM_IDLE_HEAD_BC0 PPE_REG_ADDR(0x50E)
#define FFSM_IDLE_HEAD_BC1 PPE_REG_ADDR(0x50F)
#define SFSM_CFG(x) PPE_REG_ADDR((0x416 + x)) // x between 0 -1
#define SFSM_DBA(x) PPE_REG_ADDR((0x412 + x)) // x between 0 -1
#define SFSM_CBA(x) PPE_REG_ADDR((0x414 + x)) // x between 0 -1
#define FFSM_DBA(x) PPE_REG_ADDR((0x508 + x)) // x between 0 -1
#define FFSM_CFG(x) PPE_REG_ADDR((0x50A + x)) // x between 0 -1
/*
* Reset Registers
*/
#define AMAZON_S_RCU_BASE_ADDR (KSEG1 | 0x1F203000)
#define AMAZON_S_RCU_RST_REQ ((volatile u32*)(AMAZON_S_RCU_BASE_ADDR + 0x0010))
#define AMAZON_S_RCU_RST_STAT ((volatile u32*)(AMAZON_S_RCU_BASE_ADDR + 0x0014))
#define AMAZON_S_USB_CFG ((volatile u32*)(AMAZON_S_RCU_BASE_ADDR + 0x0018))
#define AMAZON_S_RCU_PPE_CONF ((volatile u32*)(AMAZON_S_RCU_BASE_ADDR + 0x002C))
/*
* DMA Registers
*/
#define AMAZON_S_DMA (KSEG1 | 0x1E104100)
#define AMAZON_S_DMA_BASE AMAZON_S_DMA
#define AMAZON_S_DMA_CLC (volatile u32*)(AMAZON_S_DMA_BASE + 0x00)
#define AMAZON_S_DMA_ID (volatile u32*)(AMAZON_S_DMA_BASE + 0x08)
#define AMAZON_S_DMA_CTRL (volatile u32*)(AMAZON_S_DMA_BASE + 0x10)
#define AMAZON_S_DMA_CPOLL (volatile u32*)(AMAZON_S_DMA_BASE + 0x14)
#define AMAZON_S_DMA_CS(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x18 + 0x38 * (i))
#define AMAZON_S_DMA_CCTRL(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x1C + 0x38 * (i))
#define AMAZON_S_DMA_CDBA(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x20 + 0x38 * (i))
#define AMAZON_S_DMA_CDLEN(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x24 + 0x38 * (i))
#define AMAZON_S_DMA_CIS(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x28 + 0x38 * (i))
#define AMAZON_S_DMA_CIE(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x2C + 0x38 * (i))
#define AMAZON_S_CGBL (volatile u32*)(AMAZON_S_DMA_BASE + 0x30)
#define AMAZON_S_DMA_PS(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x40 + 0x30 * (i))
#define AMAZON_S_DMA_PCTRL(i) (volatile u32*)(AMAZON_S_DMA_BASE + 0x44 + 0x30 * (i))
#define AMAZON_S_DMA_IRNEN (volatile u32*)(AMAZON_S_DMA_BASE + 0xf4)
#define AMAZON_S_DMA_IRNCR (volatile u32*)(AMAZON_S_DMA_BASE + 0xf8)
#define AMAZON_S_DMA_IRNICR (volatile u32*)(AMAZON_S_DMA_BASE + 0xfc)
/*
* External Interrupt Registers
*/
#define AMAZON_S_EIU_BASE (KSEG1 | 0x1F101000)
#define AMAZON_S_EIU_EXIN_C (volatile u32*)(AMAZON_S_EIU_BASE + 0x00)
#define AMAZON_S_EIU_INIC (volatile u32*)(AMAZON_S_EIU_BASE + 0x04)
#define AMAZON_S_EIU_INC (volatile u32*)(AMAZON_S_EIU_BASE + 0x08)
#define AMAZON_S_EIU_INEN (volatile u32*)(AMAZON_S_EIU_BASE + 0x0C)
#define AMAZON_S_EIU_YIELDEN0 (volatile u32*)(AMAZON_S_EIU_BASE + 0x10)
#define AMAZON_S_EIU_YIELDEN1 (volatile u32*)(AMAZON_S_EIU_BASE + 0x14)
#define AMAZON_S_EIU_YIELDEN2 (volatile u32*)(AMAZON_S_EIU_BASE + 0x18)
#define AMAZON_S_EIU_NMI_CR (volatile u32*)(AMAZON_S_EIU_BASE + 0xF0)
#define AMAZON_S_EIU_NMI_SR (volatile u32*)(AMAZON_S_EIU_BASE + 0xF4)
/*
* SLL Registers
*/
#define SLL_CMD1 PPE_REG_ADDR(0x900)
#define SLL_CMD0 PPE_REG_ADDR(0x901)
#define SLL_KEY(x) PPE_REG_ADDR(0x910+x)
#define SLL_RESULT PPE_REG_ADDR(0x920)
/*
* Chip ID Registers
*/
#define AR10_MIPS_CHIPID_BASE (KSEG1 | 0x1F107340)
#define AR10_MIPS_CHIPID (volatile u32*)(AR10_MIPS_CHIPID_BASE + 0x4)
#endif /* SWI_AR10_REG_H_ */
|
c066e90fee9c0a0dd415199c7ead601d1f4b6a83
|
52b28d245369c608374792215a055fca869b655c
|
/src/drivers/screen.h
|
46815b3cfd1f4368d4692244edfa7a5071f1786e
|
[] |
no_license
|
shessel/os-from-scratch
|
9b06cd83282f8141ec2a14b9c9dc51940b36d8bc
|
5a8de859b578ffcaaa4f020870c399cc765bef92
|
refs/heads/master
| 2021-01-25T14:22:22.585953 | 2018-03-06T16:18:21 | 2018-03-06T20:05:55 | 123,686,558 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 246 |
h
|
screen.h
|
#ifndef DRIVERS_SCREEN_H
#define DRIVERS_SCREEN_H
#include <stdint.h>
void print_string(const char* const msg);
void clear_screen(const char color, const char symbol);
void clear_screen_color(const char color);
void clear_screen_def();
#endif
|
cc33472a5408d40d44fdcadfb96bf08acd23fa31
|
dc7d429b74a6be2b411cea21ba06ca5bfcaf0f88
|
/atlantis_fw/platform/driver/src/temperature.c
|
82ad46498a4ee770888b848bd4150b7997106529
|
[] |
no_license
|
hoantien/Light_code
|
620b458dace18f749d068e3d74303dd6875b2ca8
|
9b83bbb88c1c403d73c7c45c44389c006fe0d0e6
|
refs/heads/master
| 2020-03-08T10:25:30.436400 | 2018-04-04T15:10:58 | 2018-04-04T15:10:58 | 128,072,987 | 1 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 2,800 |
c
|
temperature.c
|
/*******************************************************************************
* Copyright (c) 2016, The LightCo
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are strictly prohibited without prior permission of
* The LightCo.
*
* @file temperature.c
* @author The LightCo
* @version V1.0.0
* @date April-1-2016
* @brief This file contains expand for temperature sensor driver
*
******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "std_type.h"
#include "board_config.h"
#include "os.h"
#include "log.h"
#include "i2cm.h"
#include "temperature.h"
/* Privated define------------------------------------------------------------*/
#define SLOGF_ID SLOG_ID_LIGHT_SYSTEM
#define TMP112_INIT_VALUE 0x60A0
#define TMP112_REG_TEMP_ADDR 0x00
#define TMP112_REG_CONFIG_ADDR 0x01
/* Privated variables --------------------------------------------------------*/
/* Privated functions --------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/* I2C initialization for temperature TMP211 sensor */
void temp_sensor_init(void)
{
i2cm.init(HAL_I2C_TEMP);
if(TEMP_OK ==temp_sensor_raw_data_init(TMP112_INIT_VALUE))
{
SLOGF(SLOG_INFO, "Init device temperature done!!!");
}
else
{
SLOGF(SLOG_ERROR, "Init device temperature fail!!!");
}
}
/* temp_sensor_raw_data_init */
int temp_sensor_raw_data_init(uint16_t mode)
{
uint8_t tx_data[2];
int ret = TEMP_FAILED;
tx_data[0] = (mode >> 8) & 0x00FF;
tx_data[1] = mode & 0x00FF;
if(I2CM_ERROR_TRANSMITTED == i2cm.write(HAL_I2C_TEMP, WORD_ADDR8,
TEMP_SLAVE_ADDR, TMP112_REG_CONFIG_ADDR, &tx_data[0]))
ret = TEMP_OK;
else
ret = TEMP_FAILED;
return ret;
}
/* temp_sensor_raw_data_get */
int temp_sensor_raw_data_get(uint8_t *data)
{
int ret = TEMP_FAILED;
if(I2CM_ERROR_TRANSCEIVED == i2cm.read(HAL_I2C_TEMP, WORD_ADDR8,
TEMP_SLAVE_ADDR, TMP112_REG_TEMP_ADDR, data))
ret = TEMP_OK;
else
ret = TEMP_FAILED;
return ret;
}
/*
* temp_sensor_read
* Read temperature sensor
*/
float temp_sensor_read(void)
{
float ret = 0.0;
uint8_t data[2] = {0, 0};
int16_t tmp;
if(TEMP_OK == temp_sensor_raw_data_get((uint8_t *)&data[0]))
{
/* calculate temperature */
tmp = (int16_t)((data[0] << 8) | data[1]);
tmp >>= 4;
if(tmp & (1 << 11))
tmp |= 0xF000;
ret = ((float)(tmp) * 0.0625);
/*printf("\n\rTMP112: Read temperature successfully: %f\r\n", ret);*/
}
else
{
/*printf("\n\rTMP112: Read temperature failed\r\n");*/
ret = 0;
}
return ret;
}
/********** Portions COPYRIGHT 2016 Light.Co., Ltd.******* END OF FILE ********/
|
1aea8a4d1e501a039126fe057c82e9e76459d66f
|
bed3ac926beac0f4e0293303d7b2a6031ee476c9
|
/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Cdbg.c
|
104f1aff055a30b156129bbab2bb761cb15fae75
|
[
"LicenseRef-scancode-hdf5",
"LicenseRef-scancode-llnl",
"IJG",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"SMLNJ",
"BSD-3-Clause",
"BSD-4.3TAHOE",
"LicenseRef-scancode-free-unknown",
"Spencer-86",
"FSFUL",
"Libpng",
"libtiff",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
"MIT",
"NTP",
"LicenseRef-scancode-mit-old-style",
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"MPL-2.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] |
permissive
|
InsightSoftwareConsortium/ITK
|
ed9dbbc5b8b3f7511f007c0fc0eebb3ad37b88eb
|
3eb8fd7cdfbc5ac2d0c2e5e776848a4cbab3d7e1
|
refs/heads/master
| 2023-08-31T17:21:47.754304 | 2023-08-31T00:58:51 | 2023-08-31T14:12:21 | 800,928 | 1,229 | 656 |
Apache-2.0
| 2023-09-14T17:54:00 | 2010-07-27T15:48:04 |
C++
|
UTF-8
|
C
| false | false | 48,619 |
c
|
H5Cdbg.c
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
*
* Created: H5Cdbg.c
* July 8 2016
* Quincey Koziol
*
* Purpose: Debugging Routines for the generic cache structure or entries.
*
*-------------------------------------------------------------------------
*/
/****************/
/* Module Setup */
/****************/
#include "H5Cmodule.h" /* This source code file is part of the H5C module */
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata Cache */
#include "H5Cpkg.h" /* Cache */
#include "H5Eprivate.h" /* Error Handling */
/****************/
/* Local Macros */
/****************/
/******************/
/* Local Typedefs */
/******************/
/********************/
/* Local Prototypes */
/********************/
/*********************/
/* Package Variables */
/*********************/
/*****************************/
/* Library Private Variables */
/*****************************/
/*******************/
/* Local Variables */
/*******************/
#ifndef NDEBUG
/*-------------------------------------------------------------------------
* Function: H5C_dump_cache
*
* Purpose: Print a summary of the contents of the metadata cache for
* debugging purposes.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
* 10/10/10
*
*-------------------------------------------------------------------------
*/
herr_t
H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name)
{
H5C_cache_entry_t *entry_ptr;
H5SL_t * slist_ptr = NULL;
int i; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(cache_ptr != NULL);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(cache_name != NULL);
/* First, create a skip list */
if (NULL == (slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list")
/* Next, scan the index, and insert all entries in the skip list.
* Do this, as we want to display cache entries in increasing address
* order.
*/
for (i = 0; i < H5C__HASH_TABLE_LEN; i++) {
entry_ptr = cache_ptr->index[i];
while (entry_ptr != NULL) {
HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
if (H5SL_insert(slist_ptr, entry_ptr, &(entry_ptr->addr)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't insert entry in skip list")
entry_ptr = entry_ptr->ht_next;
} /* end while */
} /* end for */
/* If we get this far, all entries in the cache are listed in the
* skip list -- scan the skip list generating the desired output.
*/
HDfprintf(stdout, "\n\nDump of metadata cache \"%s\"\n", cache_name);
/* Print header */
HDfprintf(stdout, "Entry ");
HDfprintf(stdout, "| Address ");
HDfprintf(stdout, "| Tag ");
HDfprintf(stdout, "| Size ");
HDfprintf(stdout, "| Ring ");
HDfprintf(stdout, "| Type ");
HDfprintf(stdout, "| Prot/Pin/Dirty");
HDfprintf(stdout, "\n");
HDfprintf(stdout, "--------------------------------------------------------------------------------------"
"--------------------------\n");
i = 0;
entry_ptr = (H5C_cache_entry_t *)H5SL_remove_first(slist_ptr);
while (entry_ptr != NULL) {
HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
/* Print entry */
HDfprintf(stdout, "%s%5d ", cache_ptr->prefix, i);
HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->addr));
if (NULL == entry_ptr->tag_info)
HDfprintf(stdout, " %16s ", "N/A");
else
HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag));
HDfprintf(stdout, " %5lld ", (long long)(entry_ptr->size));
HDfprintf(stdout, " %d ", (int)(entry_ptr->ring));
HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name));
HDfprintf(stdout, " %d", (int)(entry_ptr->is_protected));
HDfprintf(stdout, " %d", (int)(entry_ptr->is_pinned));
HDfprintf(stdout, " %d", (int)(entry_ptr->is_dirty));
HDfprintf(stdout, "\n");
/* remove the next (first) item in the skip list */
entry_ptr = (H5C_cache_entry_t *)H5SL_remove_first(slist_ptr);
i++;
} /* end while */
HDfprintf(stdout, "\n\n");
/* Verify that all the entries were removed from the skip list */
HDassert(H5SL_count(slist_ptr) == 0);
done:
/* Discard the skip list */
if (slist_ptr)
H5SL_close(slist_ptr);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_dump_cache() */
#endif /* NDEBUG */
#ifndef NDEBUG
/*-------------------------------------------------------------------------
* Function: H5C_dump_cache_LRU
*
* Purpose: Print a summary of the contents of the metadata cache
* LRU for debugging purposes.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
* 10/10/10
*
*-------------------------------------------------------------------------
*/
herr_t
H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name)
{
H5C_cache_entry_t *entry_ptr;
int i = 0;
FUNC_ENTER_NOAPI_NOERR
/* Sanity check */
HDassert(cache_ptr != NULL);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(cache_name != NULL);
HDfprintf(stdout, "\n\nDump of metadata cache LRU \"%s\"\n", cache_name);
HDfprintf(stdout, "LRU len = %d, LRU size = %d\n", cache_ptr->LRU_list_len,
(int)(cache_ptr->LRU_list_size));
HDfprintf(stdout, "index_size = %d, max_cache_size = %d, delta = %d\n\n", (int)(cache_ptr->index_size),
(int)(cache_ptr->max_cache_size),
(int)(cache_ptr->max_cache_size) - (int)(cache_ptr->index_size));
/* Print header */
HDfprintf(stdout, "Entry ");
HDfprintf(stdout, "| Address ");
HDfprintf(stdout, "| Tag ");
HDfprintf(stdout, "| Size ");
HDfprintf(stdout, "| Ring ");
HDfprintf(stdout, "| Type ");
HDfprintf(stdout, "| Dirty");
HDfprintf(stdout, "\n");
HDfprintf(stdout, "--------------------------------------------------------------------------------------"
"--------------------------\n");
entry_ptr = cache_ptr->LRU_head_ptr;
while (entry_ptr != NULL) {
HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
/* Print entry */
HDfprintf(stdout, "%s%5d ", cache_ptr->prefix, i);
HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->addr));
if (NULL == entry_ptr->tag_info)
HDfprintf(stdout, " %16s ", "N/A");
else
HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag));
HDfprintf(stdout, " %5lld ", (long long)(entry_ptr->size));
HDfprintf(stdout, " %d ", (int)(entry_ptr->ring));
HDfprintf(stdout, " %2d %-32s ", (int)(entry_ptr->type->id), (entry_ptr->type->name));
HDfprintf(stdout, " %d", (int)(entry_ptr->is_dirty));
HDfprintf(stdout, "\n");
i++;
entry_ptr = entry_ptr->next;
} /* end while */
HDfprintf(stdout, "--------------------------------------------------------------------------------------"
"--------------------------\n");
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5C_dump_cache_LRU() */
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
*
* Function: H5C_dump_cache_skip_list
*
* Purpose: Debugging routine that prints a summary of the contents of
* the skip list used by the metadata cache metadata cache to
* maintain an address sorted list of dirty entries.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
* 11/15/14
*
* Changes: Updated function for the slist_enabled field in H5C_t.
* Recall that to minimize slist overhead, the slist is
* empty and not maintained if cache_ptr->slist_enabled is
* false.
* JRM -- 5/6/20
*
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
herr_t
H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn)
{
herr_t ret_value = SUCCEED; /* Return value */
int i;
H5C_cache_entry_t *entry_ptr = NULL;
H5SL_node_t * node_ptr = NULL;
FUNC_ENTER_NOAPI_NOERR
HDassert(cache_ptr != NULL);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(calling_fcn != NULL);
HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn);
HDfprintf(stdout, " slist %s.\n", cache_ptr->slist_enabled ? "enabled" : "disabled");
HDfprintf(stdout, " slist len = %" PRIu32 ".\n", cache_ptr->slist_len);
HDfprintf(stdout, " slist size = %zu.\n", cache_ptr->slist_size);
if (cache_ptr->slist_len > 0) {
/* If we get this far, all entries in the cache are listed in the
* skip list -- scan the skip list generating the desired output.
*/
HDfprintf(stdout, "Num: Addr: Len: Prot/Pind: Dirty: Type:\n");
i = 0;
node_ptr = H5SL_first(cache_ptr->slist_ptr);
if (node_ptr != NULL) {
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
}
else {
entry_ptr = NULL;
}
while (entry_ptr != NULL) {
HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDfprintf(stdout, "%s%d 0x%016llx %4lld %d/%d %d %s\n", cache_ptr->prefix, i,
(long long)(entry_ptr->addr), (long long)(entry_ptr->size),
(int)(entry_ptr->is_protected), (int)(entry_ptr->is_pinned), (int)(entry_ptr->is_dirty),
entry_ptr->type->name);
HDfprintf(stdout, " node_ptr = %p, item = %p\n", (void *)node_ptr, H5SL_item(node_ptr));
/* increment node_ptr before we delete its target */
node_ptr = H5SL_next(node_ptr);
if (node_ptr != NULL) {
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
}
else {
entry_ptr = NULL;
}
i++;
} /* end while */
} /* end if */
HDfprintf(stdout, "\n\n");
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_dump_cache_skip_list() */
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
* Function: H5C_set_prefix
*
* Purpose: Set the values of the prefix field of H5C_t. This
* filed is used to label some debugging output.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
* 1/20/06
*
*-------------------------------------------------------------------------
*/
herr_t
H5C_set_prefix(H5C_t *cache_ptr, char *prefix)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) || (prefix == NULL) ||
(HDstrlen(prefix) >= H5C__PREFIX_LEN))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry")
HDstrncpy(&(cache_ptr->prefix[0]), prefix, (size_t)(H5C__PREFIX_LEN));
cache_ptr->prefix[H5C__PREFIX_LEN - 1] = '\0';
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_set_prefix() */
/*-------------------------------------------------------------------------
* Function: H5C_stats
*
* Purpose: Prints statistics about the cache.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
* 6/2/04
*
*-------------------------------------------------------------------------
*/
herr_t
H5C_stats(H5C_t *cache_ptr, const char *cache_name,
hbool_t
#if !H5C_COLLECT_CACHE_STATS
H5_ATTR_UNUSED
#endif /* H5C_COLLECT_CACHE_STATS */
display_detailed_stats)
{
#if H5C_COLLECT_CACHE_STATS
int i;
int64_t total_hits = 0;
int64_t total_misses = 0;
int64_t total_write_protects = 0;
int64_t total_read_protects = 0;
int64_t max_read_protects = 0;
int64_t total_insertions = 0;
int64_t total_pinned_insertions = 0;
int64_t total_clears = 0;
int64_t total_flushes = 0;
int64_t total_evictions = 0;
int64_t total_take_ownerships = 0;
int64_t total_moves = 0;
int64_t total_entry_flush_moves = 0;
int64_t total_cache_flush_moves = 0;
int64_t total_size_increases = 0;
int64_t total_size_decreases = 0;
int64_t total_entry_flush_size_changes = 0;
int64_t total_cache_flush_size_changes = 0;
int64_t total_pins = 0;
int64_t total_unpins = 0;
int64_t total_dirty_pins = 0;
int64_t total_pinned_flushes = 0;
int64_t total_pinned_clears = 0;
int32_t aggregate_max_accesses = 0;
int32_t aggregate_min_accesses = 1000000;
int32_t aggregate_max_clears = 0;
int32_t aggregate_max_flushes = 0;
size_t aggregate_max_size = 0;
int32_t aggregate_max_pins = 0;
double hit_rate;
double prefetch_use_rate;
double average_successful_search_depth = 0.0;
double average_failed_search_depth = 0.0;
double average_entries_skipped_per_calls_to_msic = 0.0;
double average_dirty_pf_entries_skipped_per_call_to_msic = 0.0;
double average_entries_scanned_per_calls_to_msic = 0.0;
#endif /* H5C_COLLECT_CACHE_STATS */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
/* This would normally be an assert, but we need to use an HGOTO_ERROR
* call to shut up the compiler.
*/
if ((NULL == cache_ptr) || (cache_ptr->magic != H5C__H5C_T_MAGIC) || (NULL == cache_name))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or cache_name")
#if H5C_COLLECT_CACHE_STATS
for (i = 0; i <= cache_ptr->max_type_id; i++) {
total_hits += cache_ptr->hits[i];
total_misses += cache_ptr->misses[i];
total_write_protects += cache_ptr->write_protects[i];
total_read_protects += cache_ptr->read_protects[i];
if (max_read_protects < cache_ptr->max_read_protects[i])
max_read_protects = cache_ptr->max_read_protects[i];
total_insertions += cache_ptr->insertions[i];
total_pinned_insertions += cache_ptr->pinned_insertions[i];
total_clears += cache_ptr->clears[i];
total_flushes += cache_ptr->flushes[i];
total_evictions += cache_ptr->evictions[i];
total_take_ownerships += cache_ptr->take_ownerships[i];
total_moves += cache_ptr->moves[i];
total_entry_flush_moves += cache_ptr->entry_flush_moves[i];
total_cache_flush_moves += cache_ptr->cache_flush_moves[i];
total_size_increases += cache_ptr->size_increases[i];
total_size_decreases += cache_ptr->size_decreases[i];
total_entry_flush_size_changes += cache_ptr->entry_flush_size_changes[i];
total_cache_flush_size_changes += cache_ptr->cache_flush_size_changes[i];
total_pins += cache_ptr->pins[i];
total_unpins += cache_ptr->unpins[i];
total_dirty_pins += cache_ptr->dirty_pins[i];
total_pinned_flushes += cache_ptr->pinned_flushes[i];
total_pinned_clears += cache_ptr->pinned_clears[i];
#if H5C_COLLECT_CACHE_ENTRY_STATS
if (aggregate_max_accesses < cache_ptr->max_accesses[i])
aggregate_max_accesses = cache_ptr->max_accesses[i];
if (aggregate_min_accesses > aggregate_max_accesses)
aggregate_min_accesses = aggregate_max_accesses;
if (aggregate_min_accesses > cache_ptr->min_accesses[i])
aggregate_min_accesses = cache_ptr->min_accesses[i];
if (aggregate_max_clears < cache_ptr->max_clears[i])
aggregate_max_clears = cache_ptr->max_clears[i];
if (aggregate_max_flushes < cache_ptr->max_flushes[i])
aggregate_max_flushes = cache_ptr->max_flushes[i];
if (aggregate_max_size < cache_ptr->max_size[i])
aggregate_max_size = cache_ptr->max_size[i];
if (aggregate_max_pins < cache_ptr->max_pins[i])
aggregate_max_pins = cache_ptr->max_pins[i];
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
} /* end for */
if ((total_hits > 0) || (total_misses > 0))
hit_rate = 100.0 * ((double)(total_hits)) / ((double)(total_hits + total_misses));
else
hit_rate = 0.0;
if (cache_ptr->successful_ht_searches > 0)
average_successful_search_depth = ((double)(cache_ptr->total_successful_ht_search_depth)) /
((double)(cache_ptr->successful_ht_searches));
if (cache_ptr->failed_ht_searches > 0)
average_failed_search_depth =
((double)(cache_ptr->total_failed_ht_search_depth)) / ((double)(cache_ptr->failed_ht_searches));
HDfprintf(stdout, "\n%sH5C: cache statistics for %s\n", cache_ptr->prefix, cache_name);
HDfprintf(stdout, "\n");
HDfprintf(stdout, "%s hash table insertion / deletions = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->total_ht_insertions), (long)(cache_ptr->total_ht_deletions));
HDfprintf(stdout, "%s HT successful / failed searches = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->successful_ht_searches), (long)(cache_ptr->failed_ht_searches));
HDfprintf(stdout, "%s Av. HT suc / failed search depth = %f / %f\n", cache_ptr->prefix,
average_successful_search_depth, average_failed_search_depth);
HDfprintf(stdout, "%s current (max) index size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix,
(long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size),
(unsigned long)(cache_ptr->index_len), (unsigned long)(cache_ptr->max_index_len));
HDfprintf(stdout, "%s current (max) clean/dirty idx size = %ld (%ld) / %ld (%ld)\n", cache_ptr->prefix,
(long)(cache_ptr->clean_index_size), (long)(cache_ptr->max_clean_index_size),
(long)(cache_ptr->dirty_index_size), (long)(cache_ptr->max_dirty_index_size));
HDfprintf(stdout, "%s current (max) slist size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix,
(long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size),
(unsigned long)(cache_ptr->slist_len), (unsigned long)(cache_ptr->max_slist_len));
HDfprintf(stdout, "%s current (max) PL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix,
(long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), (unsigned long)(cache_ptr->pl_len),
(unsigned long)(cache_ptr->max_pl_len));
HDfprintf(stdout, "%s current (max) PEL size / length = %ld (%ld) / %lu (%lu)\n", cache_ptr->prefix,
(long)(cache_ptr->pel_size), (long)(cache_ptr->max_pel_size),
(unsigned long)(cache_ptr->pel_len), (unsigned long)(cache_ptr->max_pel_len));
HDfprintf(stdout, "%s current LRU list size / length = %ld / %lu\n", cache_ptr->prefix,
(long)(cache_ptr->LRU_list_size), (unsigned long)(cache_ptr->LRU_list_len));
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
HDfprintf(stdout, "%s current clean LRU size / length = %ld / %lu\n", cache_ptr->prefix,
(long)(cache_ptr->cLRU_list_size), (unsigned long)(cache_ptr->cLRU_list_len));
HDfprintf(stdout, "%s current dirty LRU size / length = %ld / %lu\n", cache_ptr->prefix,
(long)(cache_ptr->dLRU_list_size), (unsigned long)(cache_ptr->dLRU_list_len));
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
HDfprintf(stdout, "%s Total hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix,
(long)total_hits, (long)total_misses, hit_rate);
HDfprintf(stdout, "%s Total write / read (max) protects = %ld / %ld (%ld)\n", cache_ptr->prefix,
(long)total_write_protects, (long)total_read_protects, (long)max_read_protects);
HDfprintf(stdout, "%s Total clears / flushes = %ld / %ld\n", cache_ptr->prefix,
(long)total_clears, (long)total_flushes);
HDfprintf(stdout, "%s Total evictions / take ownerships = %ld / %ld\n", cache_ptr->prefix,
(long)total_evictions, (long)total_take_ownerships);
HDfprintf(stdout, "%s Total insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix,
(long)total_insertions, (long)total_pinned_insertions, (long)total_moves);
HDfprintf(stdout, "%s Total entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix,
(long)total_entry_flush_moves, (long)total_cache_flush_moves);
HDfprintf(stdout, "%s Total entry size incrs / decrs = %ld / %ld\n", cache_ptr->prefix,
(long)total_size_increases, (long)total_size_decreases);
HDfprintf(stdout, "%s Ttl entry/cache flush size changes = %ld / %ld\n", cache_ptr->prefix,
(long)total_entry_flush_size_changes, (long)total_cache_flush_size_changes);
HDfprintf(stdout, "%s Total entry pins (dirty) / unpins = %ld (%ld) / %ld\n", cache_ptr->prefix,
(long)total_pins, (long)total_dirty_pins, (long)total_unpins);
HDfprintf(stdout, "%s Total pinned flushes / clears = %ld / %ld\n", cache_ptr->prefix,
(long)total_pinned_flushes, (long)total_pinned_clears);
HDfprintf(stdout, "%s MSIC: (make space in cache) calls = %lld\n", cache_ptr->prefix,
(long long)(cache_ptr->calls_to_msic));
if (cache_ptr->calls_to_msic > 0)
average_entries_skipped_per_calls_to_msic =
(((double)(cache_ptr->total_entries_skipped_in_msic)) / ((double)(cache_ptr->calls_to_msic)));
HDfprintf(stdout, "%s MSIC: Average/max entries skipped = %lf / %ld\n", cache_ptr->prefix,
(double)average_entries_skipped_per_calls_to_msic,
(long)(cache_ptr->max_entries_skipped_in_msic));
if (cache_ptr->calls_to_msic > 0)
average_dirty_pf_entries_skipped_per_call_to_msic =
(((double)(cache_ptr->total_dirty_pf_entries_skipped_in_msic)) /
((double)(cache_ptr->calls_to_msic)));
HDfprintf(stdout, "%s MSIC: Average/max dirty pf entries skipped = %lf / %ld\n", cache_ptr->prefix,
average_dirty_pf_entries_skipped_per_call_to_msic,
(long)(cache_ptr->max_dirty_pf_entries_skipped_in_msic));
if (cache_ptr->calls_to_msic > 0)
average_entries_scanned_per_calls_to_msic =
(((double)(cache_ptr->total_entries_scanned_in_msic)) / ((double)(cache_ptr->calls_to_msic)));
HDfprintf(stdout, "%s MSIC: Average/max entries scanned = %lf / %ld\n", cache_ptr->prefix,
(double)average_entries_scanned_per_calls_to_msic,
(long)(cache_ptr->max_entries_scanned_in_msic));
HDfprintf(stdout, "%s MSIC: Scanned to make space(evict) = %lld\n", cache_ptr->prefix,
(long long)(cache_ptr->entries_scanned_to_make_space));
HDfprintf(
stdout, "%s MSIC: Scanned to satisfy min_clean = %lld\n", cache_ptr->prefix,
(long long)(cache_ptr->total_entries_scanned_in_msic - cache_ptr->entries_scanned_to_make_space));
HDfprintf(stdout, "%s slist/LRU/index scan restarts = %lld / %lld / %lld.\n", cache_ptr->prefix,
(long long)(cache_ptr->slist_scan_restarts), (long long)(cache_ptr->LRU_scan_restarts),
(long long)(cache_ptr->index_scan_restarts));
HDfprintf(stdout, "%s cache image creations/reads/loads/size = %d / %d /%d / %" PRIuHSIZE "\n",
cache_ptr->prefix, cache_ptr->images_created, cache_ptr->images_read, cache_ptr->images_loaded,
cache_ptr->last_image_size);
HDfprintf(stdout, "%s prefetches / dirty prefetches = %lld / %lld\n", cache_ptr->prefix,
(long long)(cache_ptr->prefetches), (long long)(cache_ptr->dirty_prefetches));
HDfprintf(stdout, "%s prefetch hits/flushes/evictions = %lld / %lld / %lld\n", cache_ptr->prefix,
(long long)(cache_ptr->prefetch_hits),
(long long)(cache_ptr->flushes[H5AC_PREFETCHED_ENTRY_ID]),
(long long)(cache_ptr->evictions[H5AC_PREFETCHED_ENTRY_ID]));
if (cache_ptr->prefetches > 0)
prefetch_use_rate = 100.0 * ((double)(cache_ptr->prefetch_hits)) / ((double)(cache_ptr->prefetches));
else
prefetch_use_rate = 0.0;
HDfprintf(stdout, "%s prefetched entry use rate = %lf\n", cache_ptr->prefix, prefetch_use_rate);
#if H5C_COLLECT_CACHE_ENTRY_STATS
HDfprintf(stdout, "%s aggregate max / min accesses = %d / %d\n", cache_ptr->prefix,
(int)aggregate_max_accesses, (int)aggregate_min_accesses);
HDfprintf(stdout, "%s aggregate max_clears / max_flushes = %d / %d\n", cache_ptr->prefix,
(int)aggregate_max_clears, (int)aggregate_max_flushes);
HDfprintf(stdout, "%s aggregate max_size / max_pins = %d / %d\n", cache_ptr->prefix,
(int)aggregate_max_size, (int)aggregate_max_pins);
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
if (display_detailed_stats) {
for (i = 0; i <= cache_ptr->max_type_id; i++) {
HDfprintf(stdout, "\n");
HDfprintf(stdout, "%s Stats on %s:\n", cache_ptr->prefix,
((cache_ptr->class_table_ptr))[i]->name);
if ((cache_ptr->hits[i] > 0) || (cache_ptr->misses[i] > 0))
hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) /
((double)(cache_ptr->hits[i] + cache_ptr->misses[i]));
else
hit_rate = 0.0;
HDfprintf(stdout, "%s hits / misses / hit_rate = %ld / %ld / %f\n", cache_ptr->prefix,
(long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate);
HDfprintf(stdout, "%s write / read (max) protects = %ld / %ld (%d)\n", cache_ptr->prefix,
(long)(cache_ptr->write_protects[i]), (long)(cache_ptr->read_protects[i]),
(int)(cache_ptr->max_read_protects[i]));
HDfprintf(stdout, "%s clears / flushes = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i]));
HDfprintf(stdout, "%s evictions / take ownerships = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->evictions[i]), (long)(cache_ptr->take_ownerships[i]));
HDfprintf(stdout, "%s insertions(pinned) / moves = %ld(%ld) / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->insertions[i]), (long)(cache_ptr->pinned_insertions[i]),
(long)(cache_ptr->moves[i]));
HDfprintf(stdout, "%s entry / cache flush moves = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->entry_flush_moves[i]), (long)(cache_ptr->cache_flush_moves[i]));
HDfprintf(stdout, "%s size increases / decreases = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->size_increases[i]), (long)(cache_ptr->size_decreases[i]));
HDfprintf(stdout, "%s entry/cache flush size changes = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->entry_flush_size_changes[i]),
(long)(cache_ptr->cache_flush_size_changes[i]));
HDfprintf(stdout, "%s entry pins / unpins = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->pins[i]), (long)(cache_ptr->unpins[i]));
HDfprintf(stdout, "%s entry dirty pins/pin'd flushes = %ld / %ld\n", cache_ptr->prefix,
(long)(cache_ptr->dirty_pins[i]), (long)(cache_ptr->pinned_flushes[i]));
#if H5C_COLLECT_CACHE_ENTRY_STATS
HDfprintf(stdout, "%s entry max / min accesses = %d / %d\n", cache_ptr->prefix,
cache_ptr->max_accesses[i], cache_ptr->min_accesses[i]);
HDfprintf(stdout, "%s entry max_clears / max_flushes = %d / %d\n", cache_ptr->prefix,
cache_ptr->max_clears[i], cache_ptr->max_flushes[i]);
HDfprintf(stdout, "%s entry max_size / max_pins = %d / %d\n", cache_ptr->prefix,
(int)(cache_ptr->max_size[i]), (int)(cache_ptr->max_pins[i]));
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
} /* end for */
} /* end if */
HDfprintf(stdout, "\n");
#endif /* H5C_COLLECT_CACHE_STATS */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_stats() */
/*-------------------------------------------------------------------------
*
* Function: H5C_stats__reset
*
* Purpose: Reset the stats fields to their initial values.
*
* Return: void
*
* Programmer: John Mainzer, 4/28/04
*
*-------------------------------------------------------------------------
*/
void
#ifndef NDEBUG
H5C_stats__reset(H5C_t *cache_ptr)
#else /* NDEBUG */
#if H5C_COLLECT_CACHE_STATS
H5C_stats__reset(H5C_t *cache_ptr)
#else /* H5C_COLLECT_CACHE_STATS */
H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr)
#endif /* H5C_COLLECT_CACHE_STATS */
#endif /* NDEBUG */
{
#if H5C_COLLECT_CACHE_STATS
int i;
#endif /* H5C_COLLECT_CACHE_STATS */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
#if H5C_COLLECT_CACHE_STATS
for (i = 0; i <= cache_ptr->max_type_id; i++) {
cache_ptr->hits[i] = 0;
cache_ptr->misses[i] = 0;
cache_ptr->write_protects[i] = 0;
cache_ptr->read_protects[i] = 0;
cache_ptr->max_read_protects[i] = 0;
cache_ptr->insertions[i] = 0;
cache_ptr->pinned_insertions[i] = 0;
cache_ptr->clears[i] = 0;
cache_ptr->flushes[i] = 0;
cache_ptr->evictions[i] = 0;
cache_ptr->take_ownerships[i] = 0;
cache_ptr->moves[i] = 0;
cache_ptr->entry_flush_moves[i] = 0;
cache_ptr->cache_flush_moves[i] = 0;
cache_ptr->pins[i] = 0;
cache_ptr->unpins[i] = 0;
cache_ptr->dirty_pins[i] = 0;
cache_ptr->pinned_flushes[i] = 0;
cache_ptr->pinned_clears[i] = 0;
cache_ptr->size_increases[i] = 0;
cache_ptr->size_decreases[i] = 0;
cache_ptr->entry_flush_size_changes[i] = 0;
cache_ptr->cache_flush_size_changes[i] = 0;
} /* end for */
cache_ptr->total_ht_insertions = 0;
cache_ptr->total_ht_deletions = 0;
cache_ptr->successful_ht_searches = 0;
cache_ptr->total_successful_ht_search_depth = 0;
cache_ptr->failed_ht_searches = 0;
cache_ptr->total_failed_ht_search_depth = 0;
cache_ptr->max_index_len = 0;
cache_ptr->max_index_size = (size_t)0;
cache_ptr->max_clean_index_size = (size_t)0;
cache_ptr->max_dirty_index_size = (size_t)0;
cache_ptr->max_slist_len = 0;
cache_ptr->max_slist_size = (size_t)0;
cache_ptr->max_pl_len = 0;
cache_ptr->max_pl_size = (size_t)0;
cache_ptr->max_pel_len = 0;
cache_ptr->max_pel_size = (size_t)0;
cache_ptr->calls_to_msic = 0;
cache_ptr->total_entries_skipped_in_msic = 0;
cache_ptr->total_dirty_pf_entries_skipped_in_msic = 0;
cache_ptr->total_entries_scanned_in_msic = 0;
cache_ptr->max_entries_skipped_in_msic = 0;
cache_ptr->max_dirty_pf_entries_skipped_in_msic = 0;
cache_ptr->max_entries_scanned_in_msic = 0;
cache_ptr->entries_scanned_to_make_space = 0;
cache_ptr->slist_scan_restarts = 0;
cache_ptr->LRU_scan_restarts = 0;
cache_ptr->index_scan_restarts = 0;
cache_ptr->images_created = 0;
cache_ptr->images_read = 0;
cache_ptr->images_loaded = 0;
cache_ptr->last_image_size = (hsize_t)0;
cache_ptr->prefetches = 0;
cache_ptr->dirty_prefetches = 0;
cache_ptr->prefetch_hits = 0;
#if H5C_COLLECT_CACHE_ENTRY_STATS
for (i = 0; i <= cache_ptr->max_type_id; i++) {
cache_ptr->max_accesses[i] = 0;
cache_ptr->min_accesses[i] = 1000000;
cache_ptr->max_clears[i] = 0;
cache_ptr->max_flushes[i] = 0;
cache_ptr->max_size[i] = (size_t)0;
cache_ptr->max_pins[i] = 0;
} /* end for */
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
#endif /* H5C_COLLECT_CACHE_STATS */
} /* H5C_stats__reset() */
/*-------------------------------------------------------------------------
* Function: H5C_flush_dependency_exists()
*
* Purpose: Test to see if a flush dependency relationship exists
* between the supplied parent and child. Both parties
* are indicated by addresses so as to avoid the necessity
* of protect / unprotect calls prior to this call.
*
* If either the parent or the child is not in the metadata
* cache, the function sets *fd_exists_ptr to FALSE.
*
* If both are in the cache, the childs list of parents is
* searched for the proposed parent. If the proposed parent
* is found in the childs parent list, the function sets
* *fd_exists_ptr to TRUE. In all other non-error cases,
* the function sets *fd_exists_ptr FALSE.
*
* Return: SUCCEED on success/FAIL on failure. Note that
* *fd_exists_ptr is undefined on failure.
*
* Programmer: John Mainzer
* 9/28/16
*
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
herr_t
H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, hbool_t *fd_exists_ptr)
{
hbool_t fd_exists = FALSE; /* whether flush dependency exists */
H5C_cache_entry_t *parent_ptr; /* Ptr to parent entry */
H5C_cache_entry_t *child_ptr; /* Ptr to child entry */
hbool_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI(NULL)
/* Sanity checks */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(H5F_addr_defined(parent_addr));
HDassert(H5F_addr_defined(child_addr));
HDassert(fd_exists_ptr);
H5C__SEARCH_INDEX(cache_ptr, parent_addr, parent_ptr, FAIL)
H5C__SEARCH_INDEX(cache_ptr, child_addr, child_ptr, FAIL)
if (parent_ptr && child_ptr) {
HDassert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert(child_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
if (child_ptr->flush_dep_nparents > 0) {
unsigned u; /* Local index variable */
HDassert(child_ptr->flush_dep_parent);
HDassert(child_ptr->flush_dep_parent_nalloc >= child_ptr->flush_dep_nparents);
for (u = 0; u < child_ptr->flush_dep_nparents; u++) {
if (child_ptr->flush_dep_parent[u] == parent_ptr) {
fd_exists = TRUE;
HDassert(parent_ptr->flush_dep_nchildren > 0);
break;
} /* end if */
} /* end for */
} /* end if */
} /* end if */
*fd_exists_ptr = fd_exists;
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_flush_dependency_exists() */
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
*
* Function: H5C_validate_index_list
*
* Purpose: Debugging function that scans the index list for errors.
*
* If an error is detected, the function generates a
* diagnostic and returns FAIL. If no error is detected,
* the function returns SUCCEED.
*
* Return: FAIL if error is detected, SUCCEED otherwise.
*
* Programmer: John Mainzer, 9/16/16
*
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
herr_t
H5C_validate_index_list(H5C_t *cache_ptr)
{
H5C_cache_entry_t *entry_ptr = NULL;
uint32_t len = 0;
int32_t index_ring_len[H5C_RING_NTYPES];
size_t size = 0;
size_t clean_size = 0;
size_t dirty_size = 0;
size_t index_ring_size[H5C_RING_NTYPES];
size_t clean_index_ring_size[H5C_RING_NTYPES];
size_t dirty_index_ring_size[H5C_RING_NTYPES];
int i;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Sanity checks */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
for (i = 0; i < H5C_RING_NTYPES; i++) {
index_ring_len[i] = 0;
index_ring_size[i] = 0;
clean_index_ring_size[i] = 0;
dirty_index_ring_size[i] = 0;
} /* end if */
if (((cache_ptr->il_head == NULL) || (cache_ptr->il_tail == NULL)) &&
(cache_ptr->il_head != cache_ptr->il_tail))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer validation failed")
if ((cache_ptr->index_len == 1) &&
((cache_ptr->il_head != cache_ptr->il_tail) || (cache_ptr->il_head == NULL) ||
(cache_ptr->il_head->size != cache_ptr->index_size)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer sanity checks failed")
if ((cache_ptr->index_len >= 1) &&
((cache_ptr->il_head == NULL) || (cache_ptr->il_head->il_prev != NULL) ||
(cache_ptr->il_tail == NULL) || (cache_ptr->il_tail->il_next != NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list length sanity checks failed")
entry_ptr = cache_ptr->il_head;
while (entry_ptr != NULL) {
if ((entry_ptr != cache_ptr->il_head) &&
((entry_ptr->il_prev == NULL) || (entry_ptr->il_prev->il_next != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid")
if ((entry_ptr != cache_ptr->il_tail) &&
((entry_ptr->il_next == NULL) || (entry_ptr->il_next->il_prev != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid")
HDassert(entry_ptr->ring > 0);
HDassert(entry_ptr->ring < H5C_RING_NTYPES);
len++;
index_ring_len[entry_ptr->ring] += 1;
size += entry_ptr->size;
index_ring_size[entry_ptr->ring] += entry_ptr->size;
if (entry_ptr->is_dirty) {
dirty_size += entry_ptr->size;
dirty_index_ring_size[entry_ptr->ring] += entry_ptr->size;
} /* end if */
else {
clean_size += entry_ptr->size;
clean_index_ring_size[entry_ptr->ring] += entry_ptr->size;
} /* end else */
entry_ptr = entry_ptr->il_next;
} /* end while */
if ((cache_ptr->index_len != len) || (cache_ptr->il_len != len) || (cache_ptr->index_size != size) ||
(cache_ptr->il_size != size) || (cache_ptr->clean_index_size != clean_size) ||
(cache_ptr->dirty_index_size != dirty_size) || (clean_size + dirty_size != size))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid")
size = 0;
clean_size = 0;
dirty_size = 0;
for (i = 0; i < H5C_RING_NTYPES; i++) {
size += clean_index_ring_size[i] + dirty_index_ring_size[i];
clean_size += clean_index_ring_size[i];
dirty_size += dirty_index_ring_size[i];
} /* end for */
if ((cache_ptr->index_size != size) || (cache_ptr->clean_index_size != clean_size) ||
(cache_ptr->dirty_index_size != dirty_size))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid")
done:
if (ret_value != SUCCEED)
HDassert(0);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_validate_index_list() */
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
*
* Function: H5C_get_entry_ptr_from_addr()
*
* Purpose: Debugging function that attempts to look up an entry in the
* cache by its file address, and if found, returns a pointer
* to the entry in *entry_ptr_ptr. If the entry is not in the
* cache, *entry_ptr_ptr is set to NULL.
*
* WARNING: This call should be used only in debugging
* routines, and it should be avoided when
* possible.
*
* Further, if we ever multi-thread the cache,
* this routine will have to be either discarded
* or heavily re-worked.
*
* Finally, keep in mind that the entry whose
* pointer is obtained in this fashion may not
* be in a stable state.
*
* Note that this function is only defined if NDEBUG
* is not defined.
*
* As heavy use of this function is almost certainly a
* bad idea, the metadata cache tracks the number of
* successful calls to this function, and (if
* H5C_DO_SANITY_CHECKS is defined) displays any
* non-zero count on cache shutdown.
*
* Return: FAIL if error is detected, SUCCEED otherwise.
*
* Programmer: John Mainzer, 5/30/14
*
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
herr_t
H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr)
{
H5C_cache_entry_t *entry_ptr = NULL;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(H5F_addr_defined(addr));
HDassert(entry_ptr_ptr);
H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL)
if (entry_ptr == NULL)
/* the entry doesn't exist in the cache -- report this
* and quit.
*/
*entry_ptr_ptr = NULL;
else {
*entry_ptr_ptr = entry_ptr;
/* increment call counter */
(cache_ptr->get_entry_ptr_from_addr_counter)++;
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_get_entry_ptr_from_addr() */
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
* Function: H5C_get_serialization_in_progress
*
* Purpose: Return the current value of
* cache_ptr->serialization_in_progress.
*
* Return: Current value of cache_ptr->serialization_in_progress.
*
* Programmer: John Mainzer
* 8/24/15
*
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
hbool_t
H5C_get_serialization_in_progress(const H5C_t *cache_ptr)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
FUNC_LEAVE_NOAPI(cache_ptr->serialization_in_progress)
} /* H5C_get_serialization_in_progress() */
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
*
* Function: H5C_cache_is_clean()
*
* Purpose: Debugging function that verifies that all rings in the
* metadata cache are clean from the outermost ring, inwards
* to the inner ring specified.
*
* Returns TRUE if all specified rings are clean, and FALSE
* if not. Throws an assertion failure on error.
*
* Return: TRUE if the indicated ring(s) are clean, and FALSE otherwise.
*
* Programmer: John Mainzer, 6/18/16
*
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
hbool_t
H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring)
{
H5C_ring_t ring = H5C_RING_USER;
hbool_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity checks */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(inner_ring >= H5C_RING_USER);
HDassert(inner_ring <= H5C_RING_SB);
while (ring <= inner_ring) {
if (cache_ptr->dirty_index_ring_size[ring] > 0)
HGOTO_DONE(FALSE)
ring++;
} /* end while */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_cache_is_clean() */
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
*
* Function: H5C_verify_entry_type()
*
* Purpose: Debugging function that attempts to look up an entry in the
* cache by its file address, and if found, test to see if its
* type field contains the expted value.
*
* If the specified entry is in cache, *in_cache_ptr is set
* to TRUE, and *type_ok_ptr is set to TRUE or FALSE depending
* on whether the entries type field matches the expected_type
* parameter.
*
* If the target entry is not in cache, *in_cache_ptr is
* set to FALSE, and *type_ok_ptr is undefined.
*
* Note that this function is only defined if NDEBUG
* is not defined.
*
* Return: FAIL if error is detected, SUCCEED otherwise.
*
* Programmer: John Mainzer, 5/30/14
*
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
herr_t
H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, hbool_t *in_cache_ptr,
hbool_t *type_ok_ptr)
{
H5C_cache_entry_t *entry_ptr = NULL;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity checks */
HDassert(cache_ptr);
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert(H5F_addr_defined(addr));
HDassert(expected_type);
HDassert(in_cache_ptr);
HDassert(type_ok_ptr);
H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL)
if (entry_ptr == NULL)
/* the entry doesn't exist in the cache -- report this
* and quit.
*/
*in_cache_ptr = FALSE;
else {
*in_cache_ptr = TRUE;
if (entry_ptr->prefetched)
*type_ok_ptr = (expected_type->id == entry_ptr->prefetch_type_id);
else
*type_ok_ptr = (expected_type == entry_ptr->type);
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C_verify_entry_type() */
#endif /* NDEBUG */
|
1003faeb51e9e3b161586ab092dcdc99ba8a2d51
|
4b1b112e794fe657f2050b30c2333fc5fae1a495
|
/src/commu.c
|
5b558727c0cdfc312b734ab207778e16dcb15d76
|
[] |
no_license
|
hbsyzbh/in.YJ.FCT
|
61b92e17a9b23534af2355db34b981c1043e74a9
|
5ff648343c69c98c696cdb7fead3714dea9bd06e
|
refs/heads/master
| 2023-01-04T22:28:22.383100 | 2020-11-05T03:23:56 | 2020-11-05T03:23:56 | 310,179,912 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 6,502 |
c
|
commu.c
|
/*
* commu.c
*
* Created on: 2020年11月3日
* Author: Administrator
*/
/*
#include "iodefine.h"
#include "r_cg_macrodriver.h"
#include "r_cg_serial.h"
#include "r_cg_userdefine.h"
#include "r_cg_rtc.h"
#include "string.h"
*/
#include "r_smc_entry.h"
#include "maxdoneYJBios.h"
unsigned char g_i2c_done = 0;
unsigned char g_u2_sendend = 0;
unsigned char debug = 0;
static void R_UART2_Receive(unsigned char * revBuff, unsigned char len)
{
R_UART_Serial_Receive(revBuff, len);
}
static void R_UART2_Send(unsigned char * const tx_buf, unsigned char tx_num)
{
R_UART_Serial_Send(tx_buf, tx_num);
}
void UART2_Sendstr(char *str)
{
if(str == 0) return;
if(! debug) return;
g_u2_sendend = 0;
R_UART2_Send(str, strlen(str));
for(; g_u2_sendend == 0;)
{
;//R_WDT_Restart();
}
}
typedef enum {
Cmd_getType,
Cmd_syncRTC,
Cmd_getRTC,
Cmd_testSPIFlash,
Cmd_testI2CPort,
Cmd_testSPIPort = 5,
Cmd_testU3Out,
Cmd_testADC,
Cmd_testLED,
Cmd_testLight,
Cmd_testStatus = 10,
Cmd_FCTVer = 0xF2,
Cmd_enterRFPingPong = 0xF3,
Cmd_initI2CPort = 0xF4
} CMD_TYPE;
#define ACK_HEAD (0x4F)
#define ACK_CMD_POS (1)
#define ACK_LEN_POS (2)
#define ACK_DATA_POS (3)
typedef enum {
Uart_StartwaitHead,
Uart_waittigHead,
Uart_revHeadStartwaitlen,
Uart_Waittinglen,
Uart_revlenStartwaitData,
Uart_waittingData,
Uart_analysisData
} UART_STATE;
UART_STATE UartState;
unsigned char cmd = 0;
unsigned char datalen = 0;
unsigned char revBuff[256] = {0};
static void startWaitForNewCmd()
{
UartState = 0;
}
static char isCmdDatalenValied()
{
switch(cmd) {
case Cmd_syncRTC:
return datalen == 6;
break;
case Cmd_testLED:
case Cmd_testU3Out:
case Cmd_testLight:
case Cmd_testADC:
return datalen == 1;
break;
default:
return datalen == 0;
break;
}
return 0;
}
const unsigned char FCTVerMajor = 0x00;
const unsigned char FCTVerSub = 0x02;
const unsigned char notsupport[] = {0x40, 0, 0};
const unsigned char hardwareType[9] = {ACK_HEAD, 0, 6, 2, 0, 1, 2, 4, 9};
unsigned char ackbuff[16] = {ACK_HEAD, 0};
static void fillRTCRespBuf(rtc_calendarcounter_value_t *p)
{
ackbuff[ACK_DATA_POS+0] = p->ryrcnt ;
ackbuff[ACK_DATA_POS+1] = p->rmoncnt ;
ackbuff[ACK_DATA_POS+2] = p->rdaycnt ;
ackbuff[ACK_DATA_POS+3] = p->rhrcnt ;
ackbuff[ACK_DATA_POS+4] = p->rmincnt ;
ackbuff[ACK_DATA_POS+5] = p->rseccnt ;
}
static void getRTCValueFormCmd(rtc_calendarcounter_value_t *p)
{
p->ryrcnt = revBuff[ACK_DATA_POS+0];
p->rmoncnt = revBuff[ACK_DATA_POS+1];
p->rdaycnt = revBuff[ACK_DATA_POS+2];
p->rhrcnt = revBuff[ACK_DATA_POS+3];
p->rmincnt = revBuff[ACK_DATA_POS+4];
p->rseccnt = revBuff[ACK_DATA_POS+5];
//uint8_t rwkcnt;
}
void SetLed(unsigned char v)
{
setD8 ((v & 0x01) == 0x01);
setD9 ((v & 0x02) == 0x02);
setD10((v & 0x04) == 0x04);
}
void SetLights(unsigned char v)
{
setRED ((v & 0x01) == 0x01);
setBLUE ((v & 0x02) == 0x02);
setGREEN((v & 0x04) == 0x04);
setLIGHT((v & 0x08) == 0x08);
}
static void analysisCmd()
{
rtc_calendarcounter_value_t counter_write_val;
ackbuff[ACK_CMD_POS] = cmd;
ackbuff[ACK_LEN_POS] = 1;
switch(cmd) {
case Cmd_getType:
R_UART2_Send(hardwareType, 9);
break;
case Cmd_syncRTC:
getRTCValueFormCmd(&counter_write_val);
R_Config_RTC_Restart(counter_write_val);
fillRTCRespBuf(&counter_write_val);
R_UART2_Send(ackbuff, ACK_DATA_POS+6);
break;
case Cmd_getRTC:
ackbuff[ACK_LEN_POS] = 6;
memset(&ackbuff[ACK_DATA_POS], 0, 6);
R_Config_RTC_Get_CalendarCounterValue(&counter_write_val);
fillRTCRespBuf(&counter_write_val);
R_UART2_Send(ackbuff, ACK_DATA_POS+6);
break;
case Cmd_testSPIFlash:
ackbuff[ACK_DATA_POS] = TestW25();
R_UART2_Send(ackbuff, ACK_DATA_POS + 1);
break;
case Cmd_testI2CPort:
ackbuff[ACK_DATA_POS] = TestE2P();
R_UART2_Send(ackbuff, ACK_DATA_POS + 1);
break;
case Cmd_testSPIPort:
ackbuff[ACK_DATA_POS] = TestSPI_ext();
R_UART2_Send(ackbuff, ACK_DATA_POS + 1);
break;
case Cmd_testU3Out:
SetU3(revBuff[ACK_DATA_POS]);
ackbuff[ACK_DATA_POS] = revBuff[ACK_DATA_POS];
R_UART2_Send(ackbuff, ACK_DATA_POS + 1);
break;
case Cmd_testADC:
{
unsigned char channel;
unsigned char interger, digit;
ackbuff[ACK_LEN_POS] = 3;
channel = ackbuff[ACK_DATA_POS + 0] = revBuff[ACK_DATA_POS];
getAdcVoltage(channel, &interger, &digit);
ackbuff[ACK_DATA_POS + 1] = interger;
ackbuff[ACK_DATA_POS + 2] = digit;
R_UART2_Send(ackbuff, ACK_DATA_POS + 3);
}
break;
case Cmd_testLED:
SetLed(revBuff[ACK_DATA_POS]);
ackbuff[ACK_DATA_POS] = revBuff[ACK_DATA_POS];
R_UART2_Send(ackbuff, ACK_DATA_POS + 1);
break;
case Cmd_testLight:
SetLights(revBuff[ACK_DATA_POS]);
ackbuff[ACK_DATA_POS] = revBuff[ACK_DATA_POS];
R_UART2_Send(ackbuff, ACK_DATA_POS + 1);
break;
case Cmd_testStatus:
ackbuff[ACK_LEN_POS] = 4;
ackbuff[ACK_DATA_POS + 0] = getFlow_noFlow();
ackbuff[ACK_DATA_POS + 1] = getHiStatus();
ackbuff[ACK_DATA_POS + 2] = getRegStatus();
ackbuff[ACK_DATA_POS + 3] = getDiagNoSti_in_flo();
R_UART2_Send(ackbuff, ACK_DATA_POS + 4);
break;
case Cmd_initI2CPort:
ackbuff[ACK_DATA_POS] = InitE2P();
R_UART2_Send(ackbuff, ACK_DATA_POS + 1);
break;
case Cmd_FCTVer:
ackbuff[ACK_LEN_POS] = 2;
ackbuff[ACK_DATA_POS + 0] = FCTVerMajor;
ackbuff[ACK_DATA_POS + 1] = FCTVerSub;
R_UART2_Send(ackbuff, ACK_DATA_POS + 2);
break;
default:
R_UART2_Send(notsupport, 3);
break;
}
startWaitForNewCmd();
}
void doUartTask()
{
switch(UartState)
{
case Uart_StartwaitHead:
R_UART2_Receive(revBuff, 1);
UartState++;
break;
case Uart_revHeadStartwaitlen:
R_UART2_Receive(&revBuff[1], 2);
UartState++;
break;
case Uart_revlenStartwaitData:
if(datalen > 0 ) {
R_UART2_Receive(&revBuff[3], datalen);
UartState++;
}
break;
case Uart_analysisData:
analysisCmd();
break;
default:
break;
}
}
void on_uart2_receiveend(void)
{
switch(UartState)
{
case Uart_waittigHead:
if((*revBuff) == 0xF4){
UartState = Uart_revHeadStartwaitlen;
} else {
UartState = Uart_StartwaitHead;
}
break;
break;
case Uart_Waittinglen:
cmd = revBuff[1];
datalen = revBuff[2];
if(isCmdDatalenValied())
{
if(datalen > 0) {
UartState = Uart_revlenStartwaitData;
} else {
UartState = Uart_analysisData;
}
} else {
UartState = Uart_StartwaitHead;
}
break;
case Uart_waittingData:
UartState = Uart_analysisData;
break;
}
}
|
a6b9e291bbd452a169da8697fbf48f2f45e659c8
|
501f780b4960262c6272515e2e9e70be68d0b1c7
|
/broadcast/udpClient.c
|
88d7c931eb9589db760f38e60376ebf6db803262
|
[] |
no_license
|
psyworld/networking
|
da525364ed45c4bffa88d3b06257b41e50d0fd75
|
e19e95549ce0140246b6dba8b27f0e9b8536689b
|
refs/heads/master
| 2021-04-06T01:48:32.289555 | 2018-05-02T16:24:36 | 2018-05-02T16:24:36 | 124,808,052 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 2,196 |
c
|
udpClient.c
|
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <ifaddrs.h>
#include <stdlib.h>
#include <string.h> //memset
#include <unistd.h>
#include <stdio.h>
#include <netdb.h>
#define BUF_SIZE 512
struct proto
{
unsigned short id;
short flag;
char buf[BUF_SIZE];
};
int inet_aton(const char *cp, struct in_addr * inp);
int main(int argc, char * argv[])
{
int s, i;
char buf[BUF_SIZE];
char message[BUF_SIZE];
unsigned optval = 1;
const int PORT = strtol(argv[1], NULL, 10);
struct sockaddr_in saddr_server = {AF_INET, htons(PORT)};
//create a socket
if ( (s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
{
perror("socket");
exit(1);
};
if (inet_aton("255.255.255.255", &saddr_server.sin_addr) == 0)
{
perror("inet_aton()");
exit(1);
};
if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(optval)) < 0)
{
perror("setsockopt");
exit(1);
};
unsigned short id = 0;
while(1)
{
struct sockaddr_in saddr_server_ = saddr_server;
socklen_t slen = sizeof(saddr_server);
struct proto data_req;
struct proto data_res;
data_req.id = id++;
fgets(data_req.buf, sizeof(data_req.buf), stdin);
data_req.buf[strlen(data_req.buf)-1] = '\0';
while(1)
{
//send the message
if (sendto(s, &data_req, sizeof(data_req) , 0 , (struct sockaddr *) &saddr_server_, slen)==-1)
{
perror("sendto()");
exit(1);
};
//try to receive some data
if (recvfrom(s, &data_res, sizeof(data_res), 0, (struct sockaddr *) &saddr_server_, &slen) == -1)
{
perror("recvfrom()");
exit(1);
};
if (data_res.id == data_req.id) break;
else
printf("\t Got message with wrond id\n");
}
printf(data_res.flag ? "YES\n" : "NO\n");
}
close(s);
return 0;
}
|
e526976452ce4a111b3b7b706c813bd8df1067b1
|
142c86e4ec14ad0eebc6b21f3afbcc75d2f48be7
|
/includes/bsq.h
|
e021dec363c68ed31c5e975fbe4e48cb3bf82646
|
[] |
no_license
|
lede-ser/bsq
|
ca9b23f22ca935960f1328df033a7927c86e7391
|
938a60cd0bb6694fd5143be8e9c6c572c53c825d
|
refs/heads/master
| 2016-09-12T16:29:32.275558 | 2016-04-25T11:28:37 | 2016-04-25T11:28:37 | 57,036,283 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 2,020 |
h
|
bsq.h
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bsq.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qdequele <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/09/21 11:59:32 by qdequele #+# #+# */
/* Updated: 2015/09/24 22:43:11 by lede-ser ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef BSQ_H
# define BSQ_H
# include <stdlib.h>
# include <fcntl.h>
# include <unistd.h>
# include "libft.h"
# define BUF_SIZE 7340032
# define IMAPTL imap[h - 1][w - 1]
# define IMAPTR imap[h][w - 1]
# define IMAPBL imap[h - 1][w]
typedef struct s_square_max
{
int h;
int w;
int size;
} t_sqm;
typedef struct s_map_info
{
int width;
int height;
char *params;
} t_mi;
void ft_foreach_map(int ac, char **av);
char *ft_get_map(void);
char *ft_get_maps(int index, char **av);
int ft_get_params(t_mi *minfo, char *str);
int ft_strlen_column(char *str);
int ft_get_row_nbr(char *str);
char *ft_get_caract(char *str);
int ft_check_map(t_mi *params, char *map);
char **ft_str_to_tab(t_mi minfo, char *strmap);
t_sqm *ft_cast_map(t_mi minfo, char **map);
int ft_get_biggest(t_sqm *sqm, t_mi minfo, int **imap, char **map);
void ft_save_biggest(int value, int h, int w, t_sqm *sqm);
int ft_find_square(t_sqm *sqm, int w, int h, int **imap);
int ft_aff_bsq(t_mi minfo, char **map);
void ft_prepare_map(t_sqm sqm, t_mi minfo, char **map);
void ft_map_error(void);
#endif
|
63d504725174430dab2d49bd6367d7f5791a568f
|
a1c63ccd5bf6f5f2f5ab1c89f868b0cf6b530c05
|
/liblats.c
|
ebeeed679d2f69540478bd27fe9911f3cb108341
|
[
"BSD-3-Clause"
] |
permissive
|
CDAT/lats
|
f1982167184e59717435f2dcdfc2c8642a8fcfb2
|
0856d5cb681dde6728f7b170d988a70d2c818673
|
refs/heads/master
| 2022-06-20T12:28:36.911767 | 2022-05-18T22:49:24 | 2022-05-18T22:49:24 | 31,619,103 | 0 | 1 | null | 2022-05-18T22:49:25 | 2015-03-03T20:16:08 |
C
|
UTF-8
|
C
| false | false | 47,412 |
c
|
liblats.c
|
/*
This GrADS extension has been placed in the public domain. See individual
C source files for PCMDI licensing terms.
---
About POD Documentation
The following documentation uses the "Perl On-line Documentation"
(POD) mark up syntax. It is a simple and yet adequate mark up language
for creating basic man pages, and there are converters to html,
MediaWiki, etc. In adittion, the perldoc utility can be used to
display this documentation on the screen by entering:
% perldoc lats
Or else, run this file through cpp to extract the POD fragments:
% cpp -DPOD -P < lats.c > lats.pod
and place lats.pod in a place perldoc can find it, like somewhere in your path.
To generate HTML documentation:
% pod2html --header < lats.pod > lats.html
To generate MediaWiki documentation:
% pod2wiki --style mediawiki < lats.pod > lats.wiki
If you have "pod2html" and "pod2wini" installed (if not, get them from
CPAN), there are targets in the gex.mk fragment for these:
% make lats.html
% make lats.wiki
*/
#ifndef POD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "grads.h"
#include "gex.h"
#include "galats.h"
#include "lats.h"
#ifdef GOT_NETCDF
# include "netcdf.h"
#endif
static char pout[256]; /* Build error msgs here */
static int Initialized = 0;
struct galats glats ; /* LATS option struct */
int galats (struct gacmn *, int, int); /*mf --- GrADS-lats interface mf*/
/* ..................................................................... */
static void init_() {
strcpy(glats.ptname,"");
/*
initialize to bad values for force failure on create
that is, require specification of frequency
*/
glats.convention=LATS_GRADS_GRIB;
glats.calendar=LATS_STANDARD;
glats.frequency=-1;
glats.deltat=0;
glats.gzip = -1;
glats.shave = -1;
strcpy(glats.model,"Unknown1 LATS model");
strcpy(glats.center,"PCMDI");
strcpy(glats.comment,"Written using the GrADS-LATS interface");
strcpy(glats.oname,"grads.lats");
glats.gridtype=LATS_LINEAR;
strcpy(glats.gridname,"grid1");
strcpy(glats.vertdimname,"plev");
strcpy(glats.var,"unknown1");
glats.timestat=LATS_INSTANT;
strcpy(glats.var_comment,"Unknown1 variable comment");
glats.varlev=-1e20;
glats.lyr=-1;
glats.lmo=-1;
glats.lda=-1;
glats.lhr=-1;
glats.lmn=-1;
glats.fhour=-1;
glats.fmin=-1;
glats.time_opt=1;
glats.id_file=-1;
glats.id_lev=0;
glats.nlev=-1;
glats.id_grid=-1;
glats.id_var=-1;
Initialized = 1;
}
static int do_lats ( int argc, char **argv, struct gacmn *pcm, int opt) {
char *name = argv[0];
int i, rc;
struct gastat *pst;
struct gagrid *pgr;
rc = 0;
if (argc<2) {
sprintf(pout,"\nError from %s: missing expression\n", name);
gaprnt(0,pout);
return(1);
}
/* Evaluate expression */
pst = getpst(pcm);
if (pst==NULL) return(1);
/* Note: gapars() no longer work from extensions since 2.0.a9 */
rc = gaexpr(argv[1],pst);
if (rc) goto retrn;
pcm->type[0] = pst->type;
pcm->result[0] = pst->result;
pcm->numgrd = 1;
pcm->relnum = 1;
/* Make sure UNDEFs are set as in v1 */
pgr = pcm->result[0].pgr;
for (i=0; i<(pgr->isiz*pgr->jsiz); i++ )
if ( ! pgr->umask[i] ) pgr->grid[i] = pgr->undef;
/* Do the LATS thing */
rc=galats(pcm,opt,0);
retrn:
gafree(pst);
return(rc);
}
/* ..................................................................... */
int c_lats_reinit ( int argc, char **argv, struct gacmn *pcm) {
init_();
return 0;
}
int c_lats_grid ( int argc, char **argv, struct gacmn *pcm) {
if ( ! Initialized ) init_();
return do_lats(argc,argv,pcm,3);
}
int c_lats_data ( int argc, char **argv, struct gacmn *pcm) {
if ( ! Initialized ) init_();
return do_lats(argc,argv,pcm,5);
}
int c_lats_set ( int argc, char **argv, struct gacmn *pcm) {
int i, rc, kwrd = 98;
gadouble v1, v2;
rc = 0;
if ( ! Initialized ) init_();
if ( argc<2 ) {
gaprnt (0,"SET_LATS error: No arguments....\n");
gaprnt (0," valid arguments are: \n");
gaprnt (0," parmtab [FILENAME] (e.g., set_lats parmtab lats.ncep.MRFtable)\n");
gaprnt (0," convention [grads_grib|grib_only|coards] (e.g., set_lats convention grib)\n");
gaprnt (0," gzip level (e.g., set_lats gzip 2)\n");
gaprnt (0," shave nbits (e.g., set_lats shave 12)\n");
gaprnt (0," calendar [standard|noleap|clim|climleap] (e.g., set_lats calendar standard)\n");
gaprnt (0," frequency [yearly|monthly|monthly_table_comp|weekly|daily|hourly|minutes|forecast_hourly|forecast_minutes|fixed] (e.g., set_lats frequency hourly)\n");
gaprnt (0," deltat [N] (integer number of freq units per time output, e.g., set_lats deltat 6)\n");
gaprnt (0," fhour [N] (integer forecast hour, e.g., set_lats fhour 120)\n");
gaprnt (0," model [MODEL_NAME] (e.g., set_lats model MRF)\n");
gaprnt (0," center [CENTER_NAME] (e.g., set_lats center NCEP)\n");
gaprnt (0," create [FILENAME] (e.g., set_lats create MRF.EXP1)\n");
gaprnt (0," comment [COMMENT (e.g., set_lats comment \"R1.6.1 of MRF with convection update\")\n");
gaprnt (0," gridtype [linear|gaussian|generic] (e.g., set_lats gridtype gaussian\n");
gaprnt (0," vertdim [DIMNAME LEV_TYPE lev_1 ... lev_N] (e.g., set_lats vertdim plev 1000 850 500 200)\n");
gaprnt (0," var [VARNAME average|accum|instant LEVEL_ID)] (e.g., set_lats var u instant 1)\n");
gaprnt (0," timeoption [grid|dim_env|settime (e.g., set_lats v timeoption dim_env (use the GrADS dimension environment)\n");
gaprnt (0," write [VAR_ID LEVEL] (e.g., set_lats write 1 500 (return from t lats var)\n");
gaprnt (0," close (e.g., set_lats close)\n\n");
return(1);
}
/*-------------------
lats_parmtab interface
-------------------*/
if(cmpwrd("parmtab",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS PARMTAB error: No arguments....\n");
return(1);
} else strcpy(glats.ptname,argv[2]);
rc=galats(pcm,0,0);
sprintf(pout,"LATS PARMTAB ID = %d\n",rc);
gaprnt(2,pout);
}
/*----------
lats_create interface
---------*/
else if (cmpwrd("convention",argv[1])||cmpwrd("format",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS CONVENTION error: No arguments....\n");
return(1);
} else if( cmpwrd("grads_grib",argv[2]) ) glats.convention=LATS_GRADS_GRIB;
else if( cmpwrd("coards",argv[2]) ) glats.convention=LATS_NC3;
else if( cmpwrd("netcdf",argv[2]) ) glats.convention=LATS_NC3;
else if( cmpwrd("nc3",argv[2]) ) glats.convention=LATS_NC3;
else if( cmpwrd("nc4",argv[2]) ) glats.convention=LATS_NC4;
else if( cmpwrd("netcdf4",argv[2]) ) glats.convention=LATS_NC4;
else if( cmpwrd("hdf",argv[2]) ) glats.convention=LATS_HDF4;
else if( cmpwrd("hdf4",argv[2]) ) glats.convention=LATS_HDF4;
else if( cmpwrd("grib_only",argv[2]) ) glats.convention=LATS_GRIB_ONLY;
else {
gaprnt (0,"SET_LATS CONVENTION error: invalid argument using the default...\n");
return(1);
}
}
else if (cmpwrd("gzip",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS GZIP error: No arguments....\n");
return(1);
}
#ifndef NC_NETCDF4
gaprnt (0,"SET_LATS GZIP warning: ignored since NetCDF-4 is not present\n");
return(0);
#else
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS GZIP error: invalid or missing gzip level\n");
return(1);
} else if (i<1||i>9) {
gaprnt (0,"SET_LATS GZIP error: level must be between 1 and 9.\n");
return(1);
} else {
glats.gzip=i;
}
#endif
}
else if (cmpwrd("shave",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS SHAVE error: No arguments....\n");
return(1);
}
#ifndef NC_NETCDF4
gaprnt (0,"SET_LATS SHAVE warning: ignored since NetCDF-4 is not present\n");
return(0);
#else
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS SHAVE error: invalid or missing number of bits to shave level\n");
return(1);
} else if (i>23) {
gaprnt (0,"SET_LATS SHAVE error: nbits must be at most 23.\n");
return(1);
} else {
glats.shave=i;
if ( glats.gzip < 0 ) glats.gzip = 2; /* no point in shaving without compression */
}
#endif
}
else if (cmpwrd("calendar",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS CALENDAR error: No arguments....\n");
return(1);
}
else if( cmpwrd("standard",argv[2]) ) glats.calendar=LATS_STANDARD;
else if( cmpwrd("noleap",argv[2]) ) glats.calendar=LATS_NOLEAP;
else if( cmpwrd("clim",argv[2]) ) glats.calendar=LATS_CLIM;
else if( cmpwrd("climleap",argv[2]) ) glats.calendar=LATS_CLIMLEAP;
else {
gaprnt (0,"SET_LATS CALENDAR error: Invalid argument using the default...\n");
return(1);
}
}
else if(cmpwrd("frequency",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS FREQUENCY error: No arguments....\n");
return(1);
} else if( cmpwrd("yearly",argv[2]) ) glats.frequency=LATS_YEARLY;
else if( cmpwrd("monthly",argv[2]) ) glats.frequency=LATS_MONTHLY;
else if( cmpwrd("monthly_table_comp",argv[2]) ) glats.frequency=LATS_MONTHLY_TABLE_COMP;
else if( cmpwrd("weekly",argv[2]) ) glats.frequency=LATS_WEEKLY;
else if( cmpwrd("daily",argv[2]) ) glats.frequency=LATS_DAILY;
else if( cmpwrd("hourly",argv[2]) ) glats.frequency=LATS_HOURLY;
else if( cmpwrd("minutes",argv[2]) ) glats.frequency=LATS_MINUTES;
else if( cmpwrd("forecast_hourly",argv[2]) ) {
glats.frequency=LATS_FORECAST_HOURLY;
glats.time_opt=3;
}
else if( cmpwrd("forecast_minutes",argv[2]) ) {
glats.frequency=LATS_FORECAST_MINUTES; /*ams Mike: check this! ams*/
glats.time_opt=3;
}
else if( cmpwrd("fixed",argv[2]) ) glats.frequency=LATS_FIXED;
else {
gaprnt (0,"SET_LATS FREQUENCY error: Invalid arguments LATS_CREATE WILL FAIL....\n");
return(1);
}
}
else if(cmpwrd("deltat",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS DELTAT error: No arguments....\n");
return(1);
}
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS DELTAT error: invalid or missing increment\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS DELTAT error: < 0 LATS_CREATE WILL FAIL...\n");
return(1);
} else {
glats.deltat=i;
}
}
else if(cmpwrd("fhour",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS FHOUR error: No arguments....\n");
return(1);
}
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS FHOUR error: invalid or missing increment\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS FHOUR error: < 0 LATS WILL FAIL...\n");
return(1);
} else {
glats.fmin=0; /* mf set default fmin to 0 if hourly */
glats.fhour=i;
}
}
else if(cmpwrd("fminute",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS FMINUTE error: No arguments....\n");
return(1);
}
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS FMINUTE error: invalid or missing increment\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS FMINUTE error: < 0 LATS WILL FAIL...\n");
return(1);
} else {
glats.fmin=i;
glats.fhour=0; /* mf set default fhour to 0 if minutes */
}
}
else if(cmpwrd("basetime",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS BASETIME error: No arguments....\n");
return(1);
}
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS BASETIME ID_FILE error: missing\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS BASETIME ID_FILE error: id_file < 0\n");
return(1);
} else {
if(i >= 0 && i <= glats.id_file) {
glats.id_user_file=i;
} else {
sprintf(pout,"SET_LATS BASETIME error: FILE ID is %d but the max FILE ID is %d\n",
i,glats.id_file);
gaprnt(0,pout);
return(1);
}
}
if ( argc < 4 ) {
gaprnt (0,"SET_LATS BASETIME YEAR error: missing\n");
return(1);
}
if ( intprs(argv[3],&(i)) == NULL ) {
gaprnt (0,"SET_LATS BASETIME YEAR error: invalid or missing\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS BASETIME YEAR error: year < 0\n");
return(1);
} else {
glats.lyr=i;
}
if ( argc < 5 ) {
gaprnt (0,"SET_LATS BASETIME MONTH error: missing\n");
return(1);
}
if ( intprs(argv[4],&(i)) == NULL ) {
gaprnt (0,"SET_LATS BASETIME MONTH error: invalid or missing\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS BASETIME MONTH error: year < 0\n");
return(1);
} else {
glats.lmo=i;
}
if ( argc < 6 ) {
gaprnt (0,"SET_LATS BASETIME DAY error: missing\n");
return(1);
}
if ( intprs(argv[5],&(i)) == NULL ) {
gaprnt (0,"SET_LATS BASETIME DAY error: invalid or missing\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS BASETIME DAY error: year < 0\n");
return(1);
} else {
glats.lda=i;
}
if ( argc < 7 ) {
gaprnt (0,"SET_LATS BASETIME HOUR error: missing\n");
return(1);
}
if ( intprs(argv[6],&(i)) == NULL ) {
gaprnt (0,"SET_LATS BASETIME HOUR error: invalid or missing\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS BASETIME HOUR error: year < 0\n");
return(1);
} else {
glats.lhr=i;
}
if ( argc < 9 ) {
gaprnt (0,"SET_LATS BASETIME MIN error: missing\n");
return(1);
}
if ( intprs(argv[7],&(i)) == NULL ) {
gaprnt (0,"SET_LATS BASETIME MIN error: invalid or missing\n");
return(1);
} else if (i<0) {
gaprnt (0,"SET_LATS BASETIME MIN error: year < 0\n");
return(1);
} else {
glats.lmn=i;
}
rc=galats(pcm,10,0); /* set the basetime */
}
else if(cmpwrd("model",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS MODEL error: No arguments....\n");
return(1);
} else strcpy(glats.model,argv[2]);
}
else if(cmpwrd("center",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS CENTER error: No arguments....\n");
return(1);
} else strcpy(glats.center,argv[2]);
}
else if(cmpwrd("comment",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS COMMENT error: No arguments....\n");
return(1);
} else strcpy(glats.comment,argv[2]);
}
else if(cmpwrd("varcomment",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS VARCOMMENT error: No arguments....\n");
return(1);
} else strcpy(glats.var_comment,argv[2]);
}
else if(cmpwrd("create",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS CREATE error: Missing or invalid arguments");
return (1);
} else strcpy(glats.oname,argv[2]);
rc=galats(pcm,1,0); /* open the lats file */
sprintf(pout,"LATS FILE ID = %d\n",rc);
gaprnt(2,pout);
}
/*-----------------
lats_grid interface
-----------------*/
else if (cmpwrd("gridtype",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS GRIDTYPE error: No arguments....\n");
return(1);
} else if( cmpwrd("linear",argv[2]) ) glats.gridtype=LATS_LINEAR;
else if( cmpwrd("gaussian",argv[2]) ) glats.gridtype=LATS_GAUSSIAN;
else if( cmpwrd("generic",argv[2]) ) glats.gridtype=LATS_GENERIC;
else {
gaprnt (0,"SET error: Missing or invalid arguments for GRIDTYPE ");
return (1);
}
}
else if(cmpwrd("gridname",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS GRIDNAME error: No arguments....\n");
return(1);
} else strcpy(glats.gridname,argv[2]);
}
/*------------
lats_vertdim interface
-------------*/
else if(cmpwrd("vertdim",argv[1])) {
glats.nlev=0;
if ( argc < 3 ) {
gaprnt (0,"SET_LATS VERTDIM error: No arguments....\n");
return(1);
} else {
strcpy(glats.vertdimname,argv[2]);
}
if ( argc < 4 ) {
gaprnt (0,"SET_LATS VERTDIM error: no levels given....\n");
return(1);
}
for ( i=3; i<argc; i++ ) {
getdbl(argv[i],&(v1));
glats.levels[glats.nlev]=(double)v1;
glats.nlev++;
}
rc=galats(pcm,2,0); /* set the vertical dimension */
sprintf(pout,"LATS VERTDIM ID = %d\n",rc);
if(rc==0) gaprnt(0,pout);
else gaprnt(2,pout);
}
/*------
lats_var interface
------*/
else if(cmpwrd("var",argv[1])) {
if ( argc < 3 ) {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
gaprnt (0,"SET_LATS VAR error: No arguments! args: fileid varname datatype gridid levid\n");
return(1);
}
/* --- file id */
if ( intprs(argv[2],&(i))==NULL) {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
gaprnt (0,"SET_LATS VAR FILE ID: invalid FILE ID value given\n");
return(1);
}
if(i >= 0 && i <= glats.id_file) {
glats.id_user_file=i;
} else {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
sprintf(pout,
"SET_LATS VAR error: FILE ID is %d but the max FILE ID is %d\n",
i,glats.id_file);
gaprnt(0,pout);
return(1);
}
/* --- var name */
if ( argc < 4 ) {
gaprnt (0,"SET_LATS VAR error: variable name not given...\n");
return(1);
} else { strcpy(glats.var,argv[3]); }
/* --- stat type */
if ( argc < 5 ) {
if( cmpwrd("average",argv[4]) ) glats.timestat=LATS_AVERAGE;
else if( cmpwrd("accum",argv[4]) ) glats.timestat=LATS_ACCUM;
else if( cmpwrd("instant",argv[4]) ) glats.timestat=LATS_INSTANT;
else {
gaprnt (0,"SET_LATS VAR error: invalid variable statistic type given...\n");
return(1);
}
}
/* --- level grid id */
if ( argc < 6 ) {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
gaprnt (0,"SET_LATS VAR error: missing GRID ID\n");
return(1);
}
if ( intprs(argv[5],&(i)) == NULL ) {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
gaprnt (0,"SET_LATS VAR error: invalid GRID ID value given\n");
return(1);
} else if(i >= 0 && i <= glats.id_grid) {
glats.id_user_grid=i;
} else {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
sprintf(pout,
"SET_LATS VAR error: GRID ID is %d but the max GRID ID is %d\n",
i,glats.id_user_grid);
gaprnt(0,pout);
return(1);
}
/* --- level id */
if ( argc < 7 ) {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
gaprnt (0,"SET_LATS VAR error: missing LEVEL ID\n");
gaprnt (0," use a value of 0 for surface variables\n");
return(1);
}
if ( intprs(argv[6],&(i)) == NULL ) {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
gaprnt (0,"SET_LATS VAR error: invalid LEVEL ID value given\n");
gaprnt (0," use a value of 0 for surface variable\n");
return(1);
} else if(i >= 0 && i <= glats.id_lev) {
glats.id_user_lev=i;
} else {
sprintf(pout,"LATS VAR ID = -1\n");
gaprnt(2,pout);
sprintf(pout,
"SET_LATS VAR error: LEVEL ID is %d but the max LEVEL ID is %d\n",
i,glats.id_user_lev);
gaprnt(0,pout);
gaprnt(0," use a value of 0 for surface variables...\n");
return(1);
}
/* --- call lats_var */
rc=galats(pcm,4,0);
sprintf(pout,"LATS VAR ID = %d\n",rc);
gaprnt(2,pout);
}
/*-------------------
lats_write interface
-------------------*/
else if(cmpwrd("write",argv[1])) {
glats.id_user_write=0;
/* --- file id */
if ( argc < 3 ) {
gaprnt (0,"SET_LATS WRITE error: No arguments (fileid varid)\n");
return(1);
}
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS WRITE error: missing or invalid FILE ID given...\n");
return(1);
} else {
glats.id_user_file=i;
if(glats.id_user_file<0 || (glats.id_user_file > glats.id_file) ) {
sprintf(pout,
"SET_LATS WRITE error: FILE ID is outside the valid range of 1 - %d\n",
glats.id_file);
gaprnt (0,pout);
return(1);
}
}
/* --- var id */
if ( argc < 4 ) {
gaprnt (0,"SET_LATS WRITE error: No arguments...\n");
return(1);
}
if ( intprs(argv[3],&(i)) == NULL ) {
gaprnt (0,"SET_LATS WRITE error: missing or invalid VAR ID given...\n");
return(1);
} else {
glats.id_user_var=i;
if(glats.id_user_var<0 || (glats.id_user_var > glats.id_var) ) {
sprintf(pout,
"SET_LATS WRITE error: VAR ID is outside the valid range of 1 - %d\n",
glats.id_var);
gaprnt (0,pout);
return(1);
}
}
if ( argc >= 5 ) {
getdbl(argv[4],&(v1)) ;
glats.varlev=(double)v1;
} else {
glats.varlev=0.0;
}
glats.id_user_write=1;
sprintf(pout,"LATS WRITE ID = %d\n",glats.id_user_write);
gaprnt(2,pout);
}
else if (cmpwrd("timeoption",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS TIMEOPTION error: No arguments....\n");
return(1);
} else if ( cmpwrd("grid",argv[2]) ) glats.time_opt=0;
else if( cmpwrd("dim_env",argv[2]) ) glats.time_opt=1;
else if( cmpwrd("settime",argv[2]) ) glats.time_opt=2;
else {
gaprnt (0,"SET_LATS TIMEOPTION error: invalid option ....\n");
return(1);
}
}
/*-------------------
lats_close interface
-------------------*/
else if(cmpwrd("close",argv[1])) {
if ( argc < 3 ) {
gaprnt (0,"SET_LATS CLOSE error: No arguments, specify a file id...\n");
return(1);
}
if ( intprs(argv[2],&(i)) == NULL ) {
gaprnt (0,"SET_LATS CLOSE error: missing or invalid FILE ID given...\n");
return(1);
} else {
if(i<0 || i>glats.id_file){
sprintf(pout,
"SET_LATS CLOSE error: FILE ID is outside the valid range of 1 - %d\n",
glats.id_file);
gaprnt (0,pout);
return(1);
}
}
rc=galats(pcm,6,i); /* close the lats file */
}
else if(cmpwrd("reset",argv[1])) {
rc=galats(pcm,7,0); /* reset the lats state */
}
else {
gaprnt (0,"SET_LATS error: Missing or invalid arguments:\n ");
sprintf (pout,"for %s option\n",argv[1]);
gaprnt (0,pout);
return (1);
}
/* Consistency checks */
if ( glats.gzip >= 0 && glats.convention==LATS_NC3 ) {
glats.convention = LATS_NC4;
gaprnt(0,"SET_LATS Warning: GZIP compression requires NetCDF-4 --- resetting NetCDF to version 4\n");
}
return(abs(rc));
}
/* .................................................................. */
int c_lats_query ( int argc, char **argv, struct gacmn *pcm) {
int i;
gadouble v1, v2;
if ( ! Initialized ) init_();
/* LATS state */
sprintf(pout,"GrADS-LATS Interface State:\n");
gaprnt (2,pout);
/*=== lats_parmtab ===*/
sprintf(pout,"%s \t:parameter table file (by \"set_lats parmtab \")\n",glats.ptname);
gaprnt (2,pout);
/*=== lats_create ===*/
sprintf(pout,"%d \t: data CONVENTION parameter (by \"set_lats convention\")\n",glats.convention);
gaprnt (2,pout);
sprintf(pout,"%d \t: data CALENDAR parameter (by \"set_lats calendar\")\n",glats.calendar);
gaprnt (2,pout);
sprintf(pout,"%d \t: data time FREQEUENCY parameter (by \"set_lats frequency\")\n",glats.frequency);
gaprnt (2,pout);
sprintf(pout,"%d \t: TIMEOPTION parameter (by \"set_lats timeoption\")\n",glats.time_opt);
gaprnt (2,pout);
sprintf(pout,"%d \t: DELTAT time (# of intervals) (by \"set_lats deltat\")\n",glats.deltat);
gaprnt (2,pout);
sprintf(pout,"%d \t: BASETIME year (# of intervals) (by \"set_lats basetime id_file yr mo da hr\")\n",glats.lyr);
gaprnt (2,pout);
sprintf(pout,"%d \t: BASETIME month (# of intervals) (e.g., \"set_lats basetime 1 1997 5 31 00\")\n",glats.lmo);
gaprnt (2,pout);
sprintf(pout,"%d \t: BASETIME day (# of intervals) (e.g., \"set_lats basetime 1 1997 5 31 00\")\n",glats.lda);
gaprnt (2,pout);
sprintf(pout,"%d \t: BASETIME hour (# of intervals) (e.g., \"set_lats basetime 1 1997 5 31 00\")\n",glats.lhr);
gaprnt (2,pout);
sprintf(pout,"%d \t: BASETIME minute (# of intervals) (e.g., \"set_lats basetime 1 1997 5 31 00 0\")\n",glats.lmn);
gaprnt (2,pout);
sprintf(pout,"%d \t: FHOUR hour (# of intervals) (e.g., \"set_lats fhour 12\")\n",glats.fhour);
gaprnt (2,pout);
sprintf(pout,"%d \t: FMIN hour (# of intervals) (e.g., \"set_lats fmin 12\")\n",glats.fmin);
gaprnt (2,pout);
sprintf(pout,"%s \t: MODEL (by \"set_lats model\")\n",glats.model);
gaprnt (2,pout);
sprintf(pout,"%s \t: data CENTER (by \"set_lats center\")\n",glats.center);
gaprnt (2,pout);
sprintf(pout,"%s \t: COMMENT (by \"set_lats comment\")\n",glats.comment);
gaprnt (2,pout);
sprintf(pout,"%s \t: output file (by \"set_lats open \")\n",glats.oname);
gaprnt (2,pout);
/*=== lats compression ===*/
sprintf(pout,"%d \t: GZIP level (by \"set_lats gzip\")\n",glats.gzip);
gaprnt (2,pout);
sprintf(pout,"%d \t: SHAVE nbits (by \"set_lats shave\")\n",glats.shave);
gaprnt (2,pout);
/*=== lats_grid ===*/
sprintf(pout,"%d \t: GRIDTYPE grid type parameter(by \"set_lats gridtype\")\n",glats.gridtype);
gaprnt (2,pout);
sprintf(pout,"%s \t: GRIDNAME grid type parameter(by \"set_lats gridname\")\n",glats.gridname);
gaprnt (2,pout);
sprintf(pout,"%4d \t: linear in longitude (0=no,1=yes)\n",glats.ilinear);
gaprnt (2,pout);
sprintf(pout,"%4d \t: linear in latitude (0=no,1=yes)\n",glats.jlinear);
gaprnt (2,pout);
sprintf(pout,"%4d \t: # longitude points (nlon) \n",glats.nlon);
gaprnt (2,pout);
sprintf(pout,"%4d \t: # latitude points (nlat) \n",glats.nlat);
gaprnt (2,pout);
sprintf(pout," ( %10.4f , %10.4f ) \t: ( 1, 1) lon lat\n",glats.lon_1,glats.lat_1);
gaprnt (2,pout);
sprintf(pout," ( %10.4f , %10.4f ) \t: (nlat,nlon) lon lat\n",glats.lon_nlon,glats.lat_nlat);
gaprnt (2,pout);
/*=== lats_vertdim ===*/
sprintf(pout,"%s \t: vertical dimension by \"set_lats levels (lev1 ... levN) vertdimname\")\n",glats.vertdimname);
gaprnt (2,pout);
sprintf(pout,"%d \t: # of vertical levels (by \"set_lats levels (lev1 ... levN) vertdimname\")\n",glats.nlev);
gaprnt (2,pout);
for(i=0; i<(glats.nlev) ; i++) {
sprintf(pout," %g",glats.levels[i]);
gaprnt (2,pout);
}
sprintf(pout,"vertical levels\n");
gaprnt (2,pout);
/*=== lats_var ===*/
sprintf(pout,"%s \t: VAR output parameter (by \"set_lats var (name timestat [level])\")\n",glats.var);
gaprnt (2,pout);
sprintf(pout,"%d \t: VAR TIMESTAT time statistic parameter\n",glats.timestat);
gaprnt (2,pout);
/*==== LATS internal id's ===*/
sprintf(pout,"%d \t: id_file LATS internal ID\n",glats.id_file);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_grid LATS internal ID\n",glats.id_grid);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_lev LATS internal ID\n",glats.id_lev);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_var LATS internal ID\n",glats.id_var);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_user_file LATS internal ID\n",glats.id_user_file);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_user_grid LATS internal ID\n",glats.id_user_grid);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_user_var LATS internal ID\n",glats.id_user_var);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_user_lev LATS internal ID\n",glats.id_user_lev);
gaprnt (2,pout);
sprintf(pout,"%d \t: id_user_write LATS internal ID\n",glats.id_user_write);
gaprnt (2,pout);
return(0);
}
/* .................................................................... */
/*
-----------------
POD Documentation
-----------------
*/
#else
=pod
=head1 NAME
liblats.gex - GrADS Extension Library for File Subsetting and Reformatting
=head1 SYNOPSIS
=head3 GrADS Commands:
=over 4
=item
run B<set_lats> I<PARAMETER> I<VALUE> - Set internal parameters
=item
run B<query_lats> - Print internal paramaters
=item
run B<lats_grid> I<EXPR> - Set horizontal grid
=item
run B<lats_data> I<EXPR> - Write data to file
=back
=head1 DESCRIPTION
This library provides GrADS extensions (I<gex>) for interfacing to
LATS (Library of AMIP II Transmission Standards), a collection of I/O
functions for creating lon/lat gridded datasets in the GRIB, NetCDF-3,
NetCDF-4/HDF-5 and HDF-4 formats. This is the low level LATS interface
in GrADS. Usually, one uses the wrapper B<lats4d.gs> script
(L<http://opengrads.org/doc/scripts/lats4d/>) for a more user friendly
interface which has reasonable defaults for most internal parameters.
The GrADS interface to LATS is implemented by means of 4 I<User
Defined Commands> (UDCs). Most parameters defining the output file are
set by means of the B<set_lats> command; the current LATS state can
queried with command B<query_lats>. Command B<lats_grid> is used to
define the horizontal longitude/lattude grid (vertical levels are set
with the B<set_lats> command.) Command B<lats_data> is used to write a
2-dimensional (longitude x latitude) slice of a variable, for a given time
and level.
The following sub-section describes the main attributes of the LATS
library which this extension interfaces to. It has been adapted from the
original LATS manual page.
=head2 Overview of the LATS Library
LATS is a subroutine library developed by the Program for Climate
Model Diagnosis and Intercomparison (PCMDI) to output lon/lat gridded
data for the AMIP II (Atmospheric Model Intercomparison Project II)
and other intercomparison projects. In addition to outputting data,
LATS optionally performs basic quality control on the data
written. LATS outputs data in the GRIB and/or netCDF formats and
provides an interface to GrADS and VCS. The LATS library is no longer
supported by the original developers at PCMDI but remains as a viable
mechanism for producing GRID-1, NetCDF and HDF output from GrADS.
The main features of LATS are:
=over 4
=item 1
LATS is designed to output rectilinear, generally global, gridded,
spatio-temporal data. The amount of data written with a single
function call is a horizontal longitude-latitude slice of a variable.
=item 2
Data may be output in the machine-independent formats GRIB and/or
netCDF and are directly readable by GrADS.
=item 3
Acceptable variable names are prescribed. The units, datatype, and
basic structure (e.g., single-level or multi-level) are inferred from
the variable name. This information is tabled in an external, ASCII
I<parameter table>. If no parameter table is specified, a default list of
AMIP II parameters is used.
=item 4
More than one LATS file may be open simultaneously for
output. In GrADS, one usually write one file at a time.
=item 5
Data must be written in increasing time sequence. All variables in a
file share a common time frequency (e.g., hourly, monthly,
etc.). Originally LATS did not support minutes, but a patch has ben
developed in version used by GrADS to allow minutes are a valid time
sequence.
=item 6
For a given timepoint, variables, and multiple levels for a variable, may be written in any order.
=item 7
Although GrADS Version 2 uses doubles (64 bits) to store variable
data, all data written to file by this interface are floating-point or
integer. INTEGER*8), and C int data can be written.
=item 8
Data written to GRIB files are packed to a predefined bit width or
numerical precision depending on the variable. The precision and bit
width is specified in the I<parameter table> file. Floating-point data written
to netCDF files are saved as 32-bit IEEE floating-point values;
integer data are written as 32-bit 2's complement integers.
=back
=head1 ANATOMY OF A LATS BASED GRADS SCRIPT
The skeleton of a GrADS script using the LATS interface is as follows:
=over 4
=item 1.
Optionally, specify an external parameter file, with
B<set_lats> I<parmtab>.
=item 2.
Define the horizontal grid with B<lats_grid>. Define all vertical
dimensions (e.g., pressure level) with B<set_lats> I<vertdim>. If a default
surface dimension is defined for a variable, it does not
have to be redefined with B<set_lats> I<vertdim>. Grids and vertical
dimensions are shared across variables. NOTE: At
present, only one grid may be defined for a GrADS/GRIB file.
=item 3.
Create a LATS file, with B<set_lats> I<create>.
=item 4.
Optionally, set the basetime, with B<set_lats> I<basetime>.
=item 5.
For EACH AND EVERY variable to be written, declare the
variable with B<set_lats> I<var>. The LATS requirement that ALL variables
be declared up front (before writing) is necessitated by the netCDF
interface.
=item 6.
For each time-point, in increasing time order and, for each
horizontal level of each variable, write the data for this level,
time-point, with B<set_lats> I<write> and B<lats_data>.
=item 7.
Close the file, with B<set_lats> I<close>.
=back
By default, all errors are reported.
=head2 QUALITY CONTROL
LATS performs some basic quality control on the data written. The
intention is to provide a quick check of data validity. For each level
written the following statistics are calculated: range
(maximum-minimum) and area-weighted average. If a missing data flag is
defined for the variable, any missing data are ignored in calculating
the statistics. Quality control is not performed on integer-valued
variables.
A QC exception is generated if abs(average - observed_average) >
(tolerance * observed_standard_deviation). Similarly, an exception is
generated if range > (range_tolerance * observed_range). In either
case, a warning is issued, and an entry is written to the QC log
file. The values of observed_average, tolerance,
observed_standard_deviation, range_tolerance, and observed_range are
tabled in the QC section of the I<Parameter Table> file. If no entry in this
section is found for the given (variable,level_type,level), then no
quality control is performed for that level.
Data are always written, regardless of whether a QC exception is
generated.
The default name of the log file is I<lats.log>. This name is
superseded by the value of the environment variable LATS_LOG, if
defined.
=head1 COMMANDS PROVIDED
=head2 B<set_lats> I<basetime YEAR MONTH DAY HOUR>
Set the basetime for file with ID fileid. The basetime is the initial
time in which the file can be referenced. The function
returns 1 if successful, 0 if an error oc- curs.
=head2 B<set_lats> I<close>
Close the file. The function returns 1 if successful, 0 if an error
occurs.
=over 8
=item B<NOTE:>
It is important to call B<set_lats close>, to ensure that any
buffered output is written to the file.
=back
=head2 B<set_lats> I<create FILENAME>
Create a LATS file with the given I<FILENAME>, a string of length <=
256. If I<FILENME> does not end in the proper extension ('.nc' for
netCDF, '.grb' for GRIB), the extension will be appended to the path.
=head2 B<set_lats> I<convention CONVENTION>
Deprecated. Same as B<set_lats> I<format>.
=head2 B<set_lats> I<format FORMAT>
The parameter I<FORMAT> defines the data format to be written, and the
metadata convention to be followed when writing the format. The
options are:
=over 8
=item I<grads_grib>
WMO GRIB format, plus a GrADS control file and the ancillary GRIB map
file. If this format is used the time step (see B<set_lats deltat>)
must be non-zero, implying that timepoints are evenly-spaced. All
variables in a file must share the same horizontal grid. This
convention is readable with GrADS. The GRIB data may be processed by
the utility B<wgrib> shipped with most GrADS distributions.
=item I<grib>
Similar to I<grads_grib> but without a GrADS control file and the
ancillary GRIB map file.
=item I<netcdf>
NetCDF-3 format, observing the COARDS metadata standard. When this
format is specified, the calendar must be I<STANDARD>. Climatologies
are indicated by specifying I<year = 2> in B<set_lats write>. For the
I<clim> and I<climleap> calendars, the year is automatically set to
2. Files wiritten with this format are readable with GrADS.
=item I<netcdf4>
Like the I<netcdf> format, except that the files are in the new
NetCDF-4 (actually HDF-5) format.
=item I<hdf4>
Like the I<netcdf> format, except that the files are in the new HDF-4
format. Notice that in GrADS v2, NetCDF and HDF-4 files are produced
with the same GrADS executables.
=back
=head2 B<set_lats> I<calendar CALENDAR>
I<CALENDAR> is the calendar type, one of the following values:
=over 4
=item I<STANDARD>
Standard Gregorian calendar. This is the default.
=item I<NOLEAP>
365days/year, no leap years
=item I<CLIM>
Climatological time (no associated year), 365 days
=item I<CLIMLEAP>
Climatological time, 366 days
=back
=head2 B<set_lats> I<center CENTER>
I<CENTER> is the name of the modeling center or group creating the
file, a string of <= 128 characters. For GRIB output, center must
match one of the centers listed in the parameter file.
=head2 B<set_lats> I<deltat DeltaT>
I<DeltaT> is the number of time units in the time increment, where the
units are specified by frequency. For example, data which are defined
at multiples of 6 hours would be specified with
ga-> set_lats frequency hourly
ga-> set_lats deltat 6
Similarly, monthly average data would be indicated by
ga-> set_lats frequency monthly
ga-> set_lats deltat 1
Note that times may be skipped for formats other than I<GRADS_GRIB>;
the only requirement imposed by the LATS interface is that timepoints,
as specified via B<set_lats write>, be at a multiple of the time
increment, relative to the base time (the first time written).
=head2 B<set_lats> I<frequency FREQUENCY>
I<FREQUENCY> is the time frequency of variables to be written to the
file, and has one of the values:
=over 4
=item I<YEARLY>
Only the year component of time is significant. I<DeltaT> (see
B<set_lats>) is expressed in years.
=item I<MONTHLY>
The year and month components of time are significant. I<DeltaT> (see
B<set_lats>) is expressed in months. Floating-point data in the
I<GRADS_GRIB> format are compressed to 16-bits.
=item I<MONTHLY_TABLE_COMP>
The year and month components of time are significant. I<DeltaT> (see
B<set_lats>) is expressed in months. Floating-point data in the
I<GRADS_GRIB> format are compressed according to the specification in
the parameter table.
=item I<WEEKLY>
The year, month, and day component of time are significant. I<DeltaT> is
expressed in weeks.
=item I<DAILY>
The year, month, and day component of time are significant. delta is
expressed in days.
=item I<HOURLY>
The year, month, day, and hour component of time are significant.
I<DeltaT> is expressed in hours.
=item I<MINUTES>
The year, month, day, hour, and minute component of time are significant.
I<DeltaT> is expressed in minutes.
=item I<FORECAST_HOURLY>
The year, month, day, and hour component of time are significant.
I<DeltaT> is expressed in hours.
=item I<FORECAST_MINUTES>
The year, month, day, hour, and minute component of time are significant.
I<DeltaT> is expressed in minutes.
=item I<FIXED>
Data are not time-dependent, e.g., for surface type, orography, etc.
I<DeltaT> is ignored and year is set to 1 by convention.
=back
=head2 B<set_lats> I<gridtype GRIDTYPE>
Define the type of horizontal grid. I<GRIDTYPE> is GAUSSIAN for
Gaussian grids, LINEAR for evenly spaced grids, or GENERIC
otherwise. The actual horizontal grid definition is performed with
command B<lats_grid>.
=head2 B<set_lats> I<gzip COMPRESSION_LEVEL>
When writing NetCDF-4 files, specifes the level of GZIP compression to
be employed. The higher the level, the harder the library works doing
compression, usually (but not always) producing smaller files. The
default is -1, meaning no compression. Notice that only NetCDF-4 files
can be compressed. When I<COMPRESION_LEVEL> > 0 is specified with
NetCDF-3 files, the format is automatically changed to NetCDF-4. For
improving the compression effectiveness see B<set_lats> I<shave>.
=head2 B<set_lats> I<model MODEL>
I<MODEL> is the name of the model version which created this data.
comments is a string of length 256 or less , including any null-
terminator. The command returns an integer file ID, or 0 if the file
cannot be created.
=head2 B<set_lats> I<parmtab TABLE_FILENAME>
Specify an external parameter table file. I<TABLE_FILENAME> is the
pathname of a file containing a list of variable descriptions, and is
a string of length <= 256 characters. Use of an external parameter
table is optional. The location of the parameter table is determined
as follows: (1) if the command B<set_lats> I<parmtab> is issued, the
value of I<TABLE_FILENAME> is used, otherwise (2) if the environment
variable LATS_PARMS is defined, its value is used, else (3) an
internally-defined table of AMIP parameters is used. The command
returns 1 on success, 0 on failure.
=head2 B<set_lats> I<shave NBITS>
Shave I<NBITS> off the mantissa of float-point numbers. By definition,
IEEE float numbers have 24 bits dedicated for the mantissa. This
command set to zero the last I<NBITS> of the mantissa, this way
reducing entropy and improving the effectiveness of GZIP compression
(see B<set_lats> I<gzip>). I<NBITS> must be in the range [1,23]. When
I<NBITS> > 0 is specified, it automatically sets GZIP compression on
at level 2, unless the compression level has already been
set. (Currently compression is implemented only for NetCDF04 output.)
NOTE: The actual shaving algorithm, first scales the variable being written
for each horizontal layer, and then shaves bits off the mantissa. See
http://en.wikipedia.org/wiki/Ieee_float
for additional information on IEEE float-point numbers.
=head2 B<set_lats> I<var VARNAME TIMESTAT LEVEL_ID>
Declare a variable to be written to a LATS file. fileid is the integer
file ID returned from lats_create. The variable name I<VARNAME> must
match a name in the parameter table, and is a string of length <= 128
characters.
I<TIMESTAT> is a time statistic identifier, one of:
=over 4
=item I<AVERAGE>
An average over the delta time interval frequency
defined by lats_create.
=item I<INSTANT>
The field is valid at the instan- taneous time set by the year, month,
day, hour.
=item I<ACCUM>
Accumulation during delta time interval I<DeltatT> (see B<set_lats deltat>).
=back
I<LEVID> is the ID of the vertical dimension of the variable, as
returned from B<set_lats> I<vertdim>. If the variable has a default surface
defined in the parameter table, or has no associated
vertical dimension, I<LEVID> should be 0. (Note: if levid is 0 and the
variable has a default surface defined, the netCDF representation
of the variable will not have an explicit vertical dimension, but
will have a I<level_description> attribute).
B<set_lats var> should be called exactly once for each variable to be
written to a LATS file and must be called BEFORE B<set_lats> I<write>.
The function returns the integer variable ID on success, or 0 on
failure.
=head2 B<set_lats> I<vertdim DIM_NAME LEV_TYPE LEV_1 ... LEV_N>
I<DIM_NAME> is the name of the vertical dimension (e.g., "height",
"depth", "level"), and it should not contain any whitespace
characters.
I<LEV_TYPE> is the vertical dimension type. It must match one of the level
types defined in the vertical dimension types section of the
parameterfile, e.g., I<plev, hybrid>, etc.
I<LEV_1>, ..., I<LEV_N> is a strictly monotonic list of level
values.
Multi-level variables must have a vertical dimension defined. If a
single-level (e.g., surface) variable has a default level type
specified in the parameter table, it is not necessary to call
B<set_lats> I<vertdim>, since the level type will be associated with
the variable by default. Note that the level units are determined from
the vertical dimension type table entry for name.
This command returns an integer level ID on success, or 0 on
failure.
=head2 B<set_lats> I<write VAR_ID [LEVEL]>
Specifies which variable in the file will be written next.
I<VAR_ID> is the integer variable ID returned from B<set_lats>
I<var>.
I<LEVEL> is the level value, and must match one of the levels
declared via lats_vert_dim. (Exception: if the variable was declared
with levid=0, the value of I<LEVEL> is ignored.) year is the four-digit
integer year, month is the month number (1-12), day is the day in
month (1-31), and hour is the integer hour (0-23).
=head2 B<lats_grid> I<EXPR>
Define a horizontal, longitude-latitude grid, based on the dimension
environment associated with the GrADS expression I<EXPR>. The grid
type is specified with command B<set_lats> I<gridtype>.
=head2 B<lats_data> I<EXPR>
Write a horizontal longitude-latitude cross-section of a variable
contained in the GrADS expression I<EXPR>. The actual variable on file
being written to is specified with he B<set_lats> I<write> command.
For monthly data, as specified by lats_create, day and hour are
ignored. For daily and weekly data, the hour is ignored. For fixed
data, the year, month, day, and hour are ignored. For surface
variables, lev is ignored.
This command returns 1 if successful, 0 on failure.
=head2 B<query_lats>
Prints out the value of all internal parameters.
=head1 ENVIRONMENT VARIABLES
=over 4
=item LATS_PARMS
Parameter table file (supersedes internal table if
defined)
=item LATS_LOG
Log file (default: lats.log)
=back
=head1 HISTORICAL NOTES
LATS was first introduced in GrADS v1.7 in the late 1990's by Mike
Fiorino as means of producing GRIB-1/NetCDF output from GrADS. With
the introduction of GrADS v2.0 in 2008, COLA removed LATS from the
GrADS code base. In 2009, the OpenGrADS Project reintroduced LATS in
GrADS v2.0 as a User Defiend Extension, adding support for
NetCDF-3, NetCDF-4/HDF-5 and HDF-4 all from the same executable.
=head1 SEE ALSO
=over 4
=item *
L<http://opengrads.org/> - OpenGrADS Home Page
=item *
L<http://cookbooks.opengrads.org/index.php?title=Main_Page> -
OpenGrADS Cookbooks
=item *
L<http://opengrads.org/wiki/index.php?title=User_Defined_Extensions> - OpenGrADS User Defined Extensions
=item *
L<http://www.iges.org/grads/> - Official GrADS Home Page
=item *
L<http://www-pcmdi.llnl.gov> - PCMDI
=item *
L<http://www-pcmdi.llnl.gov/software/lats> - LATS
=item *
L<http://www.unidata.ucar.edu/packages/netcdf> - NetCDF
=item *
L<ftp://ncardata.ucar.edu/docs/grib/guide.txt> - GRIB
=item *
L<http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html> - COARDS
=item *
L<http://wesley.wwb.noaa.gov/wgrib.html> - wgrib
=item *
L<http://opengrads.org/doc/scripts/lats4d/> - LATS4D
=item *
L<http://en.wikipedia.org/wiki/Ieee_float> - IEEE Float numbers
=back
=head1 AUTHORS
Arlindo da Silva (dasilva@opengrads.org) wrote the GrADS UDXT
interface and created this dcumentation from the LATS manual page.
Mike Fiorino (mfiorino@gmail) wrote the actual LATS interface to
GrADS. Robert Drach, Mike Fiorino and Peter Gleckler (PCMDI/LLNL)
wrote the original LATS library.
=head1 COPYRIGHT
The code implementing the GrADS extension has been placed in the public domain.
Portions (C) 1996, Regents of the University of California.
See the source for copying conditions. There is NO warranty; not even
for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#endif
|
88dc38a65b0de7fdec8e8029d57fba35bf11cbbd
|
c846a016d5170ae5eb9282ab3429f6f1ba73fba1
|
/Atividade_01/15.c
|
3eb5a3dfa403e45d0a3ee8fd30a24dca986fdebd
|
[] |
no_license
|
rosekizin/Estrutura-Dados-Algoritmos-2015.1
|
d78561c030dcd1a7d27092523c936b2d44c6f88e
|
d24f41c13522e397707a535088f0b4b424def689
|
refs/heads/master
| 2023-08-30T02:17:32.683330 | 2015-06-09T20:05:30 | 2015-06-09T20:05:30 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 701 |
c
|
15.c
|
#include <stdio.h>
#include <stdlib.h>
/*Faça um programa que receba o salário de um funcionário e o percentual de aumento, calcule e mostre o valor
do aumento e o novo salário.*/
float calculoSalario(float salario, float percentual){
float novoSalario = 0;
novoSalario = (salario*(percentual/100))+salario;
return novoSalario;
}
int main(int argc, char *argv[]) {
float salario =0, percentual=0;
printf("Digite o salário do funcionario: ");
scanf("%f", &salario);
printf("Digite o percentual de aumento do salario do funcionario: ");
scanf("%f", &percentual);
printf("O novo salario do funcionario é: %f", calculoSalario(salario,percentual) );
return 0;
}
|
7ab391d5447e9552617b645bbf8ccc17300ab276
|
e407913f3cd158cdaedc0bdf665f85bdfa967b07
|
/board/pinmux.c
|
58c4a7f44b31123dc0d7ba0d7819766e3cf0dd9c
|
[] |
no_license
|
charliexp/dtu
|
cbba1bd6d69bd6b314737c2c8a04534be7c052f6
|
436949c697414f158142b5cc2a5dbd47cd02cd60
|
refs/heads/master
| 2020-04-01T07:10:29.473034 | 2016-08-24T13:46:12 | 2016-08-24T13:46:12 | null | 0 | 0 | null | null | null | null |
GB18030
|
C
| false | false | 2,091 |
c
|
pinmux.c
|
/**
******************************************************************************
* @file pinmux.c
* @author sundh
* @version V0.1.1
* @date 2016-7-30
* @brief 配置Stm32的外设的引脚.
*
*
******************************************************************************
* @attention
*
*
* <h2><center>© 一个居中的标题 </center></h2>
******************************************************************************
---------------------------------------------------------------------------- \n
Change History : \n
<Date> <Version> | <Author> | <Description> \n
---------------------------------------------------------------------------- \n
2016/07/30 | 0.1.1 | sundh | Create file \n
---------------------------------------------------------------------------- \n
*/
#include "pinmux.h"
#include "stm32f10x_gpio.h"
/**
* @brief 配置uart1的引脚。
*
*根据SIM800A开发板的原理图,引脚为:rx PA10 tx PA9
* @param void
*
*
* @return
* -<em> 负数 :</em> fail \n
* -<em> ERR_OK :</em> succeed
*/
err_t conf_uart1_pin(void)
{
GPIO_InitTypeDef rx_pin;
GPIO_InitTypeDef tx_pin;
rx_pin.GPIO_Pin = GPIO_Pin_10;
rx_pin.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &rx_pin);
tx_pin.GPIO_Pin = GPIO_Pin_9;
tx_pin.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &tx_pin);
return ERR_OK;
}
/**
* @brief 配置uart3的引脚。
*
*根据SIM800A开发板的原理图,引脚为:rx PB11 tx PB10
* @param void
*
*
* @return
* -<em> 负数 :</em> fail \n
* -<em> ERR_OK :</em> succeed
*/
err_t conf_uart3_pin(void)
{
GPIO_InitTypeDef rx_pin;
GPIO_InitTypeDef tx_pin;
rx_pin.GPIO_Pin = GPIO_Pin_11;
rx_pin.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOB, &rx_pin);
tx_pin.GPIO_Pin = GPIO_Pin_10;
tx_pin.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOB, &tx_pin);
return ERR_OK;
}
|
3a886f31177d161a087a8ffe346db9ee1021c8a4
|
f45f817fbc862e7a0c0780afdd62901238465699
|
/Oving5/main.c
|
d2a387656ac2b4e79f31e0538456b34ebbf6ec9b
|
[] |
no_license
|
magnucha/SanntidSys
|
b9b8ee6f515b67680bf282e0721f2aa138a30ba3
|
bff3644cdd4cf3b60f709ad2b3a78347a103ad3a
|
refs/heads/master
| 2020-12-08T06:29:07.066941 | 2016-09-26T08:59:21 | 2016-09-26T08:59:21 | 66,817,348 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 787 |
c
|
main.c
|
#include <pthread.h>
#include <unistd.h>
#include "io.h"
void* test_A(void* arg){
while(1){
while(io_read(1));
io_write(1, 0);
usleep(5);
io_write(1, 1);
}
}
void* test_B(void* arg){
while(1){
while(io_read(2));
io_write(2, 0);
usleep(5);
io_write(2, 1);
}
}
void* test_C(void* arg){
while(1){
while(io_read(3));
io_write(3, 0);
usleep(5);
io_write(3, 1);
}
}
int main(){
io_init();
pthread_t thread_A;
pthread_t thread_B;
pthread_t thread_C;
pthread_create(&thread_A, NULL, test_A, NULL);
pthread_create(&thread_B, NULL, test_B, NULL);
pthread_create(&thread_C, NULL, test_C, NULL);
pthread_join(thread_A, NULL);
pthread_join(thread_B, NULL);
pthread_join(thread_C, NULL);
return 0;
}
|
a1ecbb2bcad4d2aecfee6cc0688d1e20ea14b1fe
|
58a480bb05e7ae950e78e30048e4c7ff0f557751
|
/kam1n0/kam1n0-symbolic/jnit/vex-master/priv/guest_tilegx_toIR.c
|
bf4f5e6dc2f162f4b6eed6eef2310b45f2a17732
|
[
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-or-later",
"Apache-2.0"
] |
permissive
|
McGill-DMaS/Kam1n0-Community
|
fdd2400a233f777ce0e97c64d5fba9054136afe6
|
1c3c309acc8f5e50c6617f858aa3b5b84c121b26
|
refs/heads/master2.x
| 2023-09-04T05:44:26.477534 | 2023-02-27T21:00:45 | 2023-02-27T21:00:45 | 42,168,266 | 366 | 90 |
Apache-2.0
| 2023-02-27T21:01:18 | 2015-09-09T09:11:13 |
C
|
UTF-8
|
C
| false | false | 82,325 |
c
|
guest_tilegx_toIR.c
|
/*--------------------------------------------------------------------*/
/*--- begin guest_tilegx_toIR.c ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2010-2013 Tilera Corp.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
/* Contributed by Zhi-Gang Liu <zliu at tilera dot com> */
/* Translates TILEGX code to IR. */
#include "libvex_basictypes.h"
#include "libvex_ir.h"
#include "libvex.h"
#include "libvex_guest_tilegx.h"
#include "main_util.h"
#include "main_globals.h"
#include "guest_generic_bb_to_IR.h"
#include "guest_tilegx_defs.h"
#include "tilegx_disasm.h"
/*------------------------------------------------------------*/
/*--- Globals ---*/
/*------------------------------------------------------------*/
/* These are set at the start of the translation of a instruction, so
that we don't have to pass them around endlessly. CONST means does
not change during translation of the instruction.
*/
/* CONST: is the host bigendian? This has to do with float vs double
register accesses on VFP, but it's complex and not properly thought
out. */
static VexEndness host_endness;
/* Pointer to the guest code area. */
static UChar *guest_code;
/* The guest address corresponding to guest_code[0]. */
static Addr64 guest_PC_bbstart;
/* CONST: The guest address for the instruction currently being
translated. */
static Addr64 guest_PC_curr_instr;
/* MOD: The IRSB* into which we're generating code. */
static IRSB *irsb;
/*------------------------------------------------------------*/
/*--- Debugging output ---*/
/*------------------------------------------------------------*/
#define DIP(format, args...) \
if (vex_traceflags & VEX_TRACE_FE) \
vex_printf(format, ## args)
/*------------------------------------------------------------*/
/*--- Helper bits and pieces for deconstructing the ---*/
/*--- tilegx insn stream. ---*/
/*------------------------------------------------------------*/
static Int integerGuestRegOffset ( UInt iregNo )
{
return 8 * (iregNo);
}
/*------------------------------------------------------------*/
/*--- Field helpers ---*/
/*------------------------------------------------------------*/
/*------------------------------------------------------------*/
/*--- Helper bits and pieces for creating IR fragments. ---*/
/*------------------------------------------------------------*/
static IRExpr *mkU8 ( UInt i )
{
return IRExpr_Const(IRConst_U8((UChar) i));
}
/* Create an expression node for a 32-bit integer constant */
static IRExpr *mkU32 ( UInt i )
{
return IRExpr_Const(IRConst_U32(i));
}
/* Create an expression node for a 64-bit integer constant */
static IRExpr *mkU64 ( ULong i )
{
return IRExpr_Const(IRConst_U64(i));
}
static IRExpr *mkexpr ( IRTemp tmp )
{
return IRExpr_RdTmp(tmp);
}
static IRExpr *unop ( IROp op, IRExpr * a )
{
return IRExpr_Unop(op, a);
}
static IRExpr *binop ( IROp op, IRExpr * a1, IRExpr * a2 )
{
return IRExpr_Binop(op, a1, a2);
}
static IRExpr *load ( IRType ty, IRExpr * addr )
{
IRExpr *load1 = NULL;
load1 = IRExpr_Load(Iend_LE, ty, addr);
return load1;
}
/* Add a statement to the list held by "irsb". */
static void stmt ( IRStmt * st )
{
addStmtToIRSB(irsb, st);
}
#define OFFB_PC offsetof(VexGuestTILEGXState, guest_pc)
static void putPC ( IRExpr * e )
{
stmt(IRStmt_Put(OFFB_PC, e));
}
static void assign ( IRTemp dst, IRExpr * e )
{
stmt(IRStmt_WrTmp(dst, e));
}
static void store ( IRExpr * addr, IRExpr * data )
{
stmt(IRStmt_Store(Iend_LE, addr, data));
}
/* Generate a new temporary of the given type. */
static IRTemp newTemp ( IRType ty )
{
vassert(isPlausibleIRType(ty));
return newIRTemp(irsb->tyenv, ty);
}
static ULong extend_s_16to64 ( UInt x )
{
return (ULong) ((((Long) x) << 48) >> 48);
}
static ULong extend_s_8to64 ( UInt x )
{
return (ULong) ((((Long) x) << 56) >> 56);
}
static IRExpr *getIReg ( UInt iregNo )
{
IRType ty = Ity_I64;
if(!(iregNo < 56 || iregNo == 63 ||
(iregNo >= 70 && iregNo <= 73))) {
vex_printf("iregNo=%d\n", iregNo);
vassert(0);
}
return IRExpr_Get(integerGuestRegOffset(iregNo), ty);
}
static void putIReg ( UInt archreg, IRExpr * e )
{
IRType ty = Ity_I64;
if(!(archreg < 56 || archreg == 63 || archreg == 70 ||
archreg == 72 || archreg == 73)) {
vex_printf("archreg=%d\n", archreg);
vassert(0);
}
vassert(typeOfIRExpr(irsb->tyenv, e) == ty);
if (archreg != 63)
stmt(IRStmt_Put(integerGuestRegOffset(archreg), e));
}
/* Narrow 8/16/32 bit int expr to 8/16/32. Clearly only some
of these combinations make sense. */
static IRExpr *narrowTo ( IRType dst_ty, IRExpr * e )
{
IRType src_ty = typeOfIRExpr(irsb->tyenv, e);
if (src_ty == dst_ty)
return e;
if (src_ty == Ity_I32 && dst_ty == Ity_I16)
return unop(Iop_32to16, e);
if (src_ty == Ity_I32 && dst_ty == Ity_I8)
return unop(Iop_32to8, e);
if (src_ty == Ity_I64 && dst_ty == Ity_I8) {
return unop(Iop_64to8, e);
}
if (src_ty == Ity_I64 && dst_ty == Ity_I16) {
return unop(Iop_64to16, e);
}
if (src_ty == Ity_I64 && dst_ty == Ity_I32) {
return unop(Iop_64to32, e);
}
if (vex_traceflags & VEX_TRACE_FE) {
vex_printf("\nsrc, dst tys are: ");
ppIRType(src_ty);
vex_printf(", ");
ppIRType(dst_ty);
vex_printf("\n");
}
vpanic("narrowTo(tilegx)");
return e;
}
#define signExtend(_e, _n) \
((_n == 32) ? \
unop(Iop_32Sto64, _e) : \
((_n == 16) ? \
unop(Iop_16Sto64, _e) : \
(binop(Iop_Sar64, binop(Iop_Shl64, _e, mkU8(63 - (_n))), mkU8(63 - (_n))))))
static IRStmt* dis_branch ( IRExpr* guard, ULong imm )
{
IRTemp t0;
t0 = newTemp(Ity_I1);
assign(t0, guard);
return IRStmt_Exit(mkexpr(t0), Ijk_Boring,
IRConst_U64(imm), OFFB_PC);
}
#define MARK_REG_WB(_rd, _td) \
do { \
vassert(rd_wb_index < 6); \
rd_wb_temp[rd_wb_index] = _td; \
rd_wb_reg[rd_wb_index] = _rd; \
rd_wb_index++; \
} while(0)
/* Expand/repeat byte _X 8 times to a 64-bit value */
#define V1EXP(_X) \
({ \
_X = ((((UChar)(_X)) << 8) | ((UChar)(_X))); \
_X = (((_X) << 16) | (_X)); \
(((_X) << 32) | (_X)); \
})
/* Expand/repeat byte _X 4 times to a 64-bit value */
#define V2EXP(_X) \
({ \
_X = ((((UChar)(_X)) << 16) | ((UChar)(_X))); \
(((_X) << 32) | (_X)); \
})
/*------------------------------------------------------------*/
/*--- Disassemble a single instruction ---*/
/*------------------------------------------------------------*/
/* Disassemble a single instruction bundle into IR. The bundle is
located in host memory at guest_instr, and has guest IP of
guest_PC_curr_instr, which will have been set before the call
here. */
static DisResult disInstr_TILEGX_WRK ( Bool(*resteerOkFn) (void *, Addr),
Bool resteerCisOk,
void *callback_opaque,
Long delta64,
const VexArchInfo * archinfo,
const VexAbiInfo * abiinfo,
Bool sigill_diag )
{
struct tilegx_decoded_instruction
decoded[TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE];
ULong cins, opcode = -1, rd, ra, rb, imm = 0;
ULong opd[4];
ULong opd_src_map, opd_dst_map, opd_imm_map;
Int use_dirty_helper;
IRTemp t0, t1, t2, t3, t4;
IRTemp tb[4];
IRTemp rd_wb_temp[6];
ULong rd_wb_reg[6];
/* Tilegx is a VLIW processor, we have to commit register write after read.*/
Int rd_wb_index;
Int n = 0, nr_insn;
DisResult dres;
/* The running delta */
Long delta = delta64;
/* Holds pc at the start of the insn, so that we can print
consistent error messages for unimplemented insns. */
//Long delta_start = delta;
UChar *code = (UChar *) (guest_code + delta);
IRStmt *bstmt = NULL; /* Branch statement. */
IRExpr *next = NULL; /* Next bundle expr. */
ULong jumpkind = Ijk_Boring;
ULong steering_pc;
/* Set result defaults. */
dres.whatNext = Dis_Continue;
dres.len = 0;
dres.continueAt = 0;
dres.jk_StopHere = Ijk_INVALID;
/* Verify the code addr is 8-byte aligned. */
vassert((((Addr)code) & 7) == 0);
/* Get the instruction bundle. */
cins = *((ULong *)(Addr) code);
/* "Special" instructions. */
/* Spot the 16-byte preamble: ****tilegx****
0:02b3c7ff91234fff { moveli zero, 4660 ; moveli zero, 22136 }
8:0091a7ff95678fff { moveli zero, 22136 ; moveli zero, 4660 }
*/
#define CL_W0 0x02b3c7ff91234fffULL
#define CL_W1 0x0091a7ff95678fffULL
if (*((ULong*)(Addr)(code)) == CL_W0 &&
*((ULong*)(Addr)(code + 8)) == CL_W1) {
/* Got a "Special" instruction preamble. Which one is it? */
if (*((ULong*)(Addr)(code + 16)) ==
0x283a69a6d1483000ULL /* or r13, r13, r13 */ ) {
/* r0 = client_request ( r12 ) */
DIP("r0 = client_request ( r12 )\n");
putPC(mkU64(guest_PC_curr_instr + 24));
dres.jk_StopHere = Ijk_ClientReq;
dres.whatNext = Dis_StopHere;
dres.len = 24;
goto decode_success;
} else if (*((ULong*)(Addr)(code + 16)) ==
0x283a71c751483000ULL /* or r14, r14, r14 */ ) {
/* r11 = guest_NRADDR */
DIP("r11 = guest_NRADDR\n");
dres.len = 24;
putIReg(11, IRExpr_Get(offsetof(VexGuestTILEGXState, guest_NRADDR),
Ity_I64));
putPC(mkU64(guest_PC_curr_instr + 8));
goto decode_success;
} else if (*((ULong*)(Addr)(code + 16)) ==
0x283a79e7d1483000ULL /* or r15, r15, r15 */ ) {
/* branch-and-link-to-noredir r12 */
DIP("branch-and-link-to-noredir r12\n");
dres.len = 24;
putIReg(55, mkU64(guest_PC_curr_instr + 24));
putPC(getIReg(12));
dres.jk_StopHere = Ijk_NoRedir;
dres.whatNext = Dis_StopHere;
goto decode_success;
} else if (*((ULong*)(Addr)(code + 16)) ==
0x283a5965d1483000ULL /* or r11, r11, r11 */ ) {
/* vex-inject-ir */
DIP("vex-inject-ir\n");
dres.len = 24;
vex_inject_ir(irsb, Iend_LE);
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_CMSTART),
mkU64(guest_PC_curr_instr)));
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_CMLEN),
mkU64(24)));
/* 2 + 1 = 3 bundles. 24 bytes. */
putPC(mkU64(guest_PC_curr_instr + 24));
dres.jk_StopHere = Ijk_InvalICache;
dres.whatNext = Dis_StopHere;
goto decode_success;
}
/* We don't expect this. */
vex_printf("%s: unexpect special bundles at %lx\n",
__func__, (Addr)guest_PC_curr_instr);
delta += 16;
goto decode_failure;
/*NOTREACHED*/
}
/* To decode the given instruction bundle. */
nr_insn = parse_insn_tilegx((tilegx_bundle_bits)cins,
(ULong)(Addr)code,
decoded);
if (vex_traceflags & VEX_TRACE_FE)
decode_and_display(&cins, 1, (ULong)(Addr)code);
/* Init. rb_wb_index */
rd_wb_index = 0;
steering_pc = -1ULL;
for (n = 0; n < nr_insn; n++) {
opcode = decoded[n].opcode->mnemonic;
Int opi;
rd = ra = rb = -1;
opd[0] = opd[1] = opd[2] = opd[3] = -1;
opd_dst_map = 0;
opd_src_map = 0;
opd_imm_map = 0;
for (opi = 0; opi < decoded[n].opcode->num_operands; opi++) {
const struct tilegx_operand *op = decoded[n].operands[opi];
opd[opi] = decoded[n].operand_values[opi];
/* Set the operands. rd, ra, rb and imm. */
if (opi < 3) {
if (op->is_dest_reg) {
if (rd == -1)
rd = decoded[n].operand_values[opi];
else if (ra == -1)
ra = decoded[n].operand_values[opi];
} else if (op->is_src_reg) {
if (ra == -1) {
ra = decoded[n].operand_values[opi];
} else if(rb == -1) {
rb = decoded[n].operand_values[opi];
} else {
vassert(0);
}
} else {
imm = decoded[n].operand_values[opi];
}
}
/* Build bit maps of used dest, source registers
and immediate. */
if (op->is_dest_reg) {
opd_dst_map |= 1ULL << opi;
if(op->is_src_reg)
opd_src_map |= 1ULL << opi;
} else if(op->is_src_reg) {
opd_src_map |= 1ULL << opi;
} else {
opd_imm_map |= 1ULL << opi;
}
}
use_dirty_helper = 0;
switch (opcode) {
case 0: /* "bpt" */ /* "raise" */
/* "bpt" pseudo instruction is an illegal instruction */
opd_imm_map |= (1 << 0);
opd[0] = cins;
use_dirty_helper = 1;
break;
case 1: /* "info" */ /* Ignore this instruction. */
break;
case 2: /* "infol" */ /* Ignore this instruction. */
break;
case 3: /* "ld4s_tls" */ /* Ignore this instruction. */
break;
case 4: /* "ld_tls" */ /* Ignore this instruction. */
break;
case 5: /* "move" */
t2 = newTemp(Ity_I64);
assign(t2, getIReg(ra));
MARK_REG_WB(rd, t2);
break;
case 6: /* "movei" */
t2 = newTemp(Ity_I64);
assign(t2, mkU64(extend_s_8to64(imm)));
MARK_REG_WB(rd, t2);
break;
case 7: /* "moveli" */
t2 = newTemp(Ity_I64);
assign(t2, mkU64(extend_s_16to64(imm)));
MARK_REG_WB(rd, t2);
break;
case 8: /* "prefetch" */ /* Ignore. */
break;
case 9: /* "prefetch_add_l1" */ /* Ignore. */
break;
case 10: /* "prefetch_add_l1_fault" */ /* Ignore. */
break;
case 11: /* "prefetch_add_l2" */ /* Ignore. */
break;
case 12: /* "prefetch_add_l2_fault" */ /* Ignore. */
break;
case 13: /* "prefetch_add_l3" */ /* Ignore. */
break;
case 14: /* "prefetch_add_l3_fault" */ /* Ignore. */
break;
case 15: /* "prefetch_l1" */ /* Ignore. */
break;
case 16: /* "prefetch_l1_fault" */ /* Ignore. */
break;
case 17: /* "prefetch_l2" */ /* Ignore. */
break;
case 18: /* "prefetch_l2_fault" */ /* Ignore. */
break;
case 19: /* "prefetch_l3" */ /* Ignore. */
break;
case 20: /* "prefetch_l3_fault" */ /* Ignore. */
break;
case 21: /* "raise" */
/* "raise" pseudo instruction is an illegal instruction plusing
a "moveli zero, <sig>", so we need save whole bundle in the
opd[0], which will be used in the dirty helper. */
opd_imm_map |= (1 << 0);
opd[0] = cins;
use_dirty_helper = 1;
break;
case 22: /* "add" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64, getIReg(ra), getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 23: /* "addi" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64, getIReg(ra),
mkU64(extend_s_8to64(imm))));
MARK_REG_WB(rd, t2);
break;
case 24: /* "addli" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64, getIReg(ra),
mkU64(extend_s_16to64(imm))));
MARK_REG_WB(rd, t2);
break;
case 25: /* "addx" */
t2 = newTemp(Ity_I64);
assign(t2, signExtend(binop(Iop_Add32,
narrowTo(Ity_I32, getIReg(ra)),
narrowTo(Ity_I32, getIReg(rb))),
32));
MARK_REG_WB(rd, t2);
break;
case 26: /* "addxi" */
t2 = newTemp(Ity_I64);
assign(t2, signExtend(binop(Iop_Add32,
narrowTo(Ity_I32, getIReg(ra)),
mkU32(imm)), 32));
MARK_REG_WB(rd, t2);
break;
case 27: /* "addxli" */
t2 = newTemp(Ity_I64);
assign(t2, signExtend(binop(Iop_Add32,
narrowTo(Ity_I32, getIReg(ra)),
mkU32(imm)), 32));
MARK_REG_WB(rd, t2);
break;
case 28: /* "addxsc" */
use_dirty_helper = 1;
break;
case 29: /* "and" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_And64, getIReg(ra), getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 30: /* "andi" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_And64, getIReg(ra),
mkU64(extend_s_8to64(imm))));
MARK_REG_WB(rd, t2);
break;
case 31: /* "beqz" */
/* Fall-through */
case 32:
/* "beqzt" */
bstmt = dis_branch(binop(Iop_CmpEQ64, getIReg(ra), mkU64(0)),
imm);
break;
case 33: /* "bfexts" */
{
ULong imm0 = decoded[n].operand_values[3];
ULong mask = ((-1ULL) ^ ((-1ULL << ((imm0 - imm) & 63)) << 1));
t0 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t0, binop(Iop_Xor64,
binop(Iop_Sub64,
binop(Iop_And64,
binop(Iop_Shr64,
getIReg(ra),
mkU8(imm0)),
mkU64(1)),
mkU64(1)),
mkU64(-1ULL)));
assign(t2,
binop(Iop_Or64,
binop(Iop_And64,
binop(Iop_Or64,
binop(Iop_Shr64,
getIReg(ra),
mkU8(imm)),
binop(Iop_Shl64,
getIReg(ra),
mkU8(64 - imm))),
mkU64(mask)),
binop(Iop_And64,
mkexpr(t0),
mkU64(~mask))));
MARK_REG_WB(rd, t2);
}
break;
case 34: /* "bfextu" */
{
ULong imm0 = decoded[n].operand_values[3];
ULong mask = 0;
t2 = newTemp(Ity_I64);
mask = ((-1ULL) ^ ((-1ULL << ((imm0 - imm) & 63)) << 1));
assign(t2,
binop(Iop_And64,
binop(Iop_Or64,
binop(Iop_Shr64,
getIReg(ra),
mkU8(imm)),
binop(Iop_Shl64,
getIReg(ra),
mkU8(64 - imm))),
mkU64(mask)));
MARK_REG_WB(rd, t2);
}
break;
case 35: /* "bfins" */
{
ULong mask;
ULong imm0 = decoded[n].operand_values[3];
t0 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
if (imm <= imm0)
{
mask = ((-1ULL << imm) ^ ((-1ULL << imm0) << 1));
}
else
{
mask = ((-1ULL << imm) | (-1ULL >> (63 - imm0)));
}
assign(t0, binop(Iop_Or64,
binop(Iop_Shl64,
getIReg(ra),
mkU8(imm)),
binop(Iop_Shr64,
getIReg(ra),
mkU8(64 - imm))));
assign(t2, binop(Iop_Or64,
binop(Iop_And64,
mkexpr(t0),
mkU64(mask)),
binop(Iop_And64,
getIReg(rd),
mkU64(~mask))));
MARK_REG_WB(rd, t2);
}
break;
case 36: /* "bgez" */
/* Fall-through */
case 37: /* "bgezt" */
bstmt = dis_branch(binop(Iop_CmpEQ64,
binop(Iop_And64,
getIReg(ra),
mkU64(0x8000000000000000ULL)),
mkU64(0x0)),
imm);
break;
case 38: /* "bgtz" */
/* Fall-through */
case 39:
/* "bgtzt" */
bstmt = dis_branch(unop(Iop_Not1,
binop(Iop_CmpLE64S,
getIReg(ra),
mkU64(0))),
imm);
break;
case 40: /* "blbc" */
/* Fall-through */
case 41: /* "blbct" */
bstmt = dis_branch(unop(Iop_64to1,
unop(Iop_Not64, getIReg(ra))),
imm);
break;
case 42: /* "blbs" */
/* Fall-through */
case 43:
/* "blbst" */
bstmt = dis_branch(unop(Iop_64to1,
getIReg(ra)),
imm);
break;
case 44: /* "blez" */
bstmt = dis_branch(binop(Iop_CmpLE64S, getIReg(ra),
mkU64(0)),
imm);
break;
case 45: /* "blezt" */
bstmt = dis_branch(binop(Iop_CmpLE64S, getIReg(ra),
mkU64(0)),
imm);
break;
case 46: /* "bltz" */
bstmt = dis_branch(binop(Iop_CmpLT64S, getIReg(ra),
mkU64(0)),
imm);
break;
case 47: /* "bltzt" */
bstmt = dis_branch(binop(Iop_CmpLT64S, getIReg(ra),
mkU64(0)),
imm);
break;
case 48: /* "bnez" */
/* Fall-through */
case 49:
/* "bnezt" */
bstmt = dis_branch(binop(Iop_CmpNE64, getIReg(ra),
mkU64(0)),
imm);
break;
case 50: /* "clz" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_Clz64, getIReg(ra)));
MARK_REG_WB(rd, t2);
break;
case 51: /* "cmoveqz rd, ra, rb" */
t2 = newTemp(Ity_I64);
assign(t2, IRExpr_ITE(binop(Iop_CmpEQ64, getIReg(ra), mkU64(0)),
getIReg(rb), getIReg(rd)));
MARK_REG_WB(rd, t2);
break;
case 52: /* "cmovnez" */
t2 = newTemp(Ity_I64);
assign(t2, IRExpr_ITE(binop(Iop_CmpEQ64, getIReg(ra), mkU64(0)),
getIReg(rd), getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 53: /* "cmpeq" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64, binop(Iop_CmpEQ64,
getIReg(ra), getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 54: /* "cmpeqi" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64, binop(Iop_CmpEQ64,
getIReg(ra),
mkU64(extend_s_8to64(imm)))));
MARK_REG_WB(rd, t2);
break;
case 55: /* "cmpexch" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, getIReg(rb));
stmt( IRStmt_CAS(mkIRCAS(IRTemp_INVALID, t2, Iend_LE,
getIReg(ra),
NULL, binop(Iop_Add64,
getIReg(70),
getIReg(71)),
NULL, mkexpr(t1))));
MARK_REG_WB(rd, t2);
break;
case 56: /* "cmpexch4" */
t1 = newTemp(Ity_I32);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I32);
assign(t1, narrowTo(Ity_I32, getIReg(rb)));
stmt( IRStmt_CAS(mkIRCAS(IRTemp_INVALID, t3, Iend_LE,
getIReg(ra),
NULL,
narrowTo(Ity_I32, binop(Iop_Add64,
getIReg(70),
getIReg(71))),
NULL,
mkexpr(t1))));
assign(t2, unop(Iop_32Uto64, mkexpr(t3)));
MARK_REG_WB(rd, t2);
break;
case 57: /* "cmples" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64,
binop(Iop_CmpLE64S, getIReg(ra), getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 58: /* "cmpleu" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64,
binop(Iop_CmpLE64U, getIReg(ra), getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 59: /* "cmplts" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64,
binop(Iop_CmpLT64S, getIReg(ra), getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 60: /* "cmpltsi" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64,
binop(Iop_CmpLT64S,
getIReg(ra),
mkU64(extend_s_8to64(imm)))));
MARK_REG_WB(rd, t2);
break;
case 61:
/* "cmpltu" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64,
binop(Iop_CmpLT64U, getIReg(ra), getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 62: /* "cmpltui" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64,
binop(Iop_CmpLT64U,
getIReg(ra),
mkU64(imm))));
MARK_REG_WB(rd, t2);
break;
case 63: /* "cmpne" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_1Uto64,
binop(Iop_CmpNE64, getIReg(ra), getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 64:
/* Fall-through */
case 65:
/* Fall-through */
case 66:
/* Fall-through */
case 67:
/* Fall-through */
case 68:
/* Fall-through */
case 69:
/* Fall-through */
case 70:
/* Fall-through */
case 71:
/* Fall-through */
case 72:
use_dirty_helper = 1;
break;
case 73: /* "ctz" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_Ctz64, getIReg(ra)));
MARK_REG_WB(rd, t2);
break;
case 74: /* "dblalign" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
/* t0 is the bit shift amount */
assign(t0, binop(Iop_Shl64,
binop(Iop_And64,
getIReg(rb),
mkU64(7)),
mkU8(3)));
assign(t1, binop(Iop_Sub64,
mkU64(64),
mkexpr(t0)));
assign(t2, binop(Iop_Or64,
binop(Iop_Shl64,
getIReg(ra),
unop(Iop_64to8, mkexpr(t1))),
binop(Iop_Shr64,
getIReg(rd),
unop(Iop_64to8, mkexpr(t0)))));
MARK_REG_WB(rd, t2);
break;
case 75:
/* Fall-through */
case 76:
/* Fall-through */
case 77:
/* Fall-through */
case 78:
/* Fall-through */
case 79:
use_dirty_helper = 1;
break;
case 80: /* "exch" */
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t2,
Iend_LE,
getIReg(ra),
NULL,
mkU64(0x0),
NULL,
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 81: /* "exch4 rd, ra, rb" */
t0 = newTemp(Ity_I32);
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t0,
Iend_LE,
getIReg(ra),
NULL,
mkU32(0x0),
NULL,
narrowTo(Ity_I32,
getIReg(rb)))));
assign(t2, unop(Iop_32Sto64, mkexpr(t0)));
MARK_REG_WB(rd, t2);
break;
case 82:
/* Fall-through */
case 83:
/* Fall-through */
case 84:
/* Fall-through */
case 85:
/* Fall-through */
case 86:
/* Fall-through */
case 87:
/* Fall-through */
case 88:
/* Fall-through */
case 89:
use_dirty_helper = 1;
break;
case 90: /* "fetchadd" */
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t2,
Iend_LE,
getIReg(ra),
NULL,
// fetchadd=3
mkU64(0x3),
NULL,
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 91: /* "fetchadd4" */
t0 = newTemp(Ity_I32);
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t0,
Iend_LE,
getIReg(ra),
NULL,
// fetchadd=3
mkU32(0x3),
NULL,
narrowTo(Ity_I32,
getIReg(rb)))));
assign(t2, unop(Iop_32Sto64, mkexpr(t0)));
MARK_REG_WB(rd, t2);
break;
case 92: /* "fetchaddgez" */
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t2,
Iend_LE,
getIReg(ra),
NULL,
// fetchaddgez=5
mkU64(0x5),
NULL,
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 93: /* "fetchaddgez4" */
t0 = newTemp(Ity_I32);
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t0,
Iend_LE,
getIReg(ra),
NULL,
// fetchaddgez=5
mkU32(0x5),
NULL,
narrowTo(Ity_I32,
getIReg(rb)))));
assign(t2, unop(Iop_32Sto64, mkexpr(t0)));
MARK_REG_WB(rd, t2);
break;
case 94: /* "fetchand\n") */
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t2,
Iend_LE,
getIReg(ra),
NULL,
mkU64(0x2),
NULL,
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 95:
/* mkIRCAS.
0: xch### 1: cmpexch###,
2: fetchand## 3: fetchadd##
4: fetchor## 5: fetchaddgez
*/
/* "fetchand4" */
t0 = newTemp(Ity_I32);
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t0,
Iend_LE,
getIReg(ra),
NULL,
mkU32(0x2),
NULL,
narrowTo(Ity_I32,
getIReg(rb)))));
assign(t2, unop(Iop_32Sto64, mkexpr(t0)));
MARK_REG_WB(rd, t2);
break;
case 96: /* "fetchor" */
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t2,
Iend_LE,
getIReg(ra),
NULL,
mkU64(0x4),
NULL,
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 97: /* "fetchor4" */
t0 = newTemp(Ity_I32);
t2 = newTemp(Ity_I64);
stmt( IRStmt_CAS(
mkIRCAS(IRTemp_INVALID,
t0,
Iend_LE,
getIReg(ra),
NULL,
mkU32(0x4),
NULL,
narrowTo(Ity_I32,
getIReg(rb)))));
assign(t2, unop(Iop_32Sto64, mkexpr(t0)));
MARK_REG_WB(rd, t2);
break;
case 98:
/* Fall-through */
case 99:
/* Fall-through */
case 100:
use_dirty_helper = 1;
break;
case 101: /* "fnop" Ignore */
break;
case 102:
/* Fall-through */
case 103:
/* Fall-through */
case 104:
/* Fall-through */
case 105:
/* Fall-through */
case 106:
/* Fall-through */
case 107:
/* Fall-through */
case 108:
use_dirty_helper = 1;
break;
case 109:
/* Fall-through */
case 110:
/* Fall-through */
case 111:
use_dirty_helper = 1;
break;
case 112: /* "iret" */
next = mkU64(guest_PC_curr_instr + 8);
jumpkind = Ijk_Ret;
break;
case 113: /* "j" */
next = mkU64(imm);
/* set steering address. */
steering_pc = imm;
jumpkind = Ijk_Boring;
break;
case 114:
t2 = newTemp(Ity_I64);
assign(t2, mkU64(guest_PC_curr_instr + 8));
/* set steering address. */
steering_pc = imm;
next = mkU64(imm);
jumpkind = Ijk_Call;
MARK_REG_WB(55, t2);
break;
case 115: /* "jalr" */
/* Fall-through */
case 116: /* "jalrp" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, getIReg(ra));
assign(t2, mkU64(guest_PC_curr_instr + 8));
next = mkexpr(t1);
jumpkind = Ijk_Call;
MARK_REG_WB(55, t2);
break;
case 117: /* "jr" */
/* Fall-through */
case 118: /* "jrp" */
next = getIReg(ra);
jumpkind = Ijk_Boring;
break;
case 119: /* "ld" */
t2 = newTemp(Ity_I64);
assign(t2, load(Ity_I64, (getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 120: /* "ld1s" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_8Sto64,
load(Ity_I8, (getIReg(ra)))));
MARK_REG_WB(rd, t2);
break;
case 121: /* "ld1s_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, unop(Iop_8Sto64,
load(Ity_I8, (getIReg(ra)))));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 122: /* "ld1u" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_8Uto64,
load(Ity_I8, (getIReg(ra)))));
MARK_REG_WB(rd, t2);
break;
case 123: /* "ld1u_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, unop(Iop_8Uto64,
load(Ity_I8, (getIReg(ra)))));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 124: /* "ld2s" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_16Sto64,
load(Ity_I16, getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 125: /* "ld2s_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, unop(Iop_16Sto64,
load(Ity_I16, getIReg(ra))));
MARK_REG_WB(rd, t2);
MARK_REG_WB(ra, t1);
break;
case 126: /* "ld2u" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_16Uto64,
load(Ity_I16, getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 127: /* "ld2u_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, unop(Iop_16Uto64,
load(Ity_I16, getIReg(ra))));
MARK_REG_WB(rd, t2);
MARK_REG_WB(ra, t1);
break;
case 128: /* "ld4s" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
load(Ity_I32, (getIReg(ra)))));
MARK_REG_WB(rd, t2);
break;
case 129: /* "ld4s_add" */
t2 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, unop(Iop_32Sto64,
load(Ity_I32, (getIReg(ra)))));
MARK_REG_WB(rd, t2);
MARK_REG_WB(ra, t1);
break;
case 130: /* "ld4u" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Uto64,
load(Ity_I32, getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 131: /* "ld4u_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, unop(Iop_32Uto64,
load(Ity_I32, getIReg(ra))));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 132: /* "ld_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, load(Ity_I64, getIReg(ra)));
assign(t2, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
MARK_REG_WB(ra, t2);
MARK_REG_WB(rd, t1);
break;
case 133: /* "ldna" */
t2 = newTemp(Ity_I64);
assign(t2, load(Ity_I64,
binop(Iop_And64,
getIReg(ra),
unop(Iop_Not64,
mkU64(7)))));
MARK_REG_WB(rd, t2);
break;
case 134: /* "ldna_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, load(Ity_I64,
binop(Iop_And64,
getIReg(ra),
unop(Iop_Not64,
mkU64(7)))));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 135: /* "ldnt" */
/* Valgrind IR has no Non-Temp load. Use normal load. */
t2 = newTemp(Ity_I64);
assign(t2, load(Ity_I64, (getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 136: /* "ldnt1s" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_8Sto64,
load(Ity_I8, (getIReg(ra)))));
MARK_REG_WB(rd, t2);
break;
case 137: /* "ldnt1s_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_8Sto64,
load(Ity_I8, (getIReg(ra)))));
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 138: /* "ldnt1u" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_8Uto64,
load(Ity_I8, (getIReg(ra)))));
MARK_REG_WB(rd, t2);
break;
case 139: /* "ldnt1u_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
assign(t2, unop(Iop_8Uto64,
load(Ity_I8, (getIReg(ra)))));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 140: /* "ldnt2s" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_16Sto64,
load(Ity_I16, getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 141: /* "ldnt2s_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_16Sto64,
load(Ity_I16, getIReg(ra))));
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 142: /* "ldnt2u" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_16Uto64,
load(Ity_I16, getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 143: /* "ldnt2u_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_16Uto64,
load(Ity_I16, getIReg(ra))));
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
MARK_REG_WB(ra, t1);
MARK_REG_WB(rd, t2);
break;
case 144: /* "ldnt4s" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
load(Ity_I32, (getIReg(ra)))));
MARK_REG_WB(rd, t2);
break;
case 145: /* "ldnt4s_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
load(Ity_I32, (getIReg(ra)))));
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
MARK_REG_WB(rd, t2);
MARK_REG_WB(ra, t1);
break;
case 146: /* "ldnt4u" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Uto64,
load(Ity_I32, getIReg(ra))));
MARK_REG_WB(rd, t2);
break;
case 147: /* "ldnt4u_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Uto64,
load(Ity_I32, getIReg(ra))));
assign(t1, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
MARK_REG_WB(rd, t2);
MARK_REG_WB(ra, t1);
break;
case 148: /* "ldnt_add" */
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t1, load(Ity_I64, getIReg(ra)));
assign(t2, binop(Iop_Add64, getIReg(ra), mkU64(imm)));
MARK_REG_WB(rd, t1);
MARK_REG_WB(ra, t2);
break;
case 149: /* "lnk" */
t2 = newTemp(Ity_I64);
assign(t2, mkU64(guest_PC_curr_instr + 8));
MARK_REG_WB(rd, t2);
break;
case 150: /* "mf" */
use_dirty_helper = 1;
break;
case 151: /* "mfspr" */
t2 = newTemp(Ity_I64);
if (imm == 0x2780) { // Get Cmpexch value
assign(t2, getIReg(70));
MARK_REG_WB(rd, t2);
} else if (imm == 0x2580) { // Get EX_CONTEXT_0_0
assign(t2, getIReg(576 / 8));
MARK_REG_WB(rd, t2);
} else if (imm == 0x2581) { // Get EX_CONTEXT_0_1
assign(t2, getIReg(584 / 8));
MARK_REG_WB(rd, t2);
} else
use_dirty_helper = 1;
break;
case 152: /* "mm" */
use_dirty_helper = 1;
break;
case 153: /* "mnz" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_And64,
unop(Iop_1Sto64, binop(Iop_CmpNE64,
getIReg(ra),
mkU64(0))),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 154: /* "mtspr imm, ra" */
if (imm == 0x2780) // Set Cmpexch value
putIReg(70, getIReg(ra));
else if (imm == 0x2580) // set EX_CONTEXT_0_0
putIReg(576/8, getIReg(ra));
else if (imm == 0x2581) // set EX_CONTEXT_0_1
putIReg(584/8, getIReg(ra));
else
use_dirty_helper = 1;
break;
case 155: /* "mul_hs_hs" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_MullS32,
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(ra),
mkU8(32))),
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(rb),
mkU8(32)))));
MARK_REG_WB(rd, t2);
break;
case 156: /* "mul_hs_hu" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
assign(t0, unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Shr64, getIReg(ra), mkU8(32)))));
assign(t1, binop(Iop_MullU32,
unop(Iop_64to32, mkexpr(t0)),
unop(Iop_64to32, binop(Iop_Shr64, getIReg(rb), mkU8(32)))));
assign(t3, binop(Iop_MullU32,
unop(Iop_64to32, binop(Iop_Shr64,
mkexpr(t0),
mkU8(32))),
unop(Iop_64to32, binop(Iop_Shr64, getIReg(rb), mkU8(32)))));
assign(t2, binop(Iop_Add64,
mkexpr(t1),
binop(Iop_Shl64,
mkexpr(t3),
mkU8(32))));
MARK_REG_WB(rd, t2);
break;
case 157: /* "mul_hs_ls" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_MullS32,
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(ra),
mkU8(32))),
unop(Iop_64to32,
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 158: /* "mul_hs_lu" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
assign(t0, unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Shr64, getIReg(ra), mkU8(32)))));
assign(t1, binop(Iop_MullU32,
unop(Iop_64to32, mkexpr(t0)),
unop(Iop_64to32, getIReg(rb))));
assign(t3, binop(Iop_MullU32,
unop(Iop_64to32, binop(Iop_Shr64,
mkexpr(t0),
mkU8(32))),
unop(Iop_64to32, getIReg(rb))));
assign(t2, binop(Iop_Add64,
mkexpr(t1),
binop(Iop_Shl64,
mkexpr(t3),
mkU8(32))));
MARK_REG_WB(rd, t2);
break;
case 159: /* "mul_hu_hu" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_MullU32,
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(ra),
mkU8(32))),
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(rb),
mkU8(32)))));
MARK_REG_WB(rd, t2);
break;
case 160: /* "mul_hu_ls" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
assign(t0, unop(Iop_32Sto64,
unop(Iop_64to32,
getIReg(ra))));
assign(t1, binop(Iop_MullU32,
unop(Iop_64to32, mkexpr(t0)),
unop(Iop_64to32, binop(Iop_Shr64, getIReg(rb), mkU8(32)))));
assign(t3, binop(Iop_MullU32,
unop(Iop_64to32, binop(Iop_Shr64,
mkexpr(t0),
mkU8(32))),
unop(Iop_64to32, binop(Iop_Shr64, getIReg(rb), mkU8(32)))));
assign(t2, binop(Iop_Add64,
mkexpr(t1),
binop(Iop_Shl64,
mkexpr(t3),
mkU8(32))));
MARK_REG_WB(rd, t2);
break;
case 161: /* "mul_hu_lu" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_MullU32,
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(ra),
mkU8(32))),
unop(Iop_64to32,
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 162: /* "mul_ls_ls" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_MullS32,
unop(Iop_64to32, getIReg(ra)),
unop(Iop_64to32, getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 163: /* "mul_ls_lu" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
assign(t0, unop(Iop_32Sto64,
unop(Iop_64to32, getIReg(ra))));
assign(t1, binop(Iop_MullU32,
unop(Iop_64to32, mkexpr(t0)),
unop(Iop_64to32, getIReg(rb))));
assign(t3, binop(Iop_MullU32,
unop(Iop_64to32, binop(Iop_Shr64,
mkexpr(t0),
mkU8(32))),
unop(Iop_64to32, getIReg(rb))));
assign(t2, binop(Iop_Add64,
mkexpr(t1),
binop(Iop_Shl64,
mkexpr(t3),
mkU8(32))));
MARK_REG_WB(rd, t2);
break;
case 164: /* "mul_lu_lu" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_MullU32,
unop(Iop_64to32, getIReg(ra)),
unop(Iop_64to32, getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 165: /* "mula_hs_hs" */
t0 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t0, binop(Iop_MullS32,
unop(Iop_64to32, binop(Iop_Shr64,
getIReg(ra), mkU8(32))),
unop(Iop_64to32, binop(Iop_Shr64,
getIReg(rb), mkU8(32)))));
assign(t2, binop(Iop_Add64, getIReg(rd), mkexpr(t0)));
MARK_REG_WB(rd, t2);
break;
case 166: /* "mula_hs_hu" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
t4 = newTemp(Ity_I64);
assign(t0, unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Shr64, getIReg(ra), mkU8(32)))));
assign(t1, binop(Iop_MullU32,
unop(Iop_64to32, mkexpr(t0)),
unop(Iop_64to32, binop(Iop_Shr64,
getIReg(rb), mkU8(32)))));
assign(t3, binop(Iop_MullU32,
unop(Iop_64to32, binop(Iop_Shr64,
mkexpr(t0),
mkU8(32))),
unop(Iop_64to32, binop(Iop_Shr64,
getIReg(rb), mkU8(32)))));
assign(t2, binop(Iop_Add64,
mkexpr(t1),
binop(Iop_Shl64,
mkexpr(t3),
mkU8(32))));
assign(t4, binop(Iop_Add64, getIReg(rd), mkexpr(t2)));
MARK_REG_WB(rd, t4);
break;
case 167: /* "mula_hs_ls" */
t2 = newTemp(Ity_I64);
t4 = newTemp(Ity_I64);
assign(t2, binop(Iop_MullS32,
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(ra),
mkU8(32))),
unop(Iop_64to32,
getIReg(rb))));
assign(t4, binop(Iop_Add64, getIReg(rd), mkexpr(t2)));
MARK_REG_WB(rd, t4);
break;
case 168: /* "mula_hs_lu" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
t4 = newTemp(Ity_I64);
assign(t0, unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Shr64, getIReg(ra), mkU8(32)))));
assign(t1, binop(Iop_MullU32,
unop(Iop_64to32, mkexpr(t0)),
unop(Iop_64to32, getIReg(rb))));
assign(t3, binop(Iop_MullU32,
unop(Iop_64to32, binop(Iop_Shr64,
mkexpr(t0),
mkU8(32))),
unop(Iop_64to32, getIReg(rb))));
assign(t2, binop(Iop_Add64,
mkexpr(t1),
binop(Iop_Shl64,
mkexpr(t3),
mkU8(32))));
assign(t4, binop(Iop_Add64, getIReg(rd), mkexpr(t2)));
MARK_REG_WB(rd, t4);
break;
case 169: /* "mula_hu_hu" */
use_dirty_helper = 1;
break;
case 170: /* "mula_hu_ls" */
use_dirty_helper = 1;
break;
case 171: /* "mula_hu_lu" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64,
binop(Iop_MullU32,
unop(Iop_64to32,
binop(Iop_Shr64,
getIReg(ra),
mkU8(32))),
unop(Iop_64to32,
getIReg(rb))),
getIReg(rd)));
MARK_REG_WB(rd, t2);
break;
case 172: /* "mula_ls_ls" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64,
getIReg(rd),
binop(Iop_MullS32,
unop(Iop_64to32, getIReg(ra)),
unop(Iop_64to32, getIReg(rb)))));
MARK_REG_WB(rd, t2);
break;
case 173: /* "mula_ls_lu" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
assign(t0, unop(Iop_32Sto64,
unop(Iop_64to32, getIReg(ra))));
assign(t1, binop(Iop_MullU32,
unop(Iop_64to32, mkexpr(t0)),
unop(Iop_64to32, getIReg(rb))));
assign(t3, binop(Iop_MullU32,
unop(Iop_64to32, binop(Iop_Shr64,
mkexpr(t0),
mkU8(32))),
unop(Iop_64to32, getIReg(rb))));
assign(t2, binop(Iop_Add64,
getIReg(rd),
binop(Iop_Add64,
mkexpr(t1),
binop(Iop_Shl64,
mkexpr(t3),
mkU8(32)))));
MARK_REG_WB(rd, t2);
break;
case 174: /* "mula_lu_lu" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64,
binop(Iop_MullU32,
unop(Iop_64to32,
getIReg(ra)),
unop(Iop_64to32,
getIReg(rb))),
getIReg(rd)));
MARK_REG_WB(rd, t2);
break;
case 175: /* "mulax" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Add64,
getIReg(rd),
binop(Iop_MullU32,
narrowTo(Ity_I32, getIReg(ra)),
narrowTo(Ity_I32, getIReg(rb)))))));
MARK_REG_WB(rd, t2);
break;
case 176: /* "mulx" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_MullU32,
narrowTo(Ity_I32, getIReg(ra)),
narrowTo(Ity_I32, getIReg(rb))))));
MARK_REG_WB(rd, t2);
break;
case 177: /* "mz" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_And64,
unop(Iop_1Sto64, binop(Iop_CmpEQ64,
getIReg(ra),
mkU64(0))),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 178: /* "nap" */
break;
case 179: /* "nop" */
break;
case 180: /* "nor" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_Not64,
binop(Iop_Or64,
getIReg(ra),
getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 181: /* "or" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Or64,
getIReg(ra),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 182: /* "ori" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Or64,
getIReg(ra),
mkU64(imm)));
MARK_REG_WB(rd, t2);
break;
case 183:
/* Fall-through */
case 184:
/* Fall-through */
case 185:
use_dirty_helper = 1;
break;
case 186: /* "rotl" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t0, binop(Iop_Shl64,
getIReg(ra),
unop(Iop_64to8, getIReg(rb))));
assign(t1, binop(Iop_Shr64,
getIReg(ra),
unop(Iop_64to8, binop(Iop_Sub64,
mkU64(0),
getIReg(rb)))));
assign(t2, binop(Iop_Or64, mkexpr(t0), mkexpr(t1)));
MARK_REG_WB(rd, t2);
break;
case 187: /* "rotli" */
t0 = newTemp(Ity_I64);
t1 = newTemp(Ity_I64);
t2 = newTemp(Ity_I64);
assign(t0, binop(Iop_Shl64,
getIReg(ra),
mkU8(imm)));
assign(t1, binop(Iop_Shr64,
getIReg(ra),
mkU8(0 - imm)));
assign(t2, binop(Iop_Or64, mkexpr(t0), mkexpr(t1)));
MARK_REG_WB(rd, t2);
break;
case 188: /* "shl" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Shl64,
getIReg(ra),
unop(Iop_64to8, getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 189: /* "shl16insli" */
t2 = newTemp(Ity_I64);
t3 = newTemp(Ity_I64);
assign(t3, binop(Iop_Shl64, getIReg(ra), mkU8(16)));
imm &= 0xFFFFULL;
if (imm & 0x8000)
{
t4 = newTemp(Ity_I64);
assign(t4, mkU64(imm));
assign(t2, binop(Iop_Add64, mkexpr(t3), mkexpr(t4)));
}
else
{
assign(t2, binop(Iop_Add64, mkexpr(t3), mkU64(imm)));
}
MARK_REG_WB(rd, t2);
break;
case 190: /* "shl1add" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64,
binop(Iop_Shl64,
getIReg(ra), mkU8(1)),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 191: /* "shl1addx" */
t2 = newTemp(Ity_I64);
assign(t2,
unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Add64,
binop(Iop_Shl64,
getIReg(ra), mkU8(1)),
getIReg(rb)))));
MARK_REG_WB(rd, t2);
break;
case 192: /* "shl2add" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64,
binop(Iop_Shl64,
getIReg(ra), mkU8(2)),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 193: /* "shl2addx" */
t2 = newTemp(Ity_I64);
assign(t2,
unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Add64,
binop(Iop_Shl64,
getIReg(ra), mkU8(2)),
getIReg(rb)))));
MARK_REG_WB(rd, t2);
break;
case 194: /* "shl3add" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Add64,
binop(Iop_Shl64,
getIReg(ra), mkU8(3)),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 195: /* "shl3addx" */
t2 = newTemp(Ity_I64);
assign(t2,
unop(Iop_32Sto64,
unop(Iop_64to32,
binop(Iop_Add64,
binop(Iop_Shl64,
getIReg(ra), mkU8(3)),
getIReg(rb)))));
MARK_REG_WB(rd, t2);
break;
case 196: /* "shli" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Shl64, getIReg(ra),
mkU8(imm)));
MARK_REG_WB(rd, t2);
break;
case 197: /* "shlx" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
binop(Iop_Shl32,
narrowTo(Ity_I32, getIReg(ra)),
narrowTo(Ity_I8, getIReg(rb)))));
MARK_REG_WB(rd, t2);
break;
case 198: /* "shlxi" */
t2 = newTemp(Ity_I64);
assign(t2, signExtend(binop(Iop_Shl32,
narrowTo(Ity_I32, getIReg(ra)),
mkU8(imm)),
32));
MARK_REG_WB(rd, t2);
break;
case 199: /* "shrs" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Sar64, getIReg(ra),
narrowTo(Ity_I8, getIReg(rb))));
MARK_REG_WB(rd, t2);
break;
case 200: /* "shrsi" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Sar64, getIReg(ra),
mkU8(imm)));
MARK_REG_WB(rd, t2);
break;
case 201: /* "shru" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Shr64,
getIReg(ra),
narrowTo(Ity_I8, (getIReg(rb)))));
MARK_REG_WB(rd, t2);
break;
case 202: /* "shrui" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Shr64, getIReg(ra), mkU8(imm)));
MARK_REG_WB(rd, t2);
break;
case 203: /* "shrux" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
(binop(Iop_Shr32,
narrowTo(Ity_I32, getIReg(ra)),
narrowTo(Ity_I8, getIReg(rb))))));
MARK_REG_WB(rd, t2);
break;
case 204: /* "shruxi" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
(binop(Iop_Shr32,
narrowTo(Ity_I32, getIReg(ra)),
mkU8(imm)))));
MARK_REG_WB(rd, t2);
break;
case 205: /* "shufflebytes" */
use_dirty_helper = 1;
break;
case 206: /* "st" */
store(getIReg(ra), getIReg(rb));
break;
case 207: /* "st1" */
store(getIReg(ra), narrowTo(Ity_I8, getIReg(rb)));
break;
case 208: /* "st1_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), narrowTo(Ity_I8, getIReg(opd[1])));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 209: /* "st2" */
store(getIReg(ra), narrowTo(Ity_I16, getIReg(rb)));
break;
case 210: /* "st2_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), narrowTo(Ity_I16, getIReg(opd[1])));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 211: /* "st4" */
store(getIReg(ra), narrowTo(Ity_I32, getIReg(rb)));
break;
case 212: /* "st4_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), narrowTo(Ity_I32, getIReg(opd[1])));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 213: /* "st_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), getIReg(opd[1]));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 214: /* "stnt" */
store(getIReg(ra), getIReg(rb));
break;
case 215: /* "stnt1" */
store(getIReg(ra), narrowTo(Ity_I8, getIReg(rb)));
break;
case 216: /* "stnt1_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), narrowTo(Ity_I8, getIReg(opd[1])));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 217: /* "stnt2" */
store(getIReg(ra), narrowTo(Ity_I16, getIReg(rb)));
break;
case 218: /* "stnt2_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), narrowTo(Ity_I16, getIReg(opd[1])));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 219: /* "stnt4" */
store(getIReg(ra), narrowTo(Ity_I32, getIReg(rb)));
break;
case 220: /* "stnt4_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), narrowTo(Ity_I32, getIReg(opd[1])));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 221: /* "stnt_add" */
t2 = newTemp(Ity_I64);
store(getIReg(opd[0]), getIReg(opd[1]));
assign(t2, binop(Iop_Add64, getIReg(opd[0]), mkU64(opd[2])));
MARK_REG_WB(opd[0], t2);
break;
case 222: /* "sub" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Sub64, getIReg(ra),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 223: /* "subx" */
t2 = newTemp(Ity_I64);
assign(t2, unop(Iop_32Sto64,
binop(Iop_Sub32,
narrowTo(Ity_I32, getIReg(ra)),
narrowTo(Ity_I32, getIReg(rb)))));
MARK_REG_WB(rd, t2);
break;
case 224: /* "subxsc" */
use_dirty_helper = 1;
break;
case 225: /* "swint0" */
vex_printf( "\n *** swint0 ***\n");
vassert(0);
break;
case 226: /* "swint1" */
next = mkU64(guest_PC_curr_instr + 8);
jumpkind = Ijk_Sys_syscall;
break;
case 227: /* "swint2" */
vex_printf( "\n *** swint2 ***\n");
vassert(0);
break;
case 228: /* "swint3" */
vex_printf( "\n *** swint3 ***\n");
vassert(0);
break;
case 229:
/* Fall-through */
case 230:
/* Fall-through */
case 231:
/* Fall-through */
case 232:
/* Fall-through */
case 233:
use_dirty_helper = 1;
break;
case 234:
opd[3] = V1EXP(opd[3]);
use_dirty_helper = 1;
break;
case 235:
/* Fall-through */
case 236:
/* Fall-through */
case 237:
use_dirty_helper = 1;
break;
case 238: /* "v1cmpeq" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_CmpEQ8x8, getIReg(ra),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 239: /* "v1cmpeqi" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_CmpEQ8x8, getIReg(ra),
mkU64(imm)));
MARK_REG_WB(rd, t2);
break;
case 240:
/* Fall-through */
case 241:
/* Fall-through */
case 242:
use_dirty_helper = 1;
break;
case 243:
opd[3] = V1EXP(opd[3]);
use_dirty_helper = 1;
break;
/* Fall-through */
case 244:
use_dirty_helper = 1;
break;
case 245:
opd[3] = V1EXP(opd[3]);
use_dirty_helper = 1;
break;
case 246: /* "v1cmpne" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_CmpEQ8x8,
binop(Iop_CmpEQ8x8, getIReg(ra),
getIReg(rb)),
getIReg(63)));
MARK_REG_WB(rd, t2);
break;
case 247:
/* Fall-through */
case 248:
/* Fall-through */
case 249:
/* Fall-through */
case 250:
/* Fall-through */
case 251:
/* Fall-through */
case 252:
/* Fall-through */
case 253:
/* Fall-through */
case 254:
/* Fall-through */
case 255:
/* Fall-through */
case 256:
/* Fall-through */
case 257:
/* Fall-through */
case 258:
/* Fall-through */
case 259:
use_dirty_helper = 1;
break;
case 260:
opd[3] = V1EXP(opd[3]);
use_dirty_helper = 1;
break;
case 261:
use_dirty_helper = 1;
break;
case 262:
opd[3] = V1EXP(opd[3]);
use_dirty_helper = 1;
break;
case 263:
/* Fall-through */
case 264:
/* Fall-through */
case 265:
/* Fall-through */
case 266:
/* Fall-through */
case 267:
/* Fall-through */
case 268:
/* Fall-through */
case 269:
/* Fall-through */
case 270:
use_dirty_helper = 1;
break;
case 271:
opd[3] = V1EXP(opd[3]);
use_dirty_helper = 1;
break;
case 272:
use_dirty_helper = 1;
break;
case 273:
opd[3] = V1EXP(opd[3]);
use_dirty_helper = 1;
break;
case 274:
use_dirty_helper = 1;
break;
case 275: /* "v1shrui" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Shr8x8,
getIReg(ra),
mkU64(imm)));
MARK_REG_WB(rd, t2);
break;
case 276:
/* Fall-through */
case 277:
/* Fall-through */
case 278:
use_dirty_helper = 1;
break;
case 279:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 280:
/* Fall-through */
case 281:
/* Fall-through */
case 282:
/* Fall-through */
case 283:
use_dirty_helper = 1;
break;
case 284:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 285:
/* Fall-through */
case 286:
/* Fall-through */
case 287:
use_dirty_helper = 1;
break;
case 288:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 289:
use_dirty_helper = 1;
break;
case 290:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 291:
/* Fall-through */
case 292:
/* Fall-through */
case 293:
/* Fall-through */
case 294:
/* Fall-through */
case 295:
/* Fall-through */
case 296:
use_dirty_helper = 1;
break;
case 297:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 298:
use_dirty_helper = 1;
break;
case 299:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 300:
/* Fall-through */
case 301:
/* Fall-through */
case 302:
/* Fall-through */
case 303:
/* Fall-through */
case 304:
/* Fall-through */
case 305:
/* Fall-through */
case 306:
/* Fall-through */
case 307:
/* Fall-through */
case 308:
/* Fall-through */
case 309:
/* Fall-through */
case 310:
/* Fall-through */
case 311:
/* Fall-through */
case 312:
use_dirty_helper = 1;
break;
case 313:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 314:
/* Fall-through */
case 315:
use_dirty_helper = 1;
break;
case 316:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 317:
use_dirty_helper = 1;
break;
case 318:
opd[3] = V2EXP(opd[3]);
use_dirty_helper = 1;
break;
case 319:
/* Fall-through */
case 320:
/* Fall-through */
case 321:
/* Fall-through */
case 322:
/* Fall-through */
case 323:
use_dirty_helper = 1;
break;
case 324: /* "v4int_l" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Or64,
binop(Iop_Shl64,
getIReg(ra),
mkU8(32)),
binop(Iop_And64,
getIReg(rb),
mkU64(0xFFFFFFFF))));
MARK_REG_WB(rd, t2);
break;
case 325:
/* Fall-through */
case 326:
/* Fall-through */
case 327:
/* Fall-through */
case 328:
/* Fall-through */
case 329:
/* Fall-through */
case 330:
/* Fall-through */
case 331:
use_dirty_helper = 1;
break;
case 332: /* "wh64" */ /* Ignore store hint */
break;
case 333: /* "xor" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Xor64,
getIReg(ra),
getIReg(rb)));
MARK_REG_WB(rd, t2);
break;
case 334: /* "xori" */
t2 = newTemp(Ity_I64);
assign(t2, binop(Iop_Xor64,
getIReg(ra),
mkU64(imm)));
MARK_REG_WB(rd, t2);
break;
case 335: /* "(null)" */ /* ignore */
break;
default:
decode_failure:
vex_printf("error: %d\n", (Int)opcode);
/* All decode failures end up here. */
vex_printf("vex tilegx->IR: unhandled instruction: "
"%s 0x%llx 0x%llx 0x%llx 0x%llx\n",
decoded[n].opcode->name,
opd[0], opd[1], opd[2], opd[3]);
/* Tell the dispatcher that this insn cannot be decoded, and so has
not been executed, and (is currently) the next to be executed. */
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_pc),
mkU64(guest_PC_curr_instr)));
dres.whatNext = Dis_StopHere;
dres.len = 0;
return dres;
}
/* Hook the dirty helper for rare instruxtions. */
if (use_dirty_helper)
{
Int i = 0;
Int wbc = 0;
IRExpr *opc_oprand[5];
opc_oprand[0] = mkU64(opcode);
/* Get the operand registers or immediate. */
for (i = 0 ; i < 4; i++)
{
opc_oprand[i + 1] = NULL;
if (opd_dst_map & (1ULL << i))
{
tb[wbc] = newTemp(Ity_I64);
wbc++;
opc_oprand[i + 1] = getIReg(opd[i]);
}
else if (opd_imm_map & (1ULL << i))
opc_oprand[i + 1] = mkU64(opd[i]);
else if (opd_src_map & (1ULL << i))
opc_oprand[i + 1] = getIReg(opd[i]);
else
opc_oprand[i + 1] = mkU64(0xfeee);
}
IRExpr **args = mkIRExprVec_5(opc_oprand[0], opc_oprand[1],
opc_oprand[2], opc_oprand[3],
opc_oprand[4]);
IRDirty *genIR = NULL;
switch (wbc) {
case 0:
{
genIR = unsafeIRDirty_0_N (0/*regparms*/,
"tilegx_dirtyhelper_gen",
&tilegx_dirtyhelper_gen,
args);
}
break;
case 1:
{
genIR = unsafeIRDirty_1_N (tb[0],
0/*regparms*/,
"tilegx_dirtyhelper_gen",
&tilegx_dirtyhelper_gen,
args);
}
break;
default:
vex_printf("opc = %d\n", (Int)opcode);
vassert(0);
}
stmt(IRStmt_Dirty(genIR));
wbc = 0;
for (i = 0 ; i < 4; i++)
{
if(opd_dst_map & (1 << i))
{
/* Queue the writeback destination registers. */
MARK_REG_WB(opd[i], tb[wbc]);
wbc++;
}
}
}
}
/* Write back registers for a bundle. Note have to get all source registers
for all instructions in a bundle before write the destinations b/c this is
an VLIW processor. */
for (n = 0; n < rd_wb_index; n++)
putIReg(rd_wb_reg[n], mkexpr(rd_wb_temp[n]));
/* Add branch IR if apply finally, only upto one branch per bundle. */
if (bstmt) {
stmt(bstmt);
dres.whatNext = Dis_StopHere;
dres.jk_StopHere = jumpkind;
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_pc),
mkU64(guest_PC_curr_instr + 8)));
} else if (next) {
if (steering_pc != -1ULL) {
if (resteerOkFn(callback_opaque, steering_pc)) {
dres.whatNext = Dis_ResteerU;
dres.continueAt = steering_pc;
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_pc),
mkU64(steering_pc)));
} else {
dres.whatNext = Dis_StopHere;
dres.jk_StopHere = jumpkind;
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_pc),
mkU64(steering_pc)));
}
} else {
dres.whatNext = Dis_StopHere;
dres.jk_StopHere = jumpkind;
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_pc), next));
}
} else {
/* As dafault dres.whatNext = Dis_Continue. */
stmt(IRStmt_Put(offsetof(VexGuestTILEGXState, guest_pc),
mkU64(guest_PC_curr_instr + 8)));
}
irsb->jumpkind = Ijk_Boring;
irsb->next = NULL;
dres.len = 8;
decode_success:
return dres;
}
/*------------------------------------------------------------*/
/*--- Top-level fn ---*/
/*------------------------------------------------------------*/
/* Disassemble a single instruction into IR. The instruction
is located in host memory at &guest_code[delta]. */
DisResult
disInstr_TILEGX ( IRSB* irsb_IN,
Bool (*resteerOkFn) (void *, Addr),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code_IN,
Long delta,
Addr guest_IP,
VexArch guest_arch,
const VexArchInfo* archinfo,
const VexAbiInfo* abiinfo,
VexEndness host_endness_IN,
Bool sigill_diag_IN )
{
DisResult dres;
/* Set globals (see top of this file) */
vassert(guest_arch == VexArchTILEGX);
guest_code = (UChar*)(Addr)guest_code_IN;
irsb = irsb_IN;
host_endness = host_endness_IN;
guest_PC_curr_instr = (Addr64) guest_IP;
guest_PC_bbstart = (Addr64) toUInt(guest_IP - delta);
dres = disInstr_TILEGX_WRK(resteerOkFn, resteerCisOk,
callback_opaque,
delta, archinfo, abiinfo, sigill_diag_IN);
return dres;
}
/*--------------------------------------------------------------------*/
/*--- end guest_tilegx_toIR.c ---*/
/*--------------------------------------------------------------------*/
|
1e86d59262ebec795940d2a67749bd00f17e5cf0
|
28922f4014c1dc1a1d65aa483cc9f16880cca91a
|
/src/bloomFilter.c
|
45a0d5ad15894a2d9c2627091dde6c49fd7c356f
|
[] |
no_license
|
clashrover/PlagiarismChecker
|
9a3038e46fcbe6bfab11e8d223f8dec3ff575b08
|
a290899f978d606c866feb1e500ac823ab23747e
|
refs/heads/master
| 2022-12-15T05:22:10.900425 | 2020-08-31T08:13:26 | 2020-08-31T08:13:26 | 290,142,881 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 2,178 |
c
|
bloomFilter.c
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
static long djb2(char* str, int hashtableSize) {
long hash = 5381;
for (int i = 0; i < strlen(str); i++) {
hash = ((hash << 5) + hash) + str[i];
}
return abs(hash) % hashtableSize;
}
static long sdbm(char* str, int hashtableSize) {
long hash = 0;
for (int i = 0; i < strlen(str); i++) {
hash = str[i] + (hash << 6) + (hash << 16) - hash;
}
return abs(hash) % (hashtableSize - 1) + 1;
}
struct bloomFilter
{
int size;
float false_prob;
int exp_n;
int hash_count;
int* arr;
int count;
};
typedef struct bloomFilter* bFilter;
bFilter newBloomFilter(float fp, int exp_n){
bFilter b = (bFilter)malloc(sizeof(struct bloomFilter));
b->false_prob = fp;
b->exp_n = exp_n;
float x = ((-1)*exp_n)*log(fp);
x=x/(log(2)*log(2));
b->size = x;
float y = (1.0*b->size) / (1.0*b->exp_n);
y=y*log(2);
b->hash_count = y;
b->arr = (int*) malloc(b->size * sizeof(int));
for(int i=0;i<b->size;i++){
b->arr[i]=0;
}
b->count =0;
return b;
}
long hashing(char* s, int size, int seed){
long index =(long) (djb2(s,size) + seed*sdbm(s,size));
return index;
}
void insert(char* s, bFilter b){
for(int i=0;i<b->hash_count;i++){
long hash = hashing(s,b->size,(i+1));
hash = hash% b->size;
b->arr[hash]=1;
}
b->count++;
}
int has(char* s, bFilter b){
for(int i=0;i<b->hash_count;i++){
long hash = hashing(s,b->size,(i+1));
hash = hash % b->size;
if(b->arr[hash]==0){
return 0;
}
}
return 1;
}
void show_bloom(bFilter b){
for(int i=0;i<b->size;i++){
printf("%d ",b->arr[i]);
}
printf("\n");
}
float cosine_sim(bFilter b1, bFilter b2){
float sum =0;
float s1=0;
float s2=0;
for(int i=0;i<b1->size;i++){
sum += (b1->arr[i]*b2->arr[i]);
s1+=b1->arr[i];
s2+=b2->arr[i];
}
s1=sqrt(s1);
s2=sqrt(s2);
sum = sum / (s1*s2);
return sum;
}
void free_bloom(bFilter b){
free(b->arr);
free(b);
}
|
b7ea13dae7be221309a28ea1d7f8ee461d2fd709
|
82b15b2f37d9c40753f26a6cae62d1da17bd39b7
|
/day-3/file2.c
|
82b24d9a0c500b4c34e0a338e50423e645598275
|
[] |
no_license
|
anuragteapot/CS341
|
53e2f8e9842ae2d8d4879d4685b7892db89b3df6
|
2bf5ffc6f55e4516c178967111ccc646a7d70f2f
|
refs/heads/master
| 2022-06-14T21:23:36.300837 | 2019-04-22T18:42:45 | 2019-04-22T18:42:45 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 641 |
c
|
file2.c
|
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int fac(int n)
{
if (n >= 1)
return n * fac(n - 1);
else
return 1;
}
int main(int argc, char **argv)
{
int i;
int n;
float a;
double res = 0;
sscanf(argv[0], "%f", &a);
n = atoi(argv[1]);
double temp;
for (i = 1; i <= n; i++)
{
temp = pow(a, i);
temp /= fac(i);
res += temp;
}
printf("Child(PID= %d): For x = %f the first %d terms yeilds %f ", getpid(), a, n, res);
exit(0);
}
|
b83753e1c5d7bdff02d69309bdc791353d4a47b1
|
9a543de4a6d3f51b72e8ca19c1548da0f8b8c220
|
/cmds/std/adv/rmtree.c
|
4716b3a3d39ccc7dba358bb652b1ff0fc8c8cb10
|
[] |
no_license
|
oiuv/RevivalWorldMud
|
51451e3405e37eeeb640b4deb7259394be6f1e9c
|
a0450064d4082fbcc14525a983ad9f1b78da8337
|
refs/heads/master
| 2020-04-14T06:11:52.974449 | 2019-01-28T04:09:07 | 2019-01-28T04:09:07 | 163,679,727 | 2 | 2 | null | 2019-04-02T05:15:23 | 2018-12-31T15:37:25 |
C
|
BIG5
|
C
| false | false | 1,286 |
c
|
rmtree.c
|
/* This program is a part of RW mudlib
* See /doc/help/copyright for more info
-----------------------------------------
* File : rmtree.c
* Author : Clode@RevivalWorld
* Date : 2002-06-03
* Note : rmtree 指令。
* Update :
* o 2000-00-00
*
-----------------------------------------
*/
#include <feature.h>
#include <message.h>
inherit COMMAND;
string help = @HELP
標準 rmtree 指令。
HELP;
private void confirm_rmtree(object me, string dir, string arg)
{
string msg = "";
array res;
if( !arg || lower_case(arg) != "y" )
return tell(me, "取消刪除 "+dir+" 目錄。\n", CMDMSG);
res = rmtree(dir);
foreach( string file in res[0] )
msg += "rm "+file+" Done...。\n";
foreach( string file in res[1] )
msg += "rm "+file+" Failed...。\n";
if( msg == "" )
msg = "rmtree "+dir+" Failed...。\n";
tell(me, msg, CMDMSG);
me->finish_input();
}
private void command(object me, string arg)
{
if( !is_command() ) return;
if( !arg )
return tell(me, "請輸入目錄路徑。\n", CMDMSG);
arg = resolve_path(me, arg);
if( file_size(arg) != -2 )
return tell(me, arg+" 並不是一個目錄。\n", CMDMSG);
tell(me, "確定刪除目錄:"+arg+" (Yes/No)?", CMDMSG);
input_to( (: confirm_rmtree, me, arg :) );
}
|
eed7b9e501dedff9164366616f6f83f7d2c12660
|
c2cedcf36667730f558ab354bea4505b616c90d2
|
/players/khrell/area/goblins/gobrm14.c
|
0034fb3679981624e630b5d50de6ffc05554a087
|
[] |
no_license
|
wugouzi/Nirvlp312mudlib
|
965ed876c7080ab00e28c5d8cd5ea9fc9e46258f
|
616cad7472279cc97c9693f893940f5336916ff8
|
refs/heads/master
| 2023-03-16T03:45:05.510851 | 2017-09-21T17:05:00 | 2017-09-21T17:05:00 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,135 |
c
|
gobrm14.c
|
#include "/players/khrell/define.h"
#include <ansi.h>
inherit "/players/vertebraker/closed/std/room.c";
reset(arg) {
if(arg) return;
set_short("("+HIK+"Darkness"+NORM+")");
set_long(
" There is no possible way to light this section of the tunnel. Any\n"+
"attempts to light it seems to be instantly smothered by the opressing\n"+
"darkness, absorbing it utterly. Adventurers can press on if they are\n"+
"brave or they can return to safer grounds. It would require great \n"+
"bravery to press on and should not taken lightly by any sane creature.\n");
set_light(-100);
add_property("no_teleport");
add_property("no_magic");
add_property("no_follow");
add_listen("main", "You hear nothing special.\n");
add_smell("main", "You smell nothing special.\n");
items = ({
"darkness", "Nothing but darkness not even light can penetrate it",
"tunnel", "No ammount of light can seem to exist here in this tunnel"
});
dest_dir = ({
"players/khrell/area/goblins/gobrm13.c", "flee",
"players/khrell/area/goblins/gobrm15.c", "ahead"
});
return 1;
}
|
4e760d34b1ffdb75827722d905e3cf86afe593d2
|
28a34e15d12654ffb30803d6f102fc51435c2432
|
/xdk/xdk-visual.c
|
2b3a97ab49ef9b428c5ede8afb0ca89c00d3bd0d
|
[] |
no_license
|
derekdai/xdk
|
f7f433ee228733542d9c8739d494031018cdc13d
|
5509d019df1f33a48a8a8daf9e346436a260f216
|
refs/heads/master
| 2016-09-05T15:42:43.542138 | 2012-09-26T08:08:20 | 2012-09-26T08:08:20 | 5,591,323 | 3 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 3,962 |
c
|
xdk-visual.c
|
#include "xdk-display.h"
#include "xdk-screen.h"
#include "xdk-visual.h"
#define XDK_VISUAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE(o, XDK_TYPE_VISUAL, XdkVisualPrivate))
struct _XdkVisualPrivate
{
Visual * peer;
guint depth;
gulong red_mask;
gulong green_mask;
gulong blue_mask;
gint colormap_size;
XdkScreen * screen;
Colormap colormap;
};
enum
{
PROP_INFO = 1,
PROP_SCREEN
};
static void xdk_visual_set_property(
GObject * object,
guint property_id,
const GValue * value,
GParamSpec * pspec);
static void xdk_visual_finalize(GObject * object);
G_DEFINE_TYPE(XdkVisual, xdk_visual, G_TYPE_OBJECT);
void xdk_visual_class_init(XdkVisualClass * clazz)
{
GObjectClass * gobject_class = G_OBJECT_CLASS(clazz);
gobject_class->set_property = xdk_visual_set_property;
gobject_class->finalize = xdk_visual_finalize;
g_object_class_install_property(
gobject_class,
PROP_INFO,
g_param_spec_pointer(
"info", "", "",
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(
gobject_class,
PROP_SCREEN,
g_param_spec_object(
"screen", "", "",
XDK_TYPE_SCREEN,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private(clazz, sizeof(XdkVisualPrivate));
}
void xdk_visual_init(XdkVisual * self)
{
self->priv = XDK_VISUAL_GET_PRIVATE(self);
self->priv->colormap = None;
}
static void xdk_visual_set_property(
GObject * object,
guint property_id,
const GValue * value,
GParamSpec * pspec)
{
XdkVisual * self = XDK_VISUAL(object);
XdkVisualPrivate * priv = self->priv;
switch(property_id) {
case PROP_INFO: {
XVisualInfo * info = g_value_get_pointer(value);
priv->peer = info->visual;
priv->depth = info->depth;
priv->red_mask = info->red_mask;
priv->green_mask = info->green_mask;
priv->blue_mask = info->blue_mask;
priv->colormap_size = info->colormap_size;
break;
}
case PROP_SCREEN:
self->priv->screen = g_value_get_object(value);
break;
default:
g_return_if_reached();
}
}
XdkVisual * xdk_visual_new(XVisualInfo * info, XdkScreen * screen)
{
g_return_val_if_fail(info, NULL);
g_return_val_if_fail(screen, NULL);
return g_object_new(
XDK_TYPE_VISUAL,
"info", info,
"screen", screen,
NULL);
}
static void xdk_visual_finalize(GObject * object)
{
XdkVisualPrivate * priv = XDK_VISUAL(object)->priv;
if(None != priv->colormap) {
XFreeColormap(
xdk_display_get_peer(xdk_screen_get_display(priv->screen)),
priv->colormap);
}
}
Visual * xdk_visual_get_peer(XdkVisual * self)
{
g_return_val_if_fail(self, NULL);
return self->priv->peer;
}
VisualID xdk_visual_get_id(XdkVisual * self)
{
g_return_val_if_fail(self, 0);
return XVisualIDFromVisual(self->priv->peer);
}
gint xdk_visual_get_depth(XdkVisual * self)
{
g_return_val_if_fail(self, 0);
return self->priv->depth;
}
XdkVisualType xdk_visual_get_visual_type(XdkVisual * self)
{
g_return_val_if_fail(self, 0);
return self->priv->peer->class;
}
gulong xdk_visual_get_red_mask(XdkVisual * self)
{
g_return_val_if_fail(self, 0);
return self->priv->red_mask;
}
gulong xdk_visual_get_green_mask(XdkVisual * self)
{
g_return_val_if_fail(self, 0);
return self->priv->green_mask;
}
gulong xdk_visual_get_blue_mask(XdkVisual * self)
{
g_return_val_if_fail(self, 0);
return self->priv->blue_mask;
}
gint xdk_visual_get_colormap_size(XdkVisual * self)
{
g_return_val_if_fail(self, 0);
return self->priv->colormap_size;
}
Colormap xdk_visual_to_colormap(XdkVisual * self)
{
g_return_val_if_fail(self, None);
XdkVisualPrivate * priv = self->priv;
if(priv->colormap) {
goto end;
}
priv->colormap = XCreateColormap(
xdk_display_get_peer(xdk_screen_get_display(priv->screen)),
xdk_window_get_peer(xdk_screen_get_root_window(priv->screen)),
priv->peer,
AllocNone);
XInstallColormap(
xdk_display_get_peer(xdk_screen_get_display(priv->screen)),
priv->colormap);
end:
return priv->colormap;
}
|
7c69dc622a29ee149ef31dcc12e30304ae35eacd
|
a1ff4c5f109e8a3e3e4d13956af3246a94d56c2f
|
/schulkonsole/bin/wrapper-backup.c
|
c44d2e1419ae3ebff3f154d187d6f2d681ce5b75
|
[] |
no_license
|
fschuett/linuxmuster-backup
|
9000ce2e2222ea93bd6d703145e9ba9560348067
|
2c1acd04849fc1da61824fbb44f5ca5ad02a89e5
|
refs/heads/master
| 2020-12-10T02:35:10.142776 | 2016-09-28T08:48:29 | 2016-09-28T08:48:29 | 10,916,570 | 0 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 649 |
c
|
wrapper-backup.c
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#ifndef WWWUID
# define WWWUID 33
#endif
#ifndef PERL
# define PERL "/usr/bin/perl"
#endif
#ifndef WRAPPERBACKUPPERLAPP
# define WRAPPERBACKUPPERLAPP "/usr/lib/schulkonsole/bin/wrapper-backup.pl"
#endif
const uid_t c_www_user = WWWUID;
const char* c_perl = PERL;
const char* c_wrapper_perl = WRAPPERBACKUPPERLAPP;
/* extern char **environ; */
int
main()
{
uid_t uid;
uid = getuid();
if (uid != c_www_user) {
return -3;
}
/* clear environment */
clearenv();
/* environ = NULL; */
execl(c_perl, c_perl, c_wrapper_perl, NULL);
return -6;
}
|
f33ad4643bfd2c4c78c11a04070b874b838547c7
|
d39d3803686eb51bfa7e8ab97637f7c7f09c02c0
|
/src/1015.c
|
859eb1c2391ea475db348241235fd04b7e0170f4
|
[] |
no_license
|
Xentle/Baekjoon
|
ae5b1b2ec59913b988bbb909383ae96507fd5bdb
|
f69e9ebca2a89b57ec2f2dc045e2841a0865ba94
|
refs/heads/master
| 2020-03-20T21:19:07.509671 | 2019-01-03T13:35:46 | 2019-01-03T13:35:46 | 137,734,929 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 454 |
c
|
1015.c
|
#include <stdio.h>
int main() {
int n, arr[50], P[50]={-1}, P_index=0, min, arr_index;
scanf("%d", &n);
for(int i=0; i<n; i++) {
scanf("%d", &arr[i]);
getchar();
}
for(int i=0; i<n; i++) {
min = 2000;
for(int j=n-1; j>=0; j--) {
if(arr[j] <= min) {
min = arr[j];
arr_index = j;
}
}
P[arr_index] = P_index++;
arr[arr_index] = 5000;
}
for(int i=0; i<n-1; i++)
printf("%d ", P[i]);
printf("%d\n", P[n-1]);
return 0;
}
|
1915c2eb8208cf6f689176e2a2f5c975f1234fec
|
aae5c03732a98980ba9dc7043ac76092375dc5fb
|
/project_euler/problem_2/c/main.c
|
e550989ed1fbd4035d6c3376b3132ef207e8983e
|
[
"MIT"
] |
permissive
|
christopherwj/a_code_a_day
|
7ffbb1abc469c398bb54351ccb1370671a10c2f3
|
1729c4f7e72dc88af70bd99b158aa50145ddf299
|
refs/heads/master
| 2020-12-03T12:32:30.064920 | 2020-05-11T06:35:50 | 2020-05-11T06:35:50 | 231,317,719 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 828 |
c
|
main.c
|
#include <stdio.h>
/*
* Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
* 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
* By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
*/
int fibonacci(int n) {
if (n <= 1){
return n;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main(void){
int i = 1;
int temp = 0;
int total = 0;
do
{
temp = fibonacci(i);
printf("term fib sequence is at:%d\n", fibonacci(i));
printf("value of temp:%d\n", temp);
printf("value of total:%d\n", total);
printf("---------------------------------\n");
if (((temp % 2) == 0)){
total += temp;
}
i++;
}while (temp<=4000000);
return 0;
}
//4,613,732
|
20f91e9e4472043ff106738058a16a8865d9a356
|
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
|
/source/linux/drivers/gpu/drm/imx/extr_ipuv3-plane.c_ipu_plane_enable.c
|
7d47cf9da1ad06af5fad010a924f82d3ca97a377
|
[] |
no_license
|
isabella232/AnghaBench
|
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
|
9a5f60cdc907a0475090eef45e5be43392c25132
|
refs/heads/master
| 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,233 |
c
|
extr_ipuv3-plane.c_ipu_plane_enable.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct ipu_plane {scalar_t__ dp; int /*<<< orphan*/ alpha_ch; int /*<<< orphan*/ ipu_ch; int /*<<< orphan*/ dmfc; int /*<<< orphan*/ ipu; } ;
/* Variables and functions */
int /*<<< orphan*/ ipu_dmfc_enable_channel (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ipu_dp_enable (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ipu_dp_enable_channel (scalar_t__) ;
int /*<<< orphan*/ ipu_idmac_enable_channel (int /*<<< orphan*/ ) ;
scalar_t__ ipu_plane_separate_alpha (struct ipu_plane*) ;
__attribute__((used)) static void ipu_plane_enable(struct ipu_plane *ipu_plane)
{
if (ipu_plane->dp)
ipu_dp_enable(ipu_plane->ipu);
ipu_dmfc_enable_channel(ipu_plane->dmfc);
ipu_idmac_enable_channel(ipu_plane->ipu_ch);
if (ipu_plane_separate_alpha(ipu_plane))
ipu_idmac_enable_channel(ipu_plane->alpha_ch);
if (ipu_plane->dp)
ipu_dp_enable_channel(ipu_plane->dp);
}
|
c5e690c7700e8d6b96cab55536f11e922e551006
|
3ed016473dada7b4de7a5061602c398f92d17b11
|
/fillit/Libft/ft_strsub.c
|
ab831523120018020103973ace608765db37edce
|
[] |
no_license
|
majinx23/42-Projects
|
80f64dafb8f8ee85eba64618f8ff3f6817f816e1
|
7823466631c27b3ae52c28f8c1ed056b850cdbc7
|
refs/heads/master
| 2021-01-22T22:09:18.149847 | 2017-03-18T18:56:45 | 2017-03-18T18:56:45 | 85,511,747 | 1 | 0 | null | 2017-03-19T21:57:09 | 2017-03-19T21:57:09 | null |
UTF-8
|
C
| false | false | 1,451 |
c
|
ft_strsub.c
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsub.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jwalsh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/05 13:56:03 by jwalsh #+# #+# */
/* Updated: 2016/11/23 17:15:15 by jwalsh ### ########.fr */
/* */
/* ************************************************************************** */
/*
** Allocates and returns a copy of a substring of the string s starting at
** index start of length len.
** If allocation fails, return NULL.
** If start and len do not designate a valid substring, behavior is undefined.
*/
#include "libft.h"
char *ft_strsub(char const *s, unsigned int start, size_t len)
{
char *sub;
size_t i;
size_t j;
j = 0;
i = start;
if (!len)
return (ft_memalloc(1));
if (!s || !(*s))
return (NULL);
if (!(sub = ft_strnew(len)))
return (NULL);
while (j < len)
sub[j++] = s[i++];
sub[j] = '\0';
return (sub);
}
|
d0d42bca2dc5971c01a92fb7888b45ad34e88066
|
6ac0950c5774dda1fefbe894fecd337dd3521449
|
/rand_mem.c
|
4dd5a94879578924ae8d7043d4ff7719341e8bea
|
[] |
no_license
|
crendelyok/avl-tree
|
45788c81cc353aac9f973f492bf6a402b8be8f2f
|
506643270f2fe6031b0c01cc32ded4f2400a2cf6
|
refs/heads/master
| 2022-04-23T20:37:59.439298 | 2020-04-21T14:41:25 | 2020-04-21T14:41:25 | 255,609,575 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 1,157 |
c
|
rand_mem.c
|
#include "rand_mem.h"
static void* num_of_elements(node_t* node, void* args) {
(*(int*)args)++;
return NULL;
}
void* my_malloc(size_t size, int rand_factor) {
int random = rand() % MAX_RAND;
random *= rand_factor;
if (random == MAGIC_NUMBER) {
return NULL;
}
return calloc(1, size);
}
//timeout as well
int rand_insert(tree_t* tree, int val) {
if (tree == NULL)
return 1;
int allocated = 0;
visitor(tree, num_of_elements, &allocated);
tree_t* temp = tree;
insert(temp, val);
int allocated2 = 0;
visitor(tree, num_of_elements, &allocated2);
int timeout = 0;
while (allocated == allocated2) {
timeout++;
assert(timeout != __TIMEOUT__);
allocated2 = 0;
tree = temp;
insert(tree, val);
visitor(tree, num_of_elements, &allocated2);
}
return 0;
}
//make timeout
tree_t* rand_tree_init(int val) {
tree_t* tree = tree_init(val);
int timeout = 0;
while(tree == NULL) {
timeout++;
assert(timeout != __TIMEOUT__);
tree = tree_init(val);
}
return tree;
}
|
28ce47d6e97f10021a6be70506f03d31c5d6efc9
|
9dfdb4fda23b1f14704100a376fbbbafb88c1567
|
/cmake_learn/example-2/src/testFun1.c
|
086c9a95d4df7bf6b9eb8e9b6e94ee6471c5dc50
|
[] |
no_license
|
JacobianTang/learn
|
ee7af221a1580adcb7b3c415efeb83764084372c
|
94469943a6cce2b4c7eceab300fbb9558c1ad706
|
refs/heads/master
| 2022-11-25T17:57:00.368231 | 2020-07-28T06:53:33 | 2020-07-28T06:53:33 | 279,805,256 | 0 | 0 | null | null | null | null |
UTF-8
|
C
| false | false | 98 |
c
|
testFun1.c
|
#include <stdio.h>
#include "testFun1.h"
void func1(int data){
printf("data is %d\n",data);
}
|
080d7ece5c77a453a625cc110d5af229a8088ba0
|
5abe089d154ae01779dcbde0fa6d4f84f2ceb059
|
/tinySIP/src/sigcomp/tsip_sigcomp.c
|
ec1a7713951620d4fd1cd8b5648c43d8d9761995
|
[] |
no_license
|
quantum6/doubango-quantum6
|
2baeaa59de5bd3d2c24ae5587ee7edb76f4630df
|
35ca01a51a5be161a503f460e7ce758053de5927
|
refs/heads/master
| 2021-01-05T11:45:37.006095 | 2020-03-14T11:49:30 | 2020-03-14T11:49:30 | 241,012,743 | 3 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 18,114 |
c
|
tsip_sigcomp.c
|
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_sigcomp.c
* @brief SigComp helper API.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#include "tinysip/sigcomp/tsip_sigcomp.h"
#include "tcomp_manager.h"
#include "tsk_safeobj.h"
#include "tsk_memory.h"
#include "tsk_string.h"
#include "tsk_list.h"
#include "tsk_debug.h"
#include <string.h> /* used by tsk_string.h macros */
/** SigComp compartment */
typedef struct tsip_sigcomp_compartment_s {
TSK_DECLARE_OBJECT;
char* id;
uint64_t stream_id;
tcomp_result_t *decomp_result;
/* tinySigComp library is thread-safe but I prefer to add this
* tcomp_manager_provideCompartmentId() is unsafe */
TSK_DECLARE_SAFEOBJ;
}
tsip_sigcomp_compartment_t;
const tsk_object_def_t *tsip_sigcomp_compartment_def_t;
typedef tsk_list_t tsip_sigcomp_compartments_L_t;
/** SigComp handler */
typedef struct tsip_sigcomp_s {
TSK_DECLARE_OBJECT;
tcomp_manager_handle_t *manager;
tsip_sigcomp_compartments_L_t* compartments;
TSK_DECLARE_SAFEOBJ;
}
tsip_sigcomp_t;
const tsk_object_def_t *tsip_sigcomp_def_t;
/*== Predicate function to find a compartment by id */
static int pred_find_compartment_by_id(const tsk_list_item_t *item, const void *id)
{
if(item && item->data) {
tsip_sigcomp_compartment_t *compartment = item->data;
return tsk_strcmp(compartment->id, (const char*)id);
}
return -1;
}
/** Creates new SigComp handler
* @param cpb Cycles Per Bit (16, 32, 64 or 128)
* @param dms Decompression Memory Size (should be: 0, 2048, 4096, 8192, 16384, 32768, 65536 or 131072)
* @param sms State Memory Size (should be: 0, 2048, 4096, 8192, 16384, 32768, 65536 or 131072)
* @retval A pointer to a SigComp handler if succeed and Null otherwise.
*/
tsip_sigcomp_handle_t* tsip_sigcomp_handler_create(uint8_t cpb, uint32_t dms, uint32_t sms)
{
tsip_sigcomp_t* sigcomp = tsk_object_new(tsip_sigcomp_def_t);
/* create SigComp handler */
if(!sigcomp) {
TSK_DEBUG_ERROR("Failed to create new SigComp handler");
return tsk_null;
}
/* create SigComp manager */
if(!(sigcomp->manager = tcomp_manager_create()) || !(sigcomp->compartments = tsk_list_create())) {
TSK_DEBUG_ERROR("Failed to create new SigComp manager");
TSK_OBJECT_SAFE_FREE(sigcomp);
return tsk_null;
}
tcomp_manager_setCycles_Per_Bit(sigcomp->manager, cpb);
tcomp_manager_setDecompression_Memory_Size(sigcomp->manager, dms);
tcomp_manager_setState_Memory_Size(sigcomp->manager, sms);
return sigcomp;
}
/** Creates new SigComp handler
* Adds/Removes dictionaries. These dictionaries will be used both for compression and decompression.
* And this will apply to all compartments holded by the handler.
* @param self The SigComp manager holding the dictionaries to add/remove.
* @param sip_n_sdp Whether to add the SIP/SDP dictionary (RFC 3485). If @a tsk_false_t this dictionary will be added,
* otherwise it will be removed.
* @param pres Whether to add the Presence dictionary (RFC 5112). If @a tsk_false_t this dictionary will be added,
* otherwise it will be removed.
*/
int tsip_sigcomp_handler_set_dicts(tsip_sigcomp_handle_t* self, tsk_bool_t sip_n_sdp, tsk_bool_t pres)
{
tsip_sigcomp_t* sigcomp = self;
if(!sigcomp || !sigcomp->manager) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
tsk_safeobj_lock(sigcomp);
/* SIP/SDP (RFC 3485) */
if(sip_n_sdp) {
tcomp_manager_addSipSdpDictionary(sigcomp->manager);
}
else {
// FIXME: To be implemented in tinySigComp
/* tcomp_manager_removeSipSdpDictionary(sigcomp->manager); */
}
/* SIP/SDP (RFC 5112) */
if(pres) {
tcomp_manager_addPresenceDictionary(sigcomp->manager);
}
else {
// FIXME: To be implemented in tinySigComp
/* tcomp_manager_removePresenceDictionary(sigcomp->manager); */
}
tsk_safeobj_unlock(sigcomp);
return 0;
}
/** Adds new SigComp compartement to the handler
* @param self The SigComp handler
* @param comp_id The id of the new compartment to add
* @retval Zero if succeed and non-zero error code otherwise.
*/
int tsip_sigcomp_handler_add_compartment(tsip_sigcomp_handle_t* self, const char* comp_id)
{
tsip_sigcomp_compartment_t* compartment;
tsip_sigcomp_t* sigcomp = self;
int ret = -1;
if(!sigcomp || !comp_id) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
tsk_safeobj_lock(sigcomp);
/* check if we already have a compartment with the same id */
if(tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id)) {
TSK_DEBUG_ERROR("Failed to add new SigComp compartment. %s already exist.", comp_id);
ret = -2;
goto bail;
}
if((compartment = tsk_object_new(tsip_sigcomp_compartment_def_t))) {
compartment->id = tsk_strdup(comp_id);
tcomp_result_setCompartmentId(compartment->decomp_result, compartment->id, tsk_strlen(compartment->id));
tsk_list_push_back_data(sigcomp->compartments, (void**)&compartment);
ret = 0;
goto bail;
}
else {
TSK_DEBUG_ERROR("Failed to create new SigComp compartment");
ret = -3;
goto bail;
}
bail:
tsk_safeobj_unlock(sigcomp);
return ret;
}
/** Removes a SigComp compartement from the handler
* @param self The SigComp handler
* @param comp_id The id of the new compartment to remove
* @retval Zero if succeed and non-zero error code otherwise.
*/
int tsip_sigcomp_handler_remove_compartment(tsip_sigcomp_handle_t* self, const char* comp_id)
{
tsip_sigcomp_t* sigcomp = self;
if(!sigcomp || !comp_id) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
tsk_safeobj_lock(sigcomp);
tsk_list_remove_item_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id);
tsk_safeobj_unlock(sigcomp);
return 0;
}
// FIXME
const char* tsip_sigcomp_handler_fixme_getcompid(const tsip_sigcomp_handle_t* self)
{
const tsip_sigcomp_t* sigcomp = self;
const char* comp_id = tsk_null;
if(!sigcomp) {
TSK_DEBUG_ERROR("Invalid parameter");
return tsk_null;
}
tsk_safeobj_lock(sigcomp);
if(!TSK_LIST_IS_EMPTY(sigcomp->compartments)) {
comp_id = ((tsip_sigcomp_compartment_t*)TSK_LIST_FIRST_DATA(sigcomp->compartments))->id;
}
tsk_safeobj_unlock(sigcomp);
return comp_id;
}
/** Close all SigComp compartments
* @param self The SigComp handler
*/
int tsip_sigcomp_close_all(tsip_sigcomp_handle_t* self)
{
tsip_sigcomp_t* sigcomp = self;
const tsk_list_item_t* item;
const char* comp_id;
if(!sigcomp) {
return -1;
}
tsk_safeobj_lock(sigcomp);
tsk_list_foreach(item, sigcomp->compartments) {
comp_id = ((tsip_sigcomp_compartment_t*)item->data)->id;
tcomp_manager_closeCompartment(sigcomp->manager, comp_id, tsk_strlen(comp_id));
}
tsk_safeobj_unlock(sigcomp);
return 0;
}
/** Compress a Sip message
* @param self The SigComp handler
* @param comp_id The id of the compartement to use for compression. This compartment should be previously added using
* @ref tsip_sigcomp_handler_add_compartment()
* @param is_stream Indicates whether we are about to compress a stream message or not
* @param in_data Sip input data to compress
* @param in_size The size of the Sip input data
* @param out_data A pointer to the output data where the compressed message will be copied. It's up to you to allocate
* this buffer before calling this function.
* @param out_maxsize The maximum size of the @a out_data. Used as guard to avoid buffer overflow.
* @retval Size of the compressed data.
*/
tsk_size_t tsip_sigcomp_handler_compress(tsip_sigcomp_handle_t* self, const char* comp_id, tsk_bool_t is_stream, const void* in_data, tsk_size_t in_size, void* out_data, tsk_size_t out_maxsize)
{
tsk_size_t out_size = 0;
tsip_sigcomp_compartment_t* compartment;
tsip_sigcomp_t* sigcomp = self;
if(!sigcomp || !in_data || !in_size || !out_data || !out_maxsize) {
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
/* find the compartment */
if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))) {
TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
return 0;
}
/* take ownership and lock() */
compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
tsk_safeobj_lock(compartment);
/* compress the message */
out_size = tcomp_manager_compress(sigcomp->manager, compartment->id, tsk_strlen(compartment->id), in_data, in_size, out_data, out_maxsize, is_stream);
/* release ownership and unlock() */
tsk_safeobj_unlock(compartment);
tsk_object_unref(compartment);
return out_size;
}
/** UnCompress a SigComp message
* @param self The SigComp handler
* @param comp_id The compartment id to use after successful decompression.
* @param is_stream Indicates whether we are about to uncompress a stream message or not
* @param in_data A pointer to the SigComp buffer to decompress
* @param in_size The size of the SigComp buffer
* @param out_data A pointer to the output data where the uncompressed message will be copied. It's up to you to allocate
* this buffer before calling this function.
* @param out_maxsize The maximum size of the @a out_data. Used as guard to avoid buffer overflow.
* @param is_nack Used to signal whether the uncompressed (result) message is a NACK or a Sip Message.
* @retval Size of the uncompressed data.
*/
tsk_size_t tsip_sigcomp_handler_uncompress(tsip_sigcomp_handle_t* self, const char* comp_id, tsk_bool_t is_stream, const void* in_data, tsk_size_t in_size, void* out_data, tsk_size_t out_maxsize, tsk_bool_t* is_nack)
{
tsk_size_t out_size = 0;
tsip_sigcomp_compartment_t* compartment;
tsip_sigcomp_t* sigcomp = self;
if(!sigcomp || !in_data || !in_size || !out_data || !out_maxsize || !is_nack) {
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
/* find the compartment */
if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))) {
TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
return 0;
}
*is_nack = tsk_false;
/* take ownership and lock() */
compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
tsk_safeobj_lock(compartment);
/* uncompress the message */
tcomp_result_setOutputBuffer(compartment->decomp_result, out_data, out_maxsize, is_stream, compartment->stream_id); // set the output buffer where to copy uncompressed message
out_size = tcomp_manager_decompress(sigcomp->manager, in_data, in_size, compartment->decomp_result);
if(out_size) {
// provide the compartment id --> save temp states
tcomp_manager_provideCompartmentId(sigcomp->manager, compartment->decomp_result);
}
else {
if((*is_nack = compartment->decomp_result->isNack)) {
tsk_size_t nack_info_size;
if(compartment->decomp_result->nack_info && (nack_info_size = tcomp_buffer_getSize(compartment->decomp_result->nack_info))) {
out_size = (nack_info_size > out_maxsize) ? out_maxsize : nack_info_size;
memcpy(out_data, tcomp_buffer_getBuffer(compartment->decomp_result->nack_info), out_size);
TSK_DEBUG_INFO("We got a NACK to send()");
}
else {
TSK_DEBUG_INFO("We got a NACK from the remote party");
}
}
else {
/* Should never happen */
TSK_DEBUG_ERROR("SigComp decompression failed");
}
}
/* release ownership and unlock() */
tsk_safeobj_unlock(compartment);
tsk_object_unref(compartment);
return out_size;
}
/** Try to unCompress the next stream chunck. Must only be used with stream compartments.
* When you are dealing with stream stream transports, then you should call this function several times until
* it returns zero.
* @param self The SigComp handler
* @param comp_id The compartment id to use after successful decompression
* @param nack_data Pointer to the NACL message. We be filled only if @a is_nack is equal to @a tsk_true
* @param is_nack Used to signal whether the uncompressed (result) message is a NACK or a Sip Message.
* @retval Size of the uncompressed data plus size of all previously uncompressed chuncks except NACKs.
* If the uncompressed message is a NACK, then the returned size will be equal to the length of the NACK
* to send to the remote party.
*/
tsk_size_t tsip_sigcomp_handler_uncompress_next(tsip_sigcomp_handle_t* self, const char* comp_id, void** nack_data, tsk_bool_t* is_nack)
{
tsk_size_t out_size = 0;
tsip_sigcomp_compartment_t* compartment;
tsip_sigcomp_t* sigcomp = self;
if(!sigcomp || !is_nack || !nack_data) {
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
/* find the compartment */
if(!(compartment = (tsip_sigcomp_compartment_t*)tsk_list_find_object_by_pred(sigcomp->compartments, pred_find_compartment_by_id, comp_id))) {
TSK_DEBUG_ERROR("%s not a valid compartment Id", comp_id);
return 0;
}
/* take ownership and lock() */
compartment = tsk_object_ref(compartment); /* take ownership instead of locking the handler(which will lock all compartments) */
tsk_safeobj_lock(compartment);
/* uncompress the next chunk
* the returned size the the total size which includes previous chuncks uncompressed
* using tsip_sigcomp_handler_uncompress()
*/
out_size = tcomp_manager_getNextStreamMessage(sigcomp->manager, compartment->decomp_result);
if(out_size) {
// provide the compartment id --> save temp states
tcomp_manager_provideCompartmentId(sigcomp->manager, compartment->decomp_result);
}
else {
if((*is_nack = compartment->decomp_result->isNack)) {
tsk_size_t nack_info_size;
if(compartment->decomp_result->nack_info && (nack_info_size = tcomp_buffer_getSize(compartment->decomp_result->nack_info))) {
if((*nack_data = tsk_calloc(nack_info_size, sizeof(uint8_t)))) {
memcpy(*nack_data, tcomp_buffer_getBuffer(compartment->decomp_result->nack_info), nack_info_size);
}
TSK_DEBUG_INFO("We got a NACK to send()");
}
else {
TSK_DEBUG_INFO("We got a NACK from the remote party");
}
}
}
/* release ownership and unlock() */
tsk_safeobj_unlock(compartment);
tsk_object_unref(compartment);
return out_size;
}
//===========================================================================
// SIP SigComp Handler object definition
//
static tsk_object_t* tsip_sigcomp_ctor(tsk_object_t * self, va_list * app)
{
tsip_sigcomp_t *sigcomp = self;
if(sigcomp) {
/* Done by tsip_sigcomp_create()
sigcomp->manager = tcomp_manager_create();
sigcomp->compartments = tsk_list_create();
*/
tsk_safeobj_init(sigcomp);
}
return self;
}
static tsk_object_t* tsip_sigcomp_dtor(tsk_object_t * self)
{
tsip_sigcomp_t *sigcomp = self;
if(sigcomp) {
TSK_OBJECT_SAFE_FREE(sigcomp->manager);
TSK_OBJECT_SAFE_FREE(sigcomp->compartments);
tsk_safeobj_deinit(sigcomp);
}
return self;
}
static const tsk_object_def_t tsip_sigcomp_def_s = {
sizeof(tsip_sigcomp_t),
tsip_sigcomp_ctor,
tsip_sigcomp_dtor,
tsk_null,
};
const tsk_object_def_t *tsip_sigcomp_def_t = &tsip_sigcomp_def_s;
//===========================================================================
// SIP SigComp Compartment object definition
//
static tsk_object_t* tsip_sigcomp_compartment_ctor(tsk_object_t * self, va_list * app)
{
static uint64_t __unique_stream_id = 0;
tsip_sigcomp_compartment_t *compartment = self;
if(compartment) {
compartment->decomp_result = tcomp_result_create();
compartment->stream_id = ++(__unique_stream_id);
tsk_safeobj_init(compartment);
}
return self;
}
static tsk_object_t* tsip_sigcomp_compartment_dtor(tsk_object_t * self)
{
tsip_sigcomp_compartment_t *compartment = self;
if(compartment) {
TSK_FREE(compartment->id);
TSK_OBJECT_SAFE_FREE(compartment->decomp_result);
tsk_safeobj_deinit(compartment);
}
return self;
}
int tsip_sigcomp_compartment_cmp(const tsk_object_t * _c1, const tsk_object_t * _c2)
{
const tsip_sigcomp_compartment_t *c1 = _c1;
const tsip_sigcomp_compartment_t *c2 = _c2;
if(c1 && c2) {
return tsk_strcmp(c1->id, c2->id);
}
else {
return (c1 - c2);
}
}
static const tsk_object_def_t tsip_sigcomp_compartment_def_s = {
sizeof(tsip_sigcomp_compartment_t),
tsip_sigcomp_compartment_ctor,
tsip_sigcomp_compartment_dtor,
tsip_sigcomp_compartment_cmp,
};
const tsk_object_def_t *tsip_sigcomp_compartment_def_t = &tsip_sigcomp_compartment_def_s;
|
1c726ce658c42cfbb5671915d478f78e759e20c0
|
d75fe43b91967df45c10f111e9672b260ed2b6db
|
/microcontroller/software/stm32f103/Src/fatfs.c
|
a769d08004b773e2df1be617c097149e0e40a7c2
|
[] |
no_license
|
goran-mahovlic/dmm_ut61e
|
a3eb2bb132bb155640dd4c8d16a7f6da41e52bf3
|
592b6978940fa7d690b26330896859c3bff11614
|
refs/heads/master
| 2021-04-27T16:30:04.930138 | 2019-04-23T13:38:05 | 2019-04-23T13:38:05 | 122,303,594 | 2 | 0 | null | 2018-02-21T07:11:17 | 2018-02-21T07:11:17 | null |
UTF-8
|
C
| false | false | 12,332 |
c
|
fatfs.c
|
/**
******************************************************************************
* @file fatfs.c
* @brief Code for fatfs applications
******************************************************************************
*
* Copyright (c) 2017 STMicroelectronics International N.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of other
* contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
* 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
* 5. Redistribution and use of this software other than as permitted under
* this license is void and will automatically terminate your rights under
* this license.
*
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 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 "fatfs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
uint8_t retUSER; /* Return value for USER */
char USER_Path[4]; /* USER logical drive path */
BYTE buffer[14]; /* File copy buffer */
/* USER CODE BEGIN Variables */
FATFS FatFs; /* File system object for User logical drive */
FIL Fil; /* File object */
uint32_t wbytes; /* File write counts */
//uint8_t wtext[] = "text to write logical disk by elgarbe"; /* File write buffer */
extern uint8_t rxBuff[14];
uint8_t sdReadBuffer[14];
//extern void Error_Handler(void);
/* USER CODE END Variables */
void MX_FATFS_Init(void)
{
HAL_Delay(5000);
//CDC_Transmit_FS("FATFS_Init\n\r",12);
/*## FatFS: Link the USER driver ###########################*/
retUSER = FATFS_LinkDriver(&USER_Driver, USER_Path);
/* USER CODE BEGIN Init */
uint16_t lastLog=0;
UINT bw; // bytes escritos
uint8_t dummyWrite = '\n';
if(retUSER == 0)
{
if(f_mount(&FatFs, (TCHAR const*)USER_Path, 0) == FR_OK)
{
// Busco el último LOG en la SD y creo el archivo para loguear
lastLog = fs_get_last_log("/");
HAL_Delay(10);
fs_CreateLOG(lastLog + 1);
HAL_Delay(10);
//f_write(&Fil, &dummyWrite, 1, &bw);
//HAL_Delay(10);
f_lseek(&Fil, 0);
}else{
CDC_Transmit_FS("ErrorInit1",10);
Error_Handler();
}
}else{
CDC_Transmit_FS("ErrorInit2",10);
Error_Handler();
}
/* USER CODE END Init */
}
/**
* @brief Gets Time from RTC
* @param None
* @retval Time in DWORD
*/
DWORD get_fattime(void)
{
/* USER CODE BEGIN get_fattime */
return 0;
/* USER CODE END get_fattime */
}
/* USER CODE BEGIN Application */
void parse(uint8_t* pStr)
{
char val[5];
uint8_t special[3]={0};
uint8_t unit[3]={0};
float multp = 1;
char dataToPrint[40]={0};
int value = 0;
float d_val;
CDC_Transmit_FS("Parse!!\n\r",9);
HAL_Delay(10);
CDC_Transmit_FS("Value: ",7);
HAL_Delay(10);
CDC_Transmit_FS(pStr,14);
HAL_Delay(10);
val[0] = pStr[1];
val[1] = pStr[2];
val[2] = pStr[3];
val[3] = pStr[4];
val[4] = pStr[5];
CDC_Transmit_FS(val,5);
HAL_Delay(10);
value = atoi(val);
CDC_Transmit_FS(val,5);
HAL_Delay(10);
uint8_t dataToPrintSize = sprintf(dataToPrint,"Value: %i\r\n",value);
CDC_Transmit_FS(dataToPrint,dataToPrintSize);
switch (pStr[0])
{
case 0x30:
d_val = (float)value / 1000;
//val[1] = ',';
break;
case 0x31:
d_val = (float)value / 100;
//val[2] = ',';
break;
case 0x32:
//val[3] = ',';
d_val = (float)value / 10;
break;
case 0x34:
//val[4] = ',';
//d_val = value * 0.1;
break;
// default case is no comma/decimal point at all.
}
switch (pStr[6]) {
case '1':
unit[0] = 'D';
unit[1] = 'I';
break;
case '2':
unit[0] = 'H';
unit[1] = 'z';
switch (pStr[0]) {
case '0':
multp = 0.01;
break;
case '1':
multp = 0.1;
break;
case '3':
multp = 1;
break;
case '4':
multp = 10;
break;
case '5':
multp = 100;
break;
case '6':
multp = 1000;
break;
case '7':
multp = 10000;
break;
default:
CDC_Transmit_FS("Error\n\r",7);
}
break;
case '3':
unit[0] = 'O';
unit[1] = 'h';
unit[2] = 'm';
switch (pStr[0]) {
case '0':
multp = 0.01;
break;
case '1':
multp = 0.1;
break;
case '2':
multp = 1;
break;
case '3':
multp = 10;
break;
case '4':
multp = 100;
break;
case '5':
multp = 1000;
break;
case '6':
multp = 10000;
break;
default:
CDC_Transmit_FS("Error\n\r",7);
break;
}
case '5':
unit[0] = 'O';
unit[1] = 'h';
unit[2] = 'm';
break;
case '6':
unit[0] = 'F';
switch (pStr[0]) {
case '0':
multp = 0.12;
break;
case '1':
multp = 0.11;
break;
case '2':
multp = 0.10;
break;
case '3':
multp = 0.000000001;
break;
case '4':
multp = 0.00000001;
break;
case '5':
multp = 0.0000001;
break;
case '6':
multp = 0.000001;
break;
case '7':
multp = 0.00001;
break;
default:
CDC_Transmit_FS("Error\n\r",7);
}
break;
case 0x3b:
unit[0] = 'V';
switch (pStr[0]) {
case '0':
multp = 0.0001;
break;
case '1':
multp = 0.001;
break;
case '2':
multp = 0.01;
break;
case '3':
multp = 0.1;
break;
case '4':
multp = 0.00001;
break;
default:
CDC_Transmit_FS("Error\n\r",7);
}
break;
case '0': // A
unit[0] = 'A';
if (pStr[0] == '0')
multp = 0.001;
else {
CDC_Transmit_FS("Error\n\r",7);
}
break;
case 0x3d: // uA
unit[0] = 'u';
unit[1] = 'A';
switch (pStr[0]) {
case '0':
multp = 0.00000001;
break;
case '1':
multp = 0.0000001;
break;
default:
CDC_Transmit_FS("Error\n\r",7);
}
break;
case 0x3f: // mA
unit[0] = 'm';
unit[1] = 'A';
switch (pStr[0]) {
case '0':
multp = 0.000001;
break;
case '1':
multp = 0.00001;
break;
default:
CDC_Transmit_FS("Error\n\r",7);
}
break;
default:
CDC_Transmit_FS("Error\n\r",7);
}
switch (pStr[6]) {
}
if (pStr[10] & 8){
special[0] = 'D';
special[1] = 'C';
}
else if (pStr[10] & 4){
special[0] = 'A';
special[1] = 'C';
}
//printf("\n\r");
// float d_val = atof(val);
if(pStr[7] & 0x04){
//d_val = d_val * -1;
}
//d_val = d_val * multp;
dataToPrintSize = sprintf(dataToPrint,"Val: %i;d_val: %f;Mult: %f;unit: %s;special: %s\r\n",value,d_val,multp,unit, special);
CDC_Transmit_FS(dataToPrint,dataToPrintSize);
}
FRESULT fs_CreateLOG(uint16_t numLOG)
{
FRESULT rc; /* Result code */
uint8_t NomLOG[11]="LOGxxxx.TXT";
NomLOG[3] = numLOG/1000 + 48;
numLOG -= (numLOG/1000)*1000;
NomLOG[4] = numLOG/100 + 48;
numLOG -= (numLOG/100)*100;
NomLOG[5] = numLOG/10 + 48;
numLOG -= (numLOG/10)*10;
NomLOG[6] = numLOG/1 + 48;
rc = f_open(&Fil, (const char *)NomLOG, FA_WRITE | FA_CREATE_ALWAYS);
HAL_Delay(10);
if(rc == FR_OK)
{
f_sync(&Fil);
CDC_Transmit_FS(NomLOG,11);
CDC_Transmit_FS(" File created\n\r",15);
}
else{
CDC_Transmit_FS("File opening failed\n\r",19);
}
return rc;
}
void readLastFile(void){
uint16_t lastLog=0;
lastLog = fs_get_last_log("/");
HAL_Delay(10);
fs_ReadFile(lastLog);
}
FRESULT fs_ReadFile (uint16_t numLOG){
uint8_t buffer[14]; /* File copy buffer */
// FRESULT fr; /* FatFs function common result code */
UINT br; /* File read/write count */
FRESULT rc; /* Result code */
uint16_t lastLog=0;
uint8_t NomLOG[11]="LOGxxxx.TXT";
NomLOG[3] = numLOG/1000 + 48;
numLOG -= (numLOG/1000)*1000;
NomLOG[4] = numLOG/100 + 48;
numLOG -= (numLOG/100)*100;
NomLOG[5] = numLOG/10 + 48;
numLOG -= (numLOG/10)*10;
NomLOG[6] = numLOG/1 + 48;
CDC_Transmit_FS("Start\n\r",7);
f_close(&Fil);
//lastLog = fs_get_last_log("/");
f_open(&Fil, (const char *)NomLOG ,FA_READ | FA_OPEN_EXISTING);
if(rc == FR_OK)
{
f_sync(&Fil);
CDC_Transmit_FS(NomLOG,11);
CDC_Transmit_FS(" File opened\n\r",14);
}
else{
CDC_Transmit_FS("File opening failed\n\r",19);
}
for (;;) {
rc = f_read(&Fil, buffer, sizeof buffer, &br); /* Read a chunk of source file */
if (rc || br == 0) break; /* error or eof */
f_gets(buffer,14,&Fil);
buffer[12]= '\n';
buffer[13]= '\r';
CDC_Transmit_FS("Before parse!!\n\r",16);
HAL_Delay(10);
CDC_Transmit_FS("Value: ",7);
HAL_Delay(10);
CDC_Transmit_FS(buffer,14);
HAL_Delay(10);
parse(buffer);
HAL_Delay(100);
}
f_close(&Fil);
return rc;
}
FRESULT fs_WriteFile(void)
{
BYTE buffer[14]; /* File copy buffer */
UINT bw; // bytes escritos
FRESULT rc; // Result code
rc = f_write(&Fil, rxBuffer, 14, &bw);
HAL_Delay(10);
rc = f_sync(&Fil);
return rc;
}
/* Fusco el mayor de los LOGxxxx.TXT */
uint16_t fs_get_last_log (char* path)
{
FRESULT res;
FILINFO fno;
DIR dir;
uint16_t Fileint; // El número del archivo en formato numerico
uint16_t Filemax=0;
res = f_opendir(&dir, path); /* Open the directory */
if (res == FR_OK)
{
for (;;)
{
res = f_readdir(&dir, &fno); /* Read a directory item */
if (res != FR_OK || fno.fname[0] == 0) break; /* Break on error or end of dir */
if (fno.fname[0] == '.') continue; /* Ignore dot entry */
if (fno.fattrib & AM_ARC) /* It is a file. */
{
// Verifico que sea un LOGxxxx.TXT
if(fno.fname[0]=='L' && fno.fname[1]=='O' && fno.fname[2]=='G' &&
fno.fname[7]=='.' && fno.fname[8]=='T' && fno.fname[9]=='X' && fno.fname[10]=='T')
{
Fileint = (fno.fname[6]-48) + (fno.fname[5]-48)*10 +
(fno.fname[4]-48)*100 + (fno.fname[3]-48)*1000;
if(Fileint>Filemax)
Filemax=Fileint;
}
}
}
}
return Filemax;
}
/* USER CODE END Application */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
3c4bb2d18c2d2863957f0b23c0d305e7c586c03b
|
65ba9a8e33c86e6524073a7d816b5b63d206bdc6
|
/os/arch/kernel.h
|
1faf4d4fdf5506637e03081026132c25d7029068
|
[
"MIT"
] |
permissive
|
lfyos/lfyos
|
b3af93ea28a1b86639d9eabd4d1d3b5a3b53e90a
|
946426f8cc18b44627d26960a81d928e1fb9ec45
|
refs/heads/master
| 2020-04-22T13:52:31.063170 | 2019-03-09T04:57:17 | 2019-03-09T04:57:17 | 170,424,634 | 3 | 1 | null | null | null | null |
UTF-8
|
C
| false | false | 3,400 |
h
|
kernel.h
|
#ifndef OS_KERNEL_ARCH
#define OS_KERNEL_ARCH
#define PARAMETER_POINTER (0xc0001000)
#define CR2_BUF_NUMBER 6
typedef struct{
void (*ip)();
int cs;
int flag;
char *sp;
int ss;
int ds,es,fs,gs;
char *sp_0;
int cr2[CR2_BUF_NUMBER];
}run_point;
extern char *get_sp_0();
extern char *get_sp();
#define IS_USER_MODE(r_p) ((((r_p).cs)&(0x03))==(0x03))
#define DEFAULT_CS (0x23)
#define DEFAULT_DS (0x2b)
#define DEFAULT_SP get_sp()
#define DEFAULT_SP_0 get_sp_0()
#define MODIFY_TO_USER_RUN_POINT(r_p) \
{ \
(r_p).flag=(0x000200); \
(r_p).sp=DEFAULT_SP;(r_p).sp_0=DEFAULT_SP_0; \
(r_p).cs=DEFAULT_CS;(r_p).ds=DEFAULT_DS;(r_p).ss=DEFAULT_DS;\
(r_p).es=DEFAULT_DS;(r_p).fs=DEFAULT_DS;(r_p).gs=DEFAULT_DS;\
}
#define RESET_USER_RUN_POINT(r_p,start_routine) \
{ \
extern void start_routine(); \
int cr2_i; \
MODIFY_TO_USER_RUN_POINT(r_p); \
(r_p).ip=start_routine; \
for(cr2_i=0;cr2_i<CR2_BUF_NUMBER;cr2_i++) \
(r_p).cr2[cr2_i]=(-1); \
}
#define RESET_RUN_POINT(r_p) RESET_USER_RUN_POINT(r_p,lfyos_exit)
#define RESET_START_RUN_POINT(r_p) RESET_USER_RUN_POINT(r_p,lfyos_main)
#define KERNEL_CS (0x10)
#define KERNEL_DS (0x18)
#define KERNEL_SP get_sp_0()
#define KERNEL_SP_0 get_sp_0()
#define RESET_KERNEL_RUN_POINT(r_p,start_routine) \
{ \
extern void start_routine(); \
int cr2_i; \
(r_p).cs=KERNEL_CS;(r_p).ds=KERNEL_DS;(r_p).ss=KERNEL_DS;\
(r_p).es=KERNEL_DS;(r_p).fs=KERNEL_DS;(r_p).gs=KERNEL_DS;\
(r_p).sp=KERNEL_SP;(r_p).sp_0=KERNEL_SP_0; \
(r_p).ip=start_routine;(r_p).flag=(0x000200); \
for(cr2_i=0;cr2_i<CR2_BUF_NUMBER;cr2_i++) \
(r_p).cr2[cr2_i]=(-1); \
}
#define INIT_DEVICE_RUN_POINT(r_p) \
RESET_KERNEL_RUN_POINT(r_p,start_device_routine)
#define INIT_SERVER_RUN_POINT(r_p) \
RESET_KERNEL_RUN_POINT(r_p,start_server)
#define COPY_RUN_POINT(s,d) copy_data(&(s),&(d),sizeof(run_point))
#define COPY_RUN_POINT_INSTRUCTION_POINTER(s,d) \
{(d).ip=(s).ip;(d).cs=(s).cs;}
extern void prepare_for_save();
extern int prepare_for_restore();
extern char *kernel_get_page_table_base();
extern char *kernel_get_thread_physical_block(int thread_id);
extern void init_tlb();
extern void mark_file_capability_modify(int user_file_id);
extern void mark_physical_block_modify();
extern int operate_spinlock(int *pointer,int value);
extern void restore_parameter(int (*fun)(),int system_call_flag);
inline static void get_current_time(struct kernel_time *t)
{
int h,l;
asm volatile("rdtsc\n\t":"=a"(l),"=d"(h));
t->v_l=l&0x3fffffff;
t->v_m=(((l>>30)&0x03)|(h<<2))&0x3fffffff;
t->v_h=(h>>28)&0x0f;
}
inline static void clear_data(void *d,int length)
{
int ecx=length/sizeof(int),*edi=(int *)d;
asm volatile(
"cld\n\t"
"rep stosl\n\t"
:"+c"(ecx),"+D"(edi) :"a"(0)
);
if((ecx=length%sizeof(int))>0)
asm volatile(
"cld\n\t"
"rep stosb\n\t"
:"+c"(ecx),"+D"(edi) :"a"(0)
);
}
inline static void copy_data(void *s,void *d,int length)
{
int ecx=length/sizeof(int),*esi=(int *)s,*edi=(int *)d;
asm volatile(
"cld\n\t"
"rep movsl\n\t"
:"+c"(ecx),"+S"(esi),"+D"(edi)
);
if((ecx=length%sizeof(int))>0)
asm volatile(
"cld\n\t"
"rep movsb\n\t"
:"+c"(ecx),"+S"(esi),"+D"(edi)
);
}
inline static void start_all_processors() {return;}
inline static void remind_physical_cpu_do_switch(int physical_cpu_id)
{return;}
inline static int get_physical_cpu() {return 0;}
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.