Skip to content

add target port: curie_bsp #1234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2016

Conversation

jiangzidong
Copy link
Contributor

Intel® Curie BSP is the SDK that will help you developing software on Curie based boards, for example with the Arduino 101 board (AKA Genuino 101). https://github.com/CurieBSP/main/releases

We plan to add the curie_bsp port in the jerryscript/targets, so that CurieBSP users can develop js app.

@jiangzidong
Copy link
Contributor Author

  • we will only compile files in jerry-core, jerry-libm and targets/curie_bsp
  • 3 folders in the targets/curie_bsp:

source is the platform(curie) related code, such like date process, setjmp iamcu assemly implementation and io implementation.
include contains the header file needed by source
jerry-app is a curie_bsp project folder, which includes the main.c, project-config-file and memory-config-file

@jiangzidong
Copy link
Contributor Author

setup.py is used to create the makefile and jerry-config.

Because of the flash limitation of arduino101, we build the minimal_cp profile (with ERROR_BUILTIN enabled), and the mem_heap size is 10k

@LaszloLango LaszloLango added development Feature implementation jerry-port Related to the port API or the default port implementation labels Aug 2, 2016
@jiangzidong
Copy link
Contributor Author

@LaszloLango Hi, do you have any comments about this patch?

@LaszloLango
Copy link
Contributor

@jiangzidong, sorry I had no time to check the full patch. It is quite big :) AFAIK, @galpeter also started to check it. I'll review it today and give you some feedback.

@jiangzidong
Copy link
Contributor Author

@LaszloLango Thanks. I'm just afraid that the patch is neglected :)
Of course you should take your time.


#define alloca(size) __builtin_alloca(size)

#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing new line at the end of file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(style) #endif not followed by a /* !ALLOCA_H */ comment (same in inttypes.h)

file_to_be_created.close()

def main(curie_path, jerry_path):
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need the pass here?

@jiangzidong
Copy link
Contributor Author

jiangzidong commented Aug 8, 2016

Hi, @galpeter @LaszloLango I fixed according to the comments above, except the " keep those dirs clean". Because kbuild.mks in each source folder are requried by CurieBSP. https://github.com/CurieBSP/main/blob/master/doc/build_kbuild.md

Do you have any further comments? Thanks

@zherczeg
Copy link
Member

Hi @jiangzidong both Laszlo and Peter are not available this and next week. Can you wait a bit for review?

@jiangzidong
Copy link
Contributor Author

@zherczeg, of course~ Thanks for your reply :)

@akosthekiss
Copy link
Member

akosthekiss commented Aug 11, 2016

While the others are away, let me give some feedback:

  • Why are include/alloca.h and include/inttypes.hneeded? I cannot see them included directly from the now-added files. Or are they transitively included from include/jerry-libc-defs.h somehow?
  • Why are rand(), srand(), setjmp(), and longjmp() reimplemented? You don't build jerry-libc, which means, I guess, that you rely on some system libc implementation. Does it not implement them?
  • I don't think that you need to implement jerry_port_default_get_log_level, jerry_port_default_set_log_level, jerry_port_default_set_abort_on_fail, and jerry_port_default_is_abort_on_fail for the curie port. As their name suggests, these functions are specific to the default port. The currie port (or, at least, the main app you've provided, does not use such functions. You can implement the jerry_port_log and jerry_port_fatal port functions without them. Also note that jerry_port_fatal does not even have to call either exit or abort. It's your port implementation, so it's your call. You might simply implement it as jerry_port_log(JERRY_LOG_LEVEL_ERROR, "fatal!!!"); while (true) {} without any further calls.
  • JerryScript code base is under Apache 2.0 license, but some of the proposed files are under what seems to me as the 3-clause BSD. I'm not a lawyer, but I'm not sure we want to mix different licenses. What was your motivation for using a different license from the rest of the code?

More comments will follow inlined.

#define __attr_unused___ __attribute__((unused))
#define __attr_used___ __attribute__((used))
#define __attr_noreturn___ __attribute__((noreturn))
#define __attr_noinline___ __attribute__((noinline))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This define/attribute is not used anywhere, so should be removed. If exit and abort will be removed as suggested in the general comment, all the other defines can go away, too.

va_list args;
va_start (args, format);
length = vsnprintf (buf, 256, format, args);
buf[length]='\0';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space around =.

@jiangzidong jiangzidong force-pushed the curie_bsp branch 2 times, most recently from b4c1045 to bb15f18 Compare August 26, 2016 02:08
@jiangzidong
Copy link
Contributor Author

@galpeter Thanks for your comments!
1), No, we don't need the x permission of the source files. It should be my mistake. Already fixed
2), Wow, great! I didn't notice the usage of OUT_SRC before. I suggest it should be a new
commit/PR, because you did a lot of work. what do you think about it?

@akosthekiss
Copy link
Member

+1 to follow-up patch with OUT_SRC

}


void help ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one newline.

@galpeter
Copy link
Contributor

@jiangzidong adding it as a follow-up patch works for me.

@zherczeg
Copy link
Member

Ok, so shall we land this?

@jiangzidong
Copy link
Contributor Author

@zherczeg, updated according to your comments. Thanks.

@LaszloLango
Copy link
Contributor

still LGTM

@zherczeg
Copy link
Member

LGTM. Is it in the latest master?

@jiangzidong
Copy link
Contributor Author

@zherczeg, just rebased to the latest master

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
@zherczeg zherczeg merged commit 04e597a into jerryscript-project:master Aug 27, 2016
@zherczeg
Copy link
Member

Do you want this patch be part of the 1.0 release?

@jiangzidong
Copy link
Contributor Author

Yes. It will be great to be part of 1.0 release, so that Jerry users (who download the v1.0) will know how to port into CurieBSP and run in Arduino101.

@zherczeg
Copy link
Member

Added. Thank you.

@tilmannOSG
Copy link

@zherczeg Can you please cherry-pick this commit to the 1.0 release branch?
Thanks!

@tilmannOSG
Copy link

@zherczeg Sorry for the noise, I just realized that the change has already been cherry-picked to the release branch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Feature implementation jerry-port Related to the port API or the default port implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants