Skip to content
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

Support 32/64 bits build #528

Merged
merged 4 commits into from
Dec 1, 2016
Merged

Conversation

zchokri
Copy link
Contributor

@zchokri zchokri commented Nov 24, 2016

Add SUPPORT_32BIT_IOCTL to CCFLAGS to support 32 bit ioctl system call

@zchokri zchokri changed the title Add 32 bit ioctl support Support 32/64 bits build Nov 24, 2016
@andrew-elder
Copy link

@zchokri - thank you for this pull request. I have a few questions that I will put in the "changes".

Copy link

@andrew-elder andrew-elder left a comment

Choose a reason for hiding this comment

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

Overall changes look ok to me, but I think they should be in separate commits with more accurate comments.

{
return (((static_cast<long long int>((ts).seconds_ms) << sizeof((ts).seconds_ls)*8) +
(ts).seconds_ls)*1000000000LL + (ts).nanoseconds) ; /*!< Converts timestamp value into nanoseconds value*/
}

Choose a reason for hiding this comment

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

Was this change required for building the 32-bit version?

#if defined(__clang__) && defined(__x86_64__)
// Clang/llvm has incompatible long double (fp128) for x86_64.
typedef double FrequencyRatio; /*!< Frequency Ratio */
#else

Choose a reason for hiding this comment

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

This should be a separate commit? It seems un-related to getting 32-bit to compile and run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in 3e91a63

fprintf(stdout, "sync count %u\n", ptpData->sync_count);
fprintf(stdout, "pdelay count %u\n", ptpData->pdelay_count);
fprintf(stdout, "asCapable %s\n", ptpData->asCapable ? "True" : "False");
fprintf(stdout, "Port State %d\n", (int)ptpData->port_state);
fprintf(stdout, "process_id %d\n", (int)ptpData->process_id);

Choose a reason for hiding this comment

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

I think commits in this file should also be a separate commit - I do support these changes.

static inline u_int32_t TS2NS(struct timespec ts)
{
return (((ts).tv_sec*1000000000)+(ts).tv_nsec);
}

Choose a reason for hiding this comment

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

Again - was this required for the 32-bit build? Perhaps a separate commit would be better. Also, the (ts).tv_sec could be replaced with ts.tv_sec if you are now using an inline function.

ifeq ($(32BIT_IOCTL_SUPPORT),y)
CFLAGS_EXTRA += -DSUPPORT_32BIT_IOCTL
endif

Choose a reason for hiding this comment

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

This change seems to me to be the main one relevant to the title of this pull request. I think it should be a separate commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done with commit id : 9c757a4

@zchokri zchokri force-pushed the add_support_32bit branch 2 times, most recently from 9c757a4 to faff4c2 Compare November 29, 2016 08:34
zchokri added 3 commits November 29, 2016 09:45
This patch enforces the type of returned parameters by changing
macro to static inline functions.
Copy link
Contributor Author

@zchokri zchokri left a comment

Choose a reason for hiding this comment

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

Hi andrew-elder

Thank you for review.
I split the pull request to 4 commits :

  1. Change macro to static inline functions a2fb528
  2. Fix incompatible long double (fp128) for x86_64 75c0b3c
  3. Print process id and update local time output format 1996135
  4. Add SUPPORT_32BIT_IOCTL to CCFLAGS to support 32 bit ioctl system call 63a0260

Thanks,
Chokri

ifeq ($(32BIT_IOCTL_SUPPORT),y)
CFLAGS_EXTRA += -DSUPPORT_32BIT_IOCTL
endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done with commit id : 9c757a4

#if defined(__clang__) && defined(__x86_64__)
// Clang/llvm has incompatible long double (fp128) for x86_64.
typedef double FrequencyRatio; /*!< Frequency Ratio */
#else
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in 3e91a63

@andrew-elder
Copy link

Reviewed on conf call.

@andrew-elder andrew-elder merged commit 24e559f into Avnu:open-avb-next Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants